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 Public DevNet. Our system leverages Docker for ease of deployment and a Chrome extension wallet for managing your test tokens.

Prerequisites

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

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

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

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

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

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

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

  8. Clearing up residue:

    • If you are an existing node operator or have already created your keys, please run the following commands to clear up the old db files, old log files, and old docker images otherwise, you can directly move to step 1.

    • docker stop container <OLD_CONTAINER_NAME>
    • rm -rf [Local Full Path To store configs]/*.persy [Local Full Path To store configs]/supra_history [Local Full Path To store configs]/supra.logdocker system prune -a 
    • docker system prune -a 

    • After running the above commands, you should be left with the following files:

      • smr_private_key.pem

      • smr_public_key.json

      • smr_settings.toml (in case you have run the network before)

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:v1.1.5

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. After downloading the Docker image, start the node and create your key pairs by running the following. Please be sure to follow the notes in this section in case you have already created your keys

    • Start the node

docker run --name [Your Docker Container Name] -v [Local Full Path To store configs]:/supra/configs -e="SUPRA_HOME=/supra/configs" --net=host -itd asia-docker.pkg.dev/supra-devnet-misc/smr-moonshot-devnet/validator-node:v1.1.5
  • Create a new key pair.

NOTE: If you are an existing node operator or have already created your keys beforehand, skip this key generation command. Please be sure to recollect your node’s name and key’s password for the upcoming step.

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

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

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

  • Activate the keypair.

Note: If you are planning to use already generated and backed-up key-pair information, please make sure that smr_private_key.pem and smr_public_key.json files are located under the [Local Full Path To store configs] path.

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

NOTE: To know your old node’s name run the following command:

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

Example of a successful output:

Starting logger runtime at localhost:44325. Use `nc localhost 44325` to change log level.
(*)qa-smr-moonshot-nodeop8
ed25519: 712fbbce20ab7c3ae2cacad4606dec8038140f0403b3fa961d0e359265ca8b67
elgamal: 030fe3bfc96ba787d3313048d9bbffb513dbc4efd108e9f655dced620d27dcda83ef57ad32f8e68150f47d5b9ca0d465300301c088d4b7fcf43a1675265b5a2ba30e9c1e28feffdf9fc31d2309c9ea7f4ee5a7ba609a9867ad267b67215beca7557400000000000000000000000000000000662ffc53f77b1b7e2c7bb19961e8bf0ca47463f69b9461afdc54a6d5f274f8e000000000000000000000000000000000036761af6d063f2ae3a0466f0a7480e2ae15ee04d4a929247dfa705c5004e8d502017db612750ee026aacc5f7d7fdbda88dc47f6b40ac6b6382b64c1942ea2fd620229bde4ea5e322600964d6883947b6ea7ea2aeb37baad7e731c92935fb5511acd02cc4243e1db02905d22cacee7169864eb3e9729f244a3b79a1e8a092cbb621523ebf53d07d4619b95cc579d624fddec446746d9ecc759751516c7280f9d0cc5

Step 3: Add smr_settings.toml

Open any preferred editor:

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

[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 = 3
resume = true
  • update <YOUR_PUBLIC_IP> with respective public-ip information of your node

  • save it as smr_settings.toml

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

Step 4: Setup DKGs configuration

  • Provide your smr_public_key.json to the Supra team. Note: smr_public_key.json will be located under the [Local Full Path To store configs] directory.

  • Supra team will distribute over Supra Testnet Communication Channel prepare_dkgs_defiinition.sh script, which should be used to dump the dkgs_definition.json file and also copy it into a specified docker container.

  • Save the script in the current working directory (although location doesn’t matter).

  • Install script prerequisites: shasum and jq.

  • Run the script to dump and copy the dkgs_definition.json into your container.

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

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

  • Ensure the respective node-operator's email is added to the Grafana Dashboard. If not, kindly request the Supra team to grant access by adding the email.

  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. 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]/supra.log`. An example output for a successful run:

sudo (./nodeops-monitoring-telegraf-centos.sh)/(./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: /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 to push logs 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. Ensure you're a member of our Supra Testnet Communication Channel.

  2. Watch for instructions on when to start your validator node.

  3. 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: 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 8: 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 9: Collect Test Tokens from the DevNet Faucet

Wallet Interface:

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

  2. Click on the Get Faucet 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