geth blockchain backup operation
export Export the blockchain to a file
import Import a blockchain file
Parameter --datadir The directory where geth and key are located after the
genesis is initialized --syncmode Synchronization mode --cache The number of MB of memory allocated to the internal cache is
similar to import
First start mining and see that there are now 80 blocks.
Now export them to backup
geth export --datadir "directory" --syncmode "full" --cache 2048 a.rlp 0 50
parameters correspond to the values of your startup parameters
ok , Now delete our geth directory, reinitialize, and import it.
Because the geth directory is deleted and reinitialized, the current block height is 1. Now we import the backup data
geth import a.rlp --datadir "directory" --syncmode " full" --cache 2048 Euro
, the import is successful.
No problem starting . Everything is so beautiful