Running a V1 Node
14 min
Supported Platforms
We support running a full node on Ubuntu 22.04 LTS.
Minimum hardware requirements
- 8 cores of CPU and 16 gigabytes of memory (RAM).
- fixed size hard disk, 2TB or elastic volumes, 2TB.
Software prerequisites
- install docker
- install docker compose-plugin
Storing the node data in a different directory (optional)
The default node data directory(./node-data) is in the same directory as the docker-compose.yml file. Mount a new host folder, replace the path ./node-data in docker-compose.yml with the new directory.
Running a full node
- Build docker image locally(optional)
make build - Run node(If the docker image does not exist, pull the image from Docker Hub automaticlly.)
docker-compose up -d- Stop the full node
docker-compose down- Download the node data archive file(recommend).
- Note that this process may take several hours due to the size of the blockchain.
nohup sudo curl -SL https://caduceus.foundation/downloads/node-data.tar.gz -O ./node-data.tar.gz &sudo tar -xzvf ./node-data.tar.gzdocker-compose downsudo cp -r ./node-data/node0 ./node-data/node0.baksudo mv ./data/*.db ./node-data/node0/data/docker-compose up -dChecking the last synced block
If you change the default data directory for node, replace the path "./node-data" with your new directory. or run the command in the same directory as the docker-compose.yml file. You maybe need to wait about serval minutes, and then the node will sync blocks and generate committed logs.
tail ./node-data/node0/stdout-cmpd.txt -f | grep CommittedRestarting a node
Sometimes a node can get stuck. You can restart the node by finding the docker container name by doing
docker psAnd then copying the name (in our case the name was cmp_mainnet_node and doing:
docker restart cmp_mainnet_nodeTesting the RPC
curl -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"2.0","method":"eth_getBlockByNumber","params":["latest", true],"id":1}' http://127.0.0.1:26658