-
Notifications
You must be signed in to change notification settings - Fork 15
Backup your keys v0.16.3(Docker version)
This tutorial applies to the below scenario you may find yourself in:
You are using docker to run the node
You want to backup your keys to a secure place, to avoid potential loss
- Go to your node folder in your local host
cd $OLDATA
ls
You will see result similar to below:
config.toml consensus consensus.log keystore nodedata
- Shutdown docker container
sudo docker ps
You will see result similar to below:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
fba51ae2e889 e29e7560b874 "/usr/local/bin/full…" 20 minutes ago Up 20 minutes 0.0.0.0:8000->80/tcp happy_cray
Now shutdown the container, use the CONTAINER_ID from last step
sudo docker stop CONTAINER_ID
Check if docker container is shutdown
sudo docker ps
result in last step should gone
- backup all credential files
mkdir ~/olbackup
cd $OLDATA
sudo cp -r consensus/config ~/olbackup/config
sudo cp -r nodedata/accounts.db ~/olbackup/accounts.db
if there is keystore folder under $OLDATA:
sudo cp -r keystore ~/olbackup
cd ~
change the permission of the backup folder
sudo chmod -R 777 olbackup
compress the backup to a file
tar -cvf backup.tar olbackup
ls
you will see a file names backup.tar in current folder
after this, remove the folder:
rm -rf olbackup
and check if the backup.tar file can be successfully decompressed:
tar -xvf backup.tar
after this step, see if the files are there:
ls
you will see a folder names olbackup in current folder
cd olbackup
ls
you will see similar to below
accounts.db config keystore
and check if the structure is similar to below:
├── accounts.db
├── config
│ ├── addrbook.json
│ ├── genesis.json
│ ├── node_key.json
│ ├── priv_validator_key.json
│ └── priv_validator_key_ecdsa.json
└── keystore
├── OL_2020-09-11T17:39:36.888996000EDT_0lt2dfd011ba5e3c8186c76bec7dc09ca04d3d2bd59
└── ...
- keep your credential files in an offline secure place
© OneLedger 2018-2020 Contact Information