Node Setup Quick Start

Use the guided setup shell scripts!

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

  • sed : sudo apt install sed

  • curl: sudo apt install curl

  • wget : sudo apt install wget

Download the latest binary:

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

2. Download the script that matches your system:

Additional info about the scripts can be found here.

curl -O https://raw.githubusercontent.com/tellor-io/layer/refs/heads/main/scripts/setup/initial_config/configure_mainnet_linux.sh && chmod +x configure_mainnet_linux.sh

2.1. Edit the environment variables (optional)

If you'd like to use a custom home directory, custom peers or RPCs you can configure those at the top of the script. The defaults are:

# ...
export LAYER_NODE_URL=https://mainnet.tellorlayer.com/rpc/
export RPC_NODE_ID=cbb94e01df344fdfdee1fdf2f9bb481712e7ef8d
export KEYRING_BACKEND="test"
export PEERS="[email protected]:26656,[email protected]:26656,[email protected]:26656"
export LAYER_HOME="/home/$(logname)/.layer"
export STATE_SYNC_RPC="https://mainnet.tellorlayer.com/rpc/"
export KEY_NAME="test"
# ...

Use your favorite text editor to change these before running the script if desired.

nano configure_mainnet_linux.sh # if linux
# --or--
nano configure_mainnet_mac.sh # if mac

3. Give the script permission to execute, and run it:

./configure_mainnet_linux.sh # if linux
# --or--
./configure_mainnet_mac.sh # if mac

The script should greet you and begin the guided setup!

Options:

  • Snapshot sync: Download a snapshot from a server, extract it into your data folder, and start the node. The node will need time to catch up downloading blocks. At the time of writing this takes about 3 hours to complete.

  • State sync: Sync up to the network using snapshots from peers and a good RPC. At the time of writing this takes about 9 hours to complete.

  • If you want to sync from a snapshot, be sure to select option 2 when asked if you want to set up a state sync, and option 2 again when asked if you want to start the node:

  • Download the snapshot:

curl -O https://layer-node.com/download/1756147790_mainnet.tar
  • Extract the snapshot and move the files to your home directory:

# extract the archive.
tar -xvf 1756147790_mainnet.tar
sudo chown -R $(id -un):$(id -gn) .layer_snapshot
sudo chmod -R u+rwX .layer_snapshot
# move the chain data into your ~/.layer folder
mv -f .layer_snapshot/data/application.db ~/.layer/data/application.db
mv -f .layer_snapshot/data/blockstore.db ~/.layer/data/blockstore.db
mv -f .layer_snapshot/data/cs.wal ~/.layer/data/cs.wal
mv -f .layer_snapshot/data/evidence.db ~/.layer/data/evidence.db
mv -f .layer_snapshot/data/snapshots ~/.layer/data/snapshots
mv -f .layer_snapshot/data/state.db ~/.layer/data/state.db
mv -f .layer_snapshot/data/tx_index.db ~/.layer/data/tx_index.db
# remove the empty folders
rm -rf .layer_snapshot/
  • Start the node!

./layerd start --home ~/.layer --keyring-backend test --key-name KEYNAME --api.enable --api.swagger

Last updated