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 v1.5.0 && cd layer
  1. Build layerd with the command:

go build ./cmd/layerd
  1. An ethereum RPC is requred for reporting bridge requests on layer. Using your favorite text editor, create a file called secrets.yaml:

nano secrets.yaml.example

Replacing `your_sepolia_testnet_rpc_url` with the url of a reliable sepolia rpc, and add the token bridge contract address as shown here:

eth_rpc_url: "wss://your_sepolia_testnet_rpc_url"
token_bridge_contract: "0x31F1f15541ea781e170F40A3eEdcfcaC837aFa12"

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:

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

    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. Upgrade the binary when syncing halts. The binary that you need will be visible in the log.

# for binary v1.6.0
git checkout main && git pull && git checkout v1.6.0 && go build ./cmd/layerd

After you build the new binary, kill and restart your node. This must be done for all upgrades since genesis.

  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