Node Operators

User Manual for Node Operators

Introduction

Welcome to Supra! This manual will guide you through the process of setting up and operating a node on our blockchain network for our inaugural Pre-Testnet. Our system leverages Docker for ease of deployment and a Chrome extension wallet for managing your test tokens.

Release Notes

  • Updated node key structure which is not backward compatible. Keys need to be re-generated.

  • Migrated from PersyDB to RocksDB

  • Introduce native logging and auto log rotation

  • New mTLS connection layer between Validator-RPC nodes

Prerequisites

  • Ensure you are a member of our Supra Discord Testnet Communication Channel

  • Ask the Supra team in Discord channel to grant read access to the Validator node image repository.

  • Install Docker Engine or Docker Desktop on your machine using the following https://docs.docker.com/engine/install/.

  • You might need to follow the post installation steps (https://docs.docker.com/engine/install/linux-postinstall/#manage-docker-as-a-non-root-user) too.

  • Install Google Cloud CLI (gcloud CLI) using this https://cloud.google.com/sdk/docs/install#linux.

  • Install wget, shasum and jq.

  • Run the following commands to authorize gcloud and Docker to pull the image from the image repository:

    • gcloud auth login

    • gcloud auth configure-docker asia-docker.pkg.dev

  • Hardware Requirements:

    • Cores: 16 to 32

    • RAM: 64G

    • CPU: Intel(R) Xeon(R) Platinum CPU @ 2.8GHz speed or higher

    • Architecture: x86/64

    • Disk Type: SSD

    • Minimum Disk Size: 2TB

    • Network Bandwidth: 1Gbps

  • Clearing up residue:

    • If you are an existing node operator and/or have already created your keys with docker image v2.0.0.rc1, please run the following commands to stop all the old containers and clear up the old db files, old log files, and old docker images. Otherwise, you can directly move to step 1.

    NOTE: Please back up the smr_private_key.pem and smr_public_key.json files before proceeding

    • docker stop container <OLD_CONTAINER_NAME>
    • rm -rf [Local Full Path To store configs]/*.persy [Local Full Path To store configs]/smr_storage [Local Full Path To store configs]/supra.log [Local Full Path To store configs]/supra_history [Local Full Path To store configs]/smr_dkg_data.json [Local Full Path To store configs]/smr_settings.toml
    • docker system prune -a 

Step 1: Download the Docker Image

  1. Open your command-line interface (CLI) on any Terminal application.

  2. Run the following command to download the latest Docker image:

docker pull asia-docker.pkg.dev/supra-devnet-misc/smr-moonshot-devnet/validator-node:v2.0.0

NOTE: If you are not authorized to download the image, you may get the following error. Please ask the Supra team to grant read access to the image repository.

permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post "http://%2Fvar%2Frun%2Fdocker.sock/v1.24/images/create?fromImage=asia-docker.pkg.dev%2Fsupra-devnet-misc%2Fsmr-moonshot-devnet-rc1%2Fvalidator-node&tag=latest": dial unix /var/run/docker.sock: connect: permission denied

Step 2: Start the container and create and/or activate Keys

  1. Start the node

  • After downloading the Docker image, start the Docker container with the latest image using the following command:

docker run --name [Your Docker Container Name] -v [Local Full Path To store configs]:/supra/configs -e="SUPRA_HOME=/supra/configs/" -e="SUPRA_LOG_DIR=/supra/configs/validator_logs" -e="SUPRA_MAX_LOG_FILE_SIZE=10000000" -e="SUPRA_MAX_UNCOMPRESSED_LOGS=10" -e="SUPRA_MAX_LOG_FILES=30"  --net=host -itd asia-docker.pkg.dev/supra-devnet-misc/smr-moonshot-devnet/validator-node:v2.0.0

IMPORTANT NOTE: If you have already created the keypair with v2.0.0.rc1 docker image and have uploaded the keys to the supra-nodeops-data repository, please make sure that the same smr_private_key.pem and smr_public_key.json files are located under the [Local Full Path To store configs] path and skip to the Keypair Activation (Step 2.3) below:

  1. Key pair Generation

  • Create a new key pair using the following command:

docker exec -it [Your Docker Container Name] /supra/supra key generate [NODE_NAME]
  • Create a strong password, then confirm the password to encrypt the secret key.

  • The generated key-pair information (smr_private_key.pem and smr_public_key.json) will be located on your local machine under the [Local Full Path To store configs] path

Uploading keys to Supra’s supra-nodeops-data repository:

  • Create a branch in supra-nodeops-data repo with your team name.

  • Create a folder under round_3 release with [teamname_your_node_public_ip]

    • e.g. supra_35.102.53.124

  • Paste your [Local Full Path To store configs]/smr_public_key.json inside that folder.

  • Push the public key in the remote origin branch on the supra-nodeops-data repo.

  • Please create a PR and notify Supra’s team to merge your PR.

  • Once all the operators have provided their details, Supra’s team will then be able to generate the `dkgs_definition.json` and provide it to you for step 4 completion.

NOTE: You can refer to the sample folder in the supra-nodeops-data repository.

NOTE: Please create a backup of your private keys and secure them according to best practices.

  1. Key pair Activation

List the key pair (for your reference) using the following command:

docker exec -it [Your Docker Container Name] /supra/supra key list

Activate the key pair using the following command:

docker exec -it [Your Docker Container Name] /supra/supra key activate [NODE_NAME]

Step 3: Add smr_settings.toml

  1. Open any preferred editor

  2. Copy the following content to the file

[node_setting]
node_public_addr = "<YOUR_PUBLIC_IP>:25000"
rpc_access_port = 26000
# prune time is set to 2 weeks
prune_block_max_time_ms = 1209600000
smr_storage = "configs/smr_storage"
ledger_storage = "configs/ledger_storage"
commitment_storage = "configs/commitment_storage"
connection_refresh_timeout_sec = 10

[mempool]
batch_size = 500000
gc_depth = 50
max_batch_delay = 100
sync_retry_delay = 5000
sync_retry_nodes = 3

[moonshot]
block_recency_bound = 500000
halt_block_production_when_no_txs = true
leader_elector = "FairSuccession"
max_block_delay = 1000
max_block_size = 100
message_recency_bound = 10
sync_retry_delay = 5000
timeout_delay = 5000

[instance]
chain_id = 4
resume = true
  1. update <YOUR_PUBLIC_IP> with respective public-ip information of your node

  2. Save it with the file name as smr_settings.toml

  3. store it in your [Local Path to Store Configs], which will be mounted on SUPRA_HOME to the Docker container in Step 2.

NOTE: The `smr_settings.toml` file is also present in the supra-nodeops-data repository for reference.

Step 4: Setup DKGs configuration

  1. You can download script prepare_dkgs_defiinition.sh by running the below command, and save the script in the current working directory (although location doesn’t matter), which will be used to dump the dkgs_definition.json file and have it copied into the specified docker container.

    Ensure you’ve installed prerequisites `wget`, `shasum` and `jq` as per your OS distributions.

wget https://raw.githubusercontent.com/Entropy-Foundation/supra-nodeops-data/master/scripts/prepare_dkgs_definition.sh
  1. Run the script to dump and copy the dkgs_definition.json into your container.

  2. During the script's execution, you will be asked to specify the docker container name to which the dkgs_definition.json will be injected.

  • An example output for a successful run:

$ ./prepare_dkgs_definition.sh 


Checking prerequisites ...
Checking 'shasum' ...YES
Checking 'jq' ...YES


Backup previous dkg definitions as:
dkgs_definition.json_2024-03-20T20:22:26


Exported dkgs_definition.json file in current directory:
/home/user/dkgs_definition.json


Checking the checksum ...
Expected: d369dade60869c88f2d1956fc6fe77b15b7dd20c1d9e86b51491d227eb736e17
Actual: d369dade60869c88f2d1956fc6fe77b15b7dd20c1d9e86b51491d227eb736e17


*********************************************
Exported valid dkg definitions
*********************************************


*** Preparing to copy 'dkgs_definition.json' to docker container ...


List of running docker containers ...


CONTAINER ID   IMAGE   COMMAND       CREATED          STATUS      .... NAMES
1b7ae6dbff8e   asia-docker.pkg.dev/supra-devnet-misc/smr-moonshot-devnet/validator-node:v1.1.0   "/bin/bash"  supra-node1


Please specify destination docker container name|ID: supra-node1


Checking 'dkgs_definition.json' content against '/supra/configs/smr_settings.toml' and '/supra/configs/smr_public_key.json' in container 'supra-node1' ... 


Validating node public address info consistency ... SUCCESS
Validating public key info consistency ... SUCCESS


Successfully copied 18.4kB to supra-node1:/supra

Step 5: Node Monitoring and logging configuration.

Prerequisites:

  • Each node-operator’s mail should be invited into the Grafana Dashboard. If not, please request the Supra team to add your respective email to grant access to your dashboard.

  1. For Centos/Amazon Linux:

  • Download the script with the following command.

wget https://raw.githubusercontent.com/Entropy-Foundation/supra-node-monitoring-tool/master/nodeops-monitoring-telegraf-centos.sh
  • Change permission for the script file to be executable using the below command.

chmod +x nodeops-monitoring-telegraf-centos.sh

  1. For Ubuntu/Debian Linux:

  • Change permission for the script file to be executable using the below command.

wget https://raw.githubusercontent.com/Entropy-Foundation/supra-node-monitoring-tool/master/nodeops-monitoring-telegraf.sh
  • Change permission for the script file to be executable using the below command.

chmod +x nodeops-monitoring-telegraf.sh

  1. Run the script file with sudo privileges. Please use the file name according to your Linux Distribution. While running the script, you may be prompted to enter the log path. Please enter the whole log path as a value, which is [Local Full Path To store configs]/validator_logs/supra.log. After that, provide an email to which you want dashboard access.

  • An example output for a successful run:

sudo (./nodeops-monitoring-telegraf-centos.sh) OR (./nodeops-monitoring-telegraf.sh)

Installing promtail...
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
promtail is already the newest version (2.9.6).
0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.
promtail installation completed.
Copying promtail service configuration...
[Unit]
Description=Promtail service
After=network.target

[Service]
Type=simple
User=root
ExecStart=/usr/bin/promtail -config.file /etc/promtail/config.yml
TimeoutSec=60
Restart=on-failure
RestartSec=2

[Install]
WantedBy=multi-user.target
Restarting promtail service...
Done!
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100    12  100    12    0     0     37      0 --:--:-- --:--:-- --:--:--    37
Job name is, webclues-Vostro-5620-27.109.9.122
Title name is Logs-webclues-Vostro-5620-27.109.9.122
Please enter the log file path: /home/ubuntu/supra_configs/supra.log
You entered: /supra/log
Is this correct? (y/n) y
Log file path confirmed: /supra/log
{"id":137,"uid":"99b0330d-79f1-4887-a7e4-0093379639a8","orgId":0,"title":"qa-smr-moonshot-nodeop5-soham-34.105.228.156-Dashboard","url":"/dashboards/f/99b0330d-79f1-4887-a7e4-0093379639a8/qa-smr-moonshot-nodeop5-soham-34.105.228.156-Dashboard","hasAcl":false,"canSave":false,"canEdit":false,"canAdmin":false,"canDelete":false,"createdBy":"Anonymous","created":"2024-03-26T14:57:34.104014174Z","updatedBy":"Anonymous","updated":"2024-03-26T14:57:34.104014233Z","version":1}Updating Dashboard!
Dashboard Updated!
Creating Dashboard
{"folderUid":"99b0330d-79f1-4887-a7e4-0093379639a8","id":138,"slug":"Logs-qa-smr-moonshot-nodeop5-soham-34.105.228.156","status":"success","uid":"85f41b17-eb5b-499a-a722-1ba12ebc3c83","url":"/d/85f41b17-eb5b-499a-a722-1ba12ebc3c83/Logs-qa-smr-moonshot-nodeop5-soham-34.105.228.156","version":1}======Installing the Node exporter=========
-----------------Checking the node exporter is installed, if not will install---------------------
/usr/local/bin/node_exporter
node exporter exits!
useradd: user 'node_exporter' already exists
creating service file for node-exporter
[Unit]
Description=Node Exporter
Wants=network-online.target
After=network-online.target

[Service]
User=node_exporter
Group=node_exporter
Type=simple
ExecStart=/usr/local/bin/node_exporter
Restart=always
RestartSec=3

[Install]
WantedBy=multi-user.target
--------Reloading daemon----------
-------starting and enabling the node-exporter service----------
----------NODE exporter is running------------
Updating Dashboard!
Dashboard Updated!
Creating Dashboard
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 17948  100   276  100 17672   2090   130k --:--:-- --:--:-- --:--:--  133k
Please specify e-mail for dashboard access: [email protected]
Share the following information with Supra Team to get access to the dashboard:
{
  "email": "[email protected]",
  "dashboard": "/d/c2fd23f6-81ea-4ad8-af6a-b445ce28d97c/metric-qa-smr-moonshot-nodeop5-soham-34.105.228.156"
}

  1. This script will configure the Promtail agent and node_exported agent to push logs and metrics to the newly created dashboard on https://monitoring.services.supra.com/ for the respective node operators.

  2. Once it runs successfully, please provide url or folderUid received in the output as shown in the above example and inform the Supra team’s Operations member through the Supra Testnet Communication Channel, so that we can grant you the corresponding role in Grafana to visualize your logs dashboard and Node metrics. NOTE: Until now, you have successfully configured your node. Please proceed to below step to join the supra network.

Step 6: Start your node to join the supra network

  1. Watch for instructions on Supra Testnet Communication Channel to know when to start your validator node.

  2. When instructed, start your node using the command below in your terminal:

docker exec -it [Your Docker Container Name] /supra/supra node smr run

NOTE: If you receive any errors while starting the node, please share log files and history files with our team over the Supra Testnet Communication Channel. The files are located under the [Local Full Path To store configs]

Step 7: Identifying Successful Onboarding

Please make sure the following keywords are present in the logs. You can use a text editor or a command line tool to search the logs.

  1. Consensus check:

Moved to round

If present, this indicates that your node has successfully joined the network and is moving along with the consensus rounds.

  1. Block production check:

Block height 

This indicates that your node is producing blocks along with the network and has successfully onboarded.

Step 8: Install the Chrome Extension Wallet

  1. Obtain the extension from a Supra team member.

  2. Extract the extension package

  3. Open Chrome->Settings->Extensions

  4. Click “Load Unpacked" (top-left corner)

  5. Select the folder where the extension has been unpacked

Step 9: Create a Wallet Address

  1. Open the installed Chrome extension.

  2. Follow the instructions to create a new wallet.

  3. Write down and securely store the mnemonic phrase provided. This phrase is essential for recovering your wallet down the road.

Step 10: Collect Test Tokens from the DevNet Faucet

Wallet Interface:

  1. Select SUPRA network from the list of the networks in the wallet.

  2. Click on the Collect button to collect tokens.

Swagger Interface:

  1. Access our Faucet API documentation via the following link: https://rpc-devnet.supraoracles.com/docs/#/Wallet/faucet

  2. Experiment with the API endpoint by inputting your wallet address and requesting tokens.

  3. To keep track of your wallet balance, refer to the Balance API Documentation found here: https://rpc-devnet.supraoracles.com/docs/#/Accounts/balance.

Troubleshooting and Support

If you encounter any issues, please feel free to contact us on our Discord channel.

Conclusion

Thank you for participating as a node operator in the Supra ecosystem. We sincerely appreciate your contribution to the strength and security of our network.

Last updated