geth backup and import export import operation

geth blockchain backup operation

export Export the blockchain to a file
import Import a blockchain file Insert picture description here
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.
Insert picture description here
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
Insert picture description here
ok , Now delete our geth directory, reinitialize, and import it.
Insert picture description here
Insert picture description here
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
Insert picture description here
, the import is successful.
Insert picture description here
No problem starting . Everything is so beautiful

Guess you like

Origin blog.csdn.net/xia_xu_liang/article/details/107831121