How to set up a Testnet Validator node
It is recommended to install the Ubuntu 22.04 LTS and Docker Engine before setting up your Validator node. Please utilize the below links to the tutorial how (if not already installed):
Recommended hardware requirements to run a Full node:
A fast CPU with 16+ cores
64 GB+ of RAM
A fast SSD drive with at least 1 TB of space (storage capacity will grow over time)
25 MBit/s bandwidth
Ubuntu 22.04 LTS
Prepare the Server
1. Install Docker Engine
Follow the installation guide here: [Install Docker on Ubuntu]https://docs.docker.com/engine/install/ubuntu/
Validator Setup Instructions on the Server
1. Log in to the server
- Open your terminal and log in to your server by specifying its ip address (for example):
ssh root@88.22.333.444
- Enter your password when prompted
2. Clone the Repository
- Execute the following command to clone the validator repository:
git clone https://github.com/CratD2C-SmartChain/CratD2C-validator.git
3. Navigate to the Directory
- Change to the cloned directory:
cd CratD2C-validator/
4. Download the Snapshot
- Download the node snapshot into the current directory:
curl -O https://staking-testnet.cratd2csmartchain.io/downloads/node.tar.gz
5. Extract the Snapshot
- Unpack the downloaded snapshot:
tar -xzf node.tar.gz
6. Open the Validator Configuration
- Open the validator configuration file using Vim:
vim node.env
7. Set Your Private Key
- Find the line starting with PRIVATE_KEY= and replace <here is your private node key> with your CRAT wallet private key and press Esc.
❗️❗️❗️Important. After succsessful start of the node and all checks that it works properly you better to remove private key from node.env
8. Save and Exit
- To save changes and exit Vim, type:
:wq
9. Start the Container
- Bring up the Docker container:
sudo docker compose up -d
The configuration of the Validator node on the server is completed👍
10. Wait until your node will be synchronized up to current blockchain block
Your node is starting to synchronize up to current blockchain block. It takes several hours to complete the process. Synchronization time depends on the snapshot version. You can check current block from your node via command see instruction number 12
Now you need to go to the website https://staking-testnet.cratd2csmartchain.io / and create a Validator there using the same wallet during authorization, the private key from which you specified in paragraph 7 of this instruction.
Optionally instructions
11. Check Container Logs
- Monitor the logs of the container:
sudo docker compose logs -f
12. Verify Node is Running by last block
- Open a new terminal tab. Replace <insert your server ip> with your server's IP address in the following command and execute it:
curl http://<insert your server ip>:8546 \
-X POST \
-H "Content-Type: application/json" \
--data '{"method":"eth_blockNumber","params":[],"id":1,"jsonrpc":"2.0"}'
You will receive the last block of the blockchain and will be able to compare it with the last block in the explorer: https://explorer-testnet.cratd2csmartchain.io/blocks.
13. Verify chain id
- Open a new terminal tab.
- Replace <insert your server ip> with your server's IP address in the following command and execute it:
curl http://<insert your server ip>:8546 \
-X POST \
-H "Content-Type: application/json" \
--data '{"method":"eth_chainId","params":[],"id":1,"jsonrpc":"2.0"}'
- A successful response indicating that the node is running will look like this:
{"jsonrpc":"2.0","id":1,"result":"0xff45"}
Last updated