Backing up & Restoring a Node

To move a node to another server, one needs to back it up and restore it on the new server. To do so, follow the instructions below.

Backup

To back up your node, run the following command on your server:

docker exec -it muon-node ./node_modules/.bin/ts-node ./src/cmd/index.ts keys backup > backup.json

This command creates a file named backup.json. You can see the contents of this file using:

cat backup.json

The result will look like the following:

{"SIGN_WALLET_ADDRESS":"0xEEeb...751A","SIGN_WALLET_PRIVATE_KEY":"250c...b18e","PEER_ID":"QmRh...Uw","PEER_PUBLIC_KEY":"CAA...BAAE=","PEER_PRIVATE_KEY":"CAA...RWVA=="}

NB: These contents should be copied and kept somewhere safe.

Restore

To restore the node, follow the "Running the Node" instructions. After running the new node, instead of following "Adding the Node to the Network" section, transfer the backup.json file to your server and then run the following command:

docker exec -it muon-node ./node_modules/.bin/ts-node ./src/cmd/index.ts keys restore "$(cat backup.json)"

Having run the above command, you should receive this message:

.env created successfully.

Now run this command to restart the container:

docker restart muon-node

If the restoration process is successful, querying the status of the node from the following link will return the address and peerId of the backed up node.

http://<server-ip>:8012/status

Last updated