Testing Guide

This guide will teach you how to run a Validator node locally using Docker. The Validator node will be configured to connect to the Sepolia testnet.

Install docker

  1. Update your existing list of packages.

sudo apt update
  1. Install a few prerequisite packages which let apt use packages over HTTPS.

sudo apt install -y apt-transport-https ca-certificates curl software-properties-common
  1. Add the GPG key for the official Docker repository to your system.

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

Add the Docker repository to APT sources.

sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable"
  1. Install Docker.

sudo apt install -y docker-ce

Docker should now be installed, the daemon started, and the process enabled to start on boot. Check that it’s running.

sudo systemctl status docker

Using Docker

Run PostgreSQL

There are three ways to connect PostgreSQL. You can choose one of the following ways.

  1. Connect to PostgreSQL docker.

  2. Connect to local PostgreSQL.

  3. Connect to remote PostgreSQL.

In order to connect to a remote database, you must obtain information about the database and the server. Note the following database details so you can use them to configure your Equito node later.

  • Server hostname or IP

  • Port

  • Username

  • Password

  • Database name

The user must be the owner of the database.

This DATABASE_URL should be set in .env file of Equito Node.

DATABASE_URL=postgresql://[POSTGRES_USER]:[POSTGRES_PASSWORD]@[DB_HOST]:[DB_PORT]/[POSTGRES_DB]?sslmode=[SSL_MODE]
  • [POSTGRES_USER]: The username for the database owner account.

  • [POSTGRES_PASSWORD]: The password for the database owner account.

  • [DB_HOST]: The server hostname or IP address of the database server.

  • [DB_PORT]: The port that the database is listening on. The default port for PostgreSQL is 5432.

  • [POSTGRES_DB]: The name of the database to use for the Equito node.

  • [SSL_MODE]: If you are testing on a database that does not have SSL enabled, you can specify disable so that you don't need to go through the process of configuring SSL on your database. On a production node, set this value to require.

When you want to connect PostgreSQL docker

  1. Run PostgreSQL in a Docker container. You can replace mysecretpassword with your own password.

docker run --name eqt-postgres -e POSTGRES_PASSWORD=mysecretpassword -p 5432:5432 -d postgres
  1. Confirm that the container is running. Note the 5432 port is published 0.0.0.0:5432->5432/tcp and therefore accessible outside of Docker.

docker ps -a -f name=eqt-postgres

If the container is running successfully, the output shows a healthy status:

CONTAINER ID   IMAGE      COMMAND                  CREATED         STATUS         PORTS                    NAMES
dc08cfad2a16   postgres   "docker-entrypoint.s…"   3 minutes ago   Up 3 minutes   0.0.0.0:5432->5432/tcp   eqt-postgres

This is an example of PostgreSQL setting.

DATABASE_URL=postgresql://postgres:postgres@host.docker.internal:5432/postgres?sslmode=disable

When you want to connect to local PostgreSQL

This is an example of PostgreSQL setting. It is the same way as you connect to PostgreSQL docker.

DATABASE_URL=postgresql://postgres:postgres@host.docker.internal:5432/equito_node?sslmode=disable

When you want to connect to remote PostgreSQL

This is an example of PostgreSQL setting.

DATABASE_URL=postgresql://postgres:mypassword@myserver.com:5432/equito_node?sslmode=prefer

Run Validator node

  1. Create a local directory to hold the Equito Protocol data

mkdir ~/.equito-node
  1. Run the following command to create .env file and set environment variables. It includes setttings of wallet and API keys. The wallets should be include more than 0.3 Sepolia ETH and 0.3 BNB.

See how to get the API keys in Configuring node

echo "
NODE_URL=<your-node-url>
PORT=7890
DATABASE_URL=postgresql://[POSTGRES_USER]:[POSTGRES_PASSWORD]@[DB_HOST]:[DB_PORT]/[POSTGRES_DB]?sslmode=[SSL_MODE]

ETHEREUM_WALLET_PRIVATE_KEY=<your-ethereum-wallet-private-key>
BINANCE_WALLET_PRIVATE_KEY=<your-binance-wallet-private-key>
ARBITRUM_WALLET_PRIVATE_KEY=<your-arbitrum-wallet-private-key>
AVALANCHE_WALLET_PRIVATE_KEY=<your-avalanche-wallet-private-key>
BASE_WALLET_PRIVATE_KEY=<your-base-wallet-private-key>
CELO_WALLET_PRIVATE_KEY=<your-celo-wallet-private-key>
FANTOM_WALLET_PRIVATE_KEY=<your-fantom-wallet-private-key>
OPTIMISM_WALLET_PRIVATE_KEY=<your-optimism-wallet-private-key>
POLYGON_WALLET_PRIVATE_KEY=<your-polygon-wallet-private-key>

ETHEREUM_ENDPOINT=<your-ethereum-testnet-endpoint>
BINANCE_ENDPOINT=<your-binance-testnet-endpoint>
ARBITRUM_ENDPOINT=<your-arbitrum-testnet-endpoint>
AVALANCHE_ENDPOINT=<your-avalanche-testnet-endpoint>
BASE_ENDPOINT=<your-base-testnet-endpoint>
CELO_ENDPOINT=<your-celo-testnet-endpoint>
FANTOM_ENDPOINT=<your-fantom-testnet-endpoint>
OPTIMISM_ENDPOINT=<your-optimism-testnet-endpoint>
POLYGON_ENDPOINT=<your-polygon-testnet-endpoint>
" > ~/.equito-node/.env

This is an example of .env setting.

echo "
NODE_URL=https://node.mycompany.com
PORT=7890
DATABASE_URL=postgresql://postgres:postgres@host.docker.internal:5432/postgres?sslmode=disable

ETHEREUM_WALLET_PRIVATE_KEY=756b7f2f95346df4767041da97be8f8c6cbd3cab9de46ef31c85b4af1c507c5a
BINANCE_WALLET_PRIVATE_KEY=756b7f2f95346df4767041da97be8f8c6cbd3cab9de46ef31c85b4af1c507c5a
ARBITRUM_WALLET_PRIVATE_KEY=756b7f2f95346df4767041da97be8f8c6cbd3cab9de46ef31c85b4af1c507c5a
AVALANCHE_WALLET_PRIVATE_KEY=756b7f2f95346df4767041da97be8f8c6cbd3cab9de46ef31c85b4af1c507c5a
BASE_WALLET_PRIVATE_KEY=756b7f2f95346df4767041da97be8f8c6cbd3cab9de46ef31c85b4af1c507c5a
CELO_WALLET_PRIVATE_KEY=756b7f2f95346df4767041da97be8f8c6cbd3cab9de46ef31c85b4af1c507c5a
FANTOM_WALLET_PRIVATE_KEY=756b7f2f95346df4767041da97be8f8c6cbd3cab9de46ef31c85b4af1c507c5a
OPTIMISM_WALLET_PRIVATE_KEY=756b7f2f95346df4767041da97be8f8c6cbd3cab9de46ef31c85b4af1c507c5a
POLYGON_WALLET_PRIVATE_KEY=756b7f2f95346df4767041da97be8f8c6cbd3cab9de46ef31c85b4af1c507c5a

ETHEREUM_ENDPOINT=https://eth-sepolia.g.alchemy.com/v2/ldhqIo8W6kfM3jHV98W4Xuvk2O2PMYP9
BINANCE_ENDPOINT=https://rpc.ankr.com/bsc_testnet_chapel/9460493d52e6dffb6f238e2d867fc5b824c6e98c663cbb91e480cb7c13f3d822
ARBITRUM_ENDPOINT=https://sepolia-rollup.arbitrum.io/rpc
AVALANCHE_ENDPOINT=https://api.avax-test.network/ext/bc/C/rpc
BASE_ENDPOINT=https://sepolia.base.org
CELO_ENDPOINT=https://alfajores-forno.celo-testnet.org
FANTOM_ENDPOINT=https://rpc.testnet.fantom.network
OPTIMISM_ENDPOINT=https://sepolia.optimism.io
POLYGON_ENDPOINT=https://polygon-mumbai-pokt.nodies.app
" > ~/.equito-node/.env

These are the examples of endpoints.

Infura (Ethereum Mainnet & Testnet)

https://mainnet.infura.io/v3/cb206f7f7ed64fb98108a56fac39f934
https://sepolia.infura.io/v3/cb206f7f7ed64fb98108a56fac39f934

Alchemy (Ethereum Mainnet & Testnet)

https://eth-mainnet.g.alchemy.com/v2/cpW9bVq33Ac6lBjI2pwc266AKbGvl9MF
https://eth-sepolia.g.alchemy.com/v2/ldhqIo8W9kfM6jHV31W4Xuvk2O2PMYP8

Ankr (Binance Mainnet & Testnet)

https://rpc.ankr.com/bsc/9460493d52e6dffb6f238e2d812fc5b257c6e60c663cbb91e480cb7c13f3d822
https://rpc.ankr.com/bsc_testnet_chapel/9460493d52e6dffb6f238e2d812fc5b824c6e60c689cbb91e480cb7c13f3d822

You can confirm that the variables are set correctly in .env file.

cat ~/.equito-node/.env
  1. Start the Equito Node by running the Docker image.

cd ~/.equito-node && docker run --env-file ~/.equito-node/.env -d --platform linux/x86_64/v8 --name equito-node -it -p 7890:7890 --add-host=host.docker.internal:host-gateway robindev912/equito-validator-node
  1. Confirm that the container is running. Note the 7890 port is published 0.0.0.0:7890->7890/tcp and therefore accessible outside of Docker.

docker ps -a -f name=equito-node

If the container is running successfully, the output shows a healthy status:

CONTAINER ID   IMAGE                               COMMAND                  CREATED         STATUS         PORTS                                       NAMES
63318f25608e   robindev912/equito-validator-node   "/sbin/tini -- npm s…"   7 minutes ago   Up 7 minutes   0.0.0.0:7890->7890/tcp, :::7890->7890/tcp   equito-node

Testnet tokens faucet

These are the faucets to get test tokens.

Configuring node

Blockchain RPC endpoints

The following services offer Ethereum and Binance API endpoints to work with the Validator node. It is necessary to get API endpoints and set them in .env file.

Alchemy

Visit Alchemy and create API endpoints.

Infura

Visit Infura and create API endpoints.

Ankr

Visit Ankr and create API endpoints.

These are the only environment variables that are required for a Validator node to run. Configure the necessary environment variables in the .env file by obtaining API endpoints from relevant external services. We recommend you to use premium API endpoints for optimal performance and high quality.

Other Configuration

  1. Connect your domain to your hosting. It needs to use SSL for the Domain URL.

  2. Ensure that port 7890 is open for communication with the Equito Node APIs. Redirect your Node URL to this 7890 port using Nginx.

  3. Check all env variables are set correctly.

~/.equito-node docker ps
CONTAINER ID   IMAGE                   COMMAND                  CREATED          STATUS          PORTS                    NAMES
c4a9a8a83a6d   equito-validator-node   "docker-entrypoint.s…"   13 seconds ago   Up 13 seconds   0.0.0.0:7890->7890/tcp   gifted_lovelace
d039fc4c24d7   postgres                "docker-entrypoint.s…"   22 seconds ago   Up 21 seconds   0.0.0.0:5432->5432/tcp   eqt-postgres
  1. Check status of docker. When you see logs of Equito Node docker, if it is successful, it will show the following logs.

docker logs c4a9a8a83a6d
Application has started on 7890
--- dev --- Version: v1.0.240408
--- dev --- Binance block number: 39291754
--- dev --- Binance balance: 9.114297628639779115
--- dev --- Ethereum block number: 5654911
--- dev --- Ethereum balance: 7.893833242556830353
--- dev --- Arbitrum block number: 31621583
--- dev --- Arbitrum balance: 1.00058447087105
--- dev --- Avalanche block number: 31658947
--- dev --- Avalanche balance: 0.5784483945
--- dev --- Base block number: 8409805
--- dev --- Base balance: 0.799630560919761313
--- dev --- Celo block number: 23439320
--- dev --- Celo balance: 20.213343596
--- dev --- Fantom block number: 25196457
--- dev --- Fantom balance: 14.040263020005596
--- dev --- Optimism block number: 10392683
--- dev --- Optimism balance: 0.699675065874292012
--- dev --- Polygon block number: 48010332
--- dev --- Polygon balance: 0.431530183523206655


--- dev --- Success to set all keys.

If all containers are running and you get logs of success, the node is working.

FAQ

How to update the Equito Node docker to up-to-date version?

  1. See the running docker list.

docker ps -a
  1. You can get all of dokcer containers list.

CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
dc1dfc0b5847 robindev912/equito-validator-node "docker-entrypoint.s…" 3 minutes ago Up 3 minutes 0.0.0.0:7890->7890/tcp, :::7890->7890/tcp equito-node
  1. Stop and remove the Equito Node docker.

docker stop dc1dfc0b5847
docker rm dc1dfc0b5847
  1. Get the latest version of Equito Node docker.

docker pull robindev912/equito-validator-node
  1. Run the Equito Node docker.

cd ~/.equito-node && docker run --env-file ~/.equito-node/.env -d --platform linux/x86_64/v8 --name equito-node -it -p 7890:7890 --add-host=host.docker.internal:host-gateway robindev912/equito-validator-node

How to check the runnig Equito Node docker is the up-to-date version?

  1. Get the container ID of running Equito Node docker.

docker ps
CONTAINER ID   IMAGE                               COMMAND                  CREATED          STATUS              PORTS                                       NAMES
3215274b7c34   robindev912/equito-validator-node   "docker-entrypoint.s…"   12 minutes ago   Up About a minute   0.0.0.0:7890->7890/tcp, :::7890->7890/tcp   equito-node
  1. Get the logs of running docker.

docker logs 3215274b7c34

If you see the following log, your Equito Node docker should be pulled to a new version.

If you can't see the following log, your Equito Node docker image is up-to-date.

Application has started on 7890
--- dev --- Error : New version is published

How to verify Node URL is properly linked to Equito Node docker?

When you check the Node URL in web browser, if you set all configuration properly, you can see the following result.

Last updated