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 !