Node Setup Manual (testnet)
How to Operate Tellor Layer Node.
Recommended Hardware Specs
Operating a node for a personal RPC can be done using most modern computers.
For running a validator, more power is recommend:
Modern cpu with at least 8 cores / threads
ram: 32 gb
storage: 500gb+ @ NVME gen3+
network: 500mb/s DL, 100mb/s UL (the faster the better)
Note: The memory requirement (32gb) is important to consider if you are planning to operate continuously as a validator. We have tested upgrades with oracle data store migrations that weren't possible on 16gb machines.
Node Setup Quick Start (testnet)
Software Prerequisites
jq, yq, sed, curl, wget, make, and Go are required for running the various commands and config scripts and commands in this guide:
jq
:sudo apt install jq
yq
:sudo apt install yq
sed
:sudo apt install sed
curl
:sudo apt install curl
wget
:sudo apt install wget
Go ≥ 1.22
: Use the default install instructions here.make
:sudo apt install build-essential
Commands shown should just work while logged in as a user (not root).
If you are using an older Mac with an intel chip, the linux versions (amd64) in step 1 below may be used. (just remember to use the mac commands!)
If on raspberry pi or similar, use the binary downloads for "arm64".
Choose How you will Sync your Node
There are two three ways to get a node running on layertest-4:
State Sync: Your node is configured with seeds and peers from which it will try to download recent chain state snapshots. This sync method is faster, but you will not be able to query block info (like transactions) for any blocks that were produced before the day of your sync.
Genesis sync: Your node will start with the genesis binary and sync the entire chain. A different binary will be needed for each upgrade since genesis. This sync method can take a long time depending on how long layertest-4 has been live.
1. Download and Organize the layerd
Binary(s)
layerd
Binary(s)Be sure to select the tabs that work for your setup! You will get errors if you use the linux commands on mac and vice-versa.
First, download the binary from the Tellor Github.
# layertest-4 binary v5.1.0
mkdir -p ~/layer/binaries && cd ~/layer/binaries && mkdir v5.1.0 && cd v5.1.0 && wget https://github.com/tellor-io/layer/releases/download/v5.1.0/layer_Linux_x86_64.tar.gz && tar -xvzf layer_Linux_x86_64.tar.gz
Initialize .layer folder in your home directory:
./layerd init layer --chain-id layertest-4
2. Set System Variables
A Layer node uses the following variables:
TOKEN_BRIDGE_CONTRACT: the token bridge contract address.
ETH_RPC_URL: A reliable Sepolia RPC URL.
ETH_RPC_URL_PRIMARY: Sepolia RPC url for the reporter daemon (can be the same).
ETH_RPC_URL_FALLBACK: A second RPC url for calling the bridge contract if the primary RPC fails to respond.
Set the environment variables so that they are set in new terminal windows by default. Open your .bashrc or .zshrc file with a text editor like nano:
nano ~/.bashrc
Add these lines to the bottom of the file. Remember to replace the example ETH_RPC_URL
with your actual Sepolia testnet RPC url, and if you're going to run a reporter, replace the REPORTERS_VALIDATOR_ADDRESS
with your own as well.
export ETH_RPC_URL="wss://a.good.sepolia.rpc.url"
export ETH_RPC_URL_PRIMARY="wss://a.good.sepolia.rpc.url"
export ETH_RPC_URL_FALLBACK="https://another.sepolia.rpc.url"
export TOKEN_BRIDGE_CONTRACT="0x5acb5977f35b1A91C4fE0F4386eB669E046776F2"
Load the new variables:
source ~/.bashrc
Exit nano with ctrl^x
then enter y
to save the changes.
3. Edit Chain Configuration for Layer.
We need to open up the tellor layer config files and change some variables. You can use any local text editor like code, vim, or nano.
Note: All variables not shown can be safely left as is.
In ~/.layer/config/app.toml
:
# The minimum gas prices a validator is willing to accept for processing a
# transaction. A transaction's fees must meet the minimum of any denomination
# specified in this config (e.g. 0.25token1,0.0001token2).
minimum-gas-prices = "1loya"
# ...
# Address defines the API server to listen on.
address = "tcp://0.0.0.0:1317"
#...
In ~/.layer/config/client.toml
:
#...
# The network chain ID
chain-id = "layertest-4"
# The keyring's backend, where the keys are stored (os|file|kwallet|pass|test|memory)
keyring-backend = "test"
#...
In ~/.layer/config/config.toml
:
#...
# TCP or UNIX socket address for the RPC server to listen on (optional)
laddr = "tcp://0.0.0.0:26657"
#...
# Use '["*"]' to allow any origin
cors_allowed_origins = ["*"]
#...
# Comma separated list of nodes to keep persistent connections to
persistent_peers = "[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656"
#...
# How long we wait after committing a block, before starting on the new
# height (this gives us a chance to receive some more precommits, even
# though we already have +2/3).
timeout_commit = "1s"
#...
4. Sync the Node
Before starting your node, it's a good idea to think about how you want to run it so that the process does not get killed accidentally. This is not obvious for beginners. Try GNU screen or tmux. More advanced setups can be achieved using systemd services.
Choose the tab depending on whether or not you are doing a genesis sync, or a state sync:
We need to make a few more config edits to make sure your state sync goes smoothly.
To find a good trusted height to use for a snapshot sync, we need to find the height of a snapshot available from
https://node-palmito.tellorlayer.com/rpc/
. Copy and paste this entire block of commands into a terminal and hit enter:
export LATEST_HEIGHT=$(curl -s https://node-palmito.tellorlayer.com/rpc/block | jq -r .result.block.header.height); \
export TRUSTED_HEIGHT=$((LATEST_HEIGHT - 35000)); \
export TRUSTED_HASH=$(curl -s "https://node-palmito.tellorlayer.com/rpc/block?height=$TRUSTED_HEIGHT" | jq -r .result.block_id.hash); \
echo $TRUSTED_HEIGHT $TRUSTED_HASH
The output should be something like:
trusted_height: 3785000
Trusted_hash: DD27874AB1F5F4DFC5D7818E7CFBF8A8ECEDA745FFA78DF24D799B2B201418B9
Edit config.toml:
Open your config file:
nano ~/.layer/config/config.toml
Scroll or search (ctrl^w
) the file and edit the state sync variables shown here to match the trusted height and trusted hash you found above:
# [statesync]
# ...
enable = true
#...
rpc_servers = "https://node-palmito.tellorlayer.com/rpc/,https://node-palmito.tellorlayer.com/rpc/"
trust_height = 3785000
trust_hash = "DD27874AB1F5F4DFC5D7818E7CFBF8A8ECEDA745FFA78DF24D799B2B201418B9"
trust_period = "168h0m0s"
Be sure to replace the trust_height
and trust_hash
with the block number and hash from the curl command above.
Exit nano with ctrl^x
then enter y
to save the changes.
Start your node:
./layerd start --home ~/.layer --keyring-backend test --api.enable --api.swagger
The node should start up quickly and begin downloading snapshots from peers.
To check if the node is fully synced, open a separate terminal window and run:
./layerd status
You should see a JSON formatted list of information about your running node. If you see catching_up":false
that means that you're node is fully synced and ready to use!
Last updated