Run Layer

Tellor layer is a proof of stake network open to everyone who wants to run a validator or be a reporter.

Pre-requisites

  • A local or cloud system running linux, or macOS. If on windows, use WSL.

  • Golang (install latest version here)

  • jq (sudo apt install jq on linux, or brew install jq on mac)

  • yq (sudo apt install yq on linux, or brew install yq on mac)

  • sed (sudo apt install sed on linux, or brew install sed on mac)

If running a node for personal RPC (developer):

  • A modern cpu with at least 4 cores

  • ram: 16 gb

  • storage: 500gb+ (solid state)

If running a validator / reporter:

  • A 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)

Initial Setup

Build and Configure layerd

There are 9 steps in this part.

  1. Clone the Layer repo, change directory to layer

# for genesis sync
git clone https://github.com/tellor-io/layer -b v2.0.0-alpha1 && cd layer
  1. Build layerd with the command:

go build ./cmd/layerd
  1. Configure system variables with RPC url and contract address for the bridge. Using your favorite text editor, upen up your .bashrc or .zshrc file:

# if linux
nano ~/.bashrc

#if mac
nano ~/.zshrc

Add these lines to the bottom of the file. Be sure to replace the example URL with your Sepolia testnet RPC url:

# layer
export ETH_RPC_URL='https://any_good_sepolia_rpc_url'
export TOKEN_BRIDGE_CONTRACT="0xFC1C57F1E466605e3Dd40840bC3e7DdAa400528c"

Exit nano with ctrl^x then enter y to save the changes.

  1. Initialize .layer folder in your home directory

./layerd init layer --chain-id layertest-2
  1. Create and Run the configure_layer script We need to change the config files a bit using one of the provided configure_layer_nix.sh or configure_layer_mac.sh scripts from the layerdocs repo.

    If on linux:

    • create the script file locally:

    nano configure_layer_nix.sh # or configure_layer_mac.sh if mac
    • Navigate here, select all and copy the code to your clipboard.

    • Paste the code, then exit nano with ctrl^x then enter y to save the changes.

    If on Mac:

    • create the script file locally:

    nano configure_layer_mac.sh # or configure_layer_mac.sh if mac
    • Navigate here, select all and copy the code to your clipboard.

    • Paste the code, then exit nano with ctrl^x then enter y to save the changes.

    Give your new script permission to execute and run it to replace the default configs with proper layer chain configs:

    # if linux
    chmod +x configure_layer_nix.sh && ./configure_layer_nix.sh
    
    # if mac
    chmod +x configure_layer_mac.sh && ./configure_layer_mac.sh 

    You're now ready to start your node with default sync settings.

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. GNU screen is a great option for beginners. More advanced setups can be achieved using systemd.

If you want to do a state sync, do not start your node yet! Go here and do the State Sync Setup Steps.

If you want to do a genesis sync (takes longer but it always works), continue with the steps below.

  1. Start your layer node:

./layerd start

You should now see your log quickly downloading blocks!

  1. Check if you're fully synced. Open another terminal window and use the command:

./layerd status

You should see a json formated 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