CityOfZion / neo-local

Personal blockchain for NEO dApp development!
MIT License
52 stars 26 forks source link

Make chain sync as mounted volume #28

Closed Sindbag closed 6 years ago

Sindbag commented 6 years ago

Could you, please, mount volume for chain sync for separate docker-compose run neo-python calls to be synced, and also optional wallet path specification would be a great feature!

revett commented 6 years ago

Thanks for the issue @Sindbag.

I've just released v0.1.6 which includes a feature for optional wallet file mounting. It is documented in the wiki - Mounting Wallet Files.

Could you explain the separate chain volume in more detail so that I can work on that next?

Sindbag commented 6 years ago

Currently, chain synchronization data is stored inside docker on /home/user/.neopython/Chains path and could be dropped after kill of the container. Idea is to keep those syncs in the main server's filesystem in order to skip sync between starts (runs) of the container. I know there is a way to download most part of the blocks, but it should be done each time

revett commented 6 years ago

Is this an issue because each time you run make start it deletes the existing chain and starts a new one?

Sindbag commented 6 years ago

Not exactly, but including this. I run neo-python container in interactive mode, then I wait till it syncs all the blocks and after all speculations I close it and sync is dropped until new run. Saving sync files between runs would require sync only for the latest missing blocks, instead of the full chain.

revett commented 6 years ago

I don't think I will add this to the project as it is a very niche request. If you'd like to implement within your local project you can mount a new volume at this point in the stack:

https://github.com/CityOfZion/neo-local/blob/ea7d29cb209318376421ea8d34f4ddedd71f04bf/docker-compose.yml#L23-L25

Let me know if you have any issues 👍