CratD2C MainNet Validator Setup

How to set up a MainNet 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):

  • 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:

https://github.com/CratD2C-SmartChain/cratd2c-mainnet-validator-node.git

3. Navigate to the Directory

- Change to the cloned directory:

cd cratd2c-mainnet-validator-node/

4. Open the Validator Configuration

- Open the validator configuration file using Vim:

Copy

vim node.env

5. 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

6. Save and Exit

- To save changes and exit Vim, type:

:wq 

7. Start the Container

- Bring up the Docker container:

sudo docker compose up -d

The configuration of the Validator node on the server is completed👍

8. 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.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

9. Check Container Logs

- Monitor the logs of the container:

sudo docker compose logs -f

10. 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>:8545 \
  -X POST \
  -H "Content-Type: application/json" \
  --data '{"method":"eth_blockNumber","params":[],"id":2310,"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.cratd2csmartchain.io/blocks.

11. 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:

Copy

curl http://<insert your server ip>:8545 \
  -X POST \
  -H "Content-Type: application/json" \
  --data '{"method":"eth_chainId","params":[],"id":2310,"jsonrpc":"2.0"}'    

- A successful response indicating that the node is running will look like this:

Copy

{"jsonrpc":"2.0","id":2310,"result":"0x1a50a6"}

Last updated