Hello there !
Does anyone else Run his/her Own Mainnet Node using Docker ?
With the docker command specified in the documentation (3.c) for the mainnet :
docker run -p 30333:30333 -p 9933:9933 -p 9944:9944 --rm -it centrifugeio/centrifuge-chain:20201022093419-da56ac5 centrifuge-chain --validator --name=“{name}” --node-key={node-key} --chain=mainnet --bootnodes=/ip4/34.89.245.58/tcp/30333/p2p/12D3KooWAVAMPNJywZS3J4be8gFGZACfgt1rXS3MyJ2MxEGtLXjr --bootnodes=/ip4/35.246.188.4/tcp/30333/p2p/12D3KooWCUjDbbhJf1o6skuE1EJ5PnKpJMaK6scmvWsHnjAULzDU
If your VPS reboot, or your container (your node centrifuge) exit for any reason, the container and the volume linked to it are removed… so you loose all the database…
That’s why I would like to share with you what I’ve done on my own, making possible to stop and start
your container without stress. Feel free to give me some feedback !
First of all you need to create a docker volume bind to a local folder of your Vps:
docker volume create --name {VOLUME_NAME} --opt type=none --opt device={PATH_TO_LOCAL_FOLDER} --opt o=bind
Where for example:
{VOLUME_NAME} = my-awesome-centrinode-001
{PATH_TO_LOCAL_FOLDER} = ~/docker-volumes/centrifuge-chain/my-awesome-centrinode-001
You need to create folders using mkdir
Then change a bit the docker run command like this :
- remove
--rm
which is doing the cleanup that causes the container and the volume to disappear - add the new fresh volume created before :
-v {VOLUME_NAME}:/data
- set the restart policy as always :
--restart=always
Here is the edited full command :
docker run --restart=always -p 30333:30333 -p 9933:9933 -p 9944:9944 -v {VOLUME_NAME}:/data -it centrifugeio/centrifuge-chain:20201022093419-da56ac5 centrifuge-chain --validator --name=“{name}” --node-key={node-key} --chain=mainnet --bootnodes=/ip4/34.89.245.58/tcp/30333/p2p/12D3KooWAVAMPNJywZS3J4be8gFGZACfgt1rXS3MyJ2MxEGtLXjr --bootnodes=/ip4/35.246.188.4/tcp/30333/p2p/12D3KooWCUjDbbhJf1o6skuE1EJ5PnKpJMaK6scmvWsHnjAULzDU
Now if my Vps reboot, my Centrifuge Node will restart automatically in state ! \o/
This done, I still have an error message when I’m doing the last point of the documentation (4.) :
curl -H ‘Content-Type: application/json’ --data ‘{ “jsonrpc”:“2.0”, “method”:“author_rotateKeys”, “id”: 1 }’ http://127.0.0.1:9933
This command should return the public keys under the “result” field starting with `0x…
Instead the command returns : curl: (56) Recv failure: Connection reset by peer
Does anyone have this problem too ? In parallel I’m waiting for an answer on Slack.
Thank you for reading, have a good day !