hermeznetwork / hermez-node

Hermez node Go implementation
GNU Affero General Public License v3.0
58 stars 33 forks source link

Feature/make backup #1098

Closed Mikelle closed 3 years ago

Mikelle commented 3 years ago

Closes https://github.com/hermeznetwork/hermez-node/issues/897

What does this PR does?

This PR adds a new command backup

How to test?

dist/heznode backup --mode coord --cfg cmd/heznode/cfg.builder.toml --path /home/ubuntu/hez-node - this is the new command. It creates a SQL dump of the Postgres DB, copies the last 10 BatchNums, current and last folders, and zip them to one file. Parameter path - it's where this zip will be located. Make sure, that pg_dump is installed on the machine, to be able to run this command.

Checklist

These are the criteria that every PR should meet, please check them off as you review them:

jeffprestes commented 3 years ago

Awesome! Tested it in my node and it worked fine.

Since we have the whole backup in one file, what do you guys think about creating a new command like backup-restore to apply the backup from the zip file?

it could be something like this

dist/heznode backup-restore --mode coord --cfg cmd/heznode/cfg.builder.toml --path /home/ubuntu/hez-node/file.zip

I'm also not sure about the backup-restore command name, naming things is hard! :(

I think it's a nice idea. Could you please open a new issue with this idea?

tclemos commented 3 years ago

For sure! Here it is: https://github.com/hermeznetwork/hermez-node/issues/1100