Run a Layer Node
Pre-requisites
A local or cloud system running linux, or macOS. If on windows, use WSL. Minimum system specs (at time of writing): - quad-core cpu - 8gb ram - 128gb-2tb nvme storage depending on how you will run your node
Golang v1.22 (install instrauctions here)
jq (
sudo apt install jq
on linux, orbrew install jq
on mac)sed (
sudo apt install sed
on linux, orbrew install sed
on mac)
Here is a list of variables we will set starting in step 4 (refer to these descriptions as needed):
LAYER_NODE_URL
: Set to the unquoted URL (or public IPv4 address) of a seed node, like tellorlayer.com.KEYRING_BACKEND
: Set totest
by default but can be configured here. (test works fine)NODE_MONIKER
: Set to whatever you'd like to use for your validator's public readable name (e.g "bob").ACCOUNT_NAME
: Set to your name or whatever name you choose (like “bill” or "ruth").TELLORNODE_ID
: Set to the unquoted node ID of the seed node.LAYERD_NODE_HOME
: Should be set to "$HOME/.layer/$ACCOUNT_NAME"TELLOR_ADDRESS
: the tellor prefix address for your accountTELLORVALOPER_ADDRESS
: the tellorvaloper prefix address for your account
Initial Setup
Build and Configure layerd
There are 9 steps in this part.
Clone the Layer repo, change directory to
layer.:
Build layerd with the command:
An ethereum RPC is used for reporting tellor bridge transactions Using your favorite text editor, create a file called
secrets.yaml
:
Add this code to the file, replacing `your_sepolia_testnet_rpc_url` with the url of a reliable sepolia rpc:
Exit nano with ctrl^x
then enter y
to save the changes.
Add variables to .bashrc (or .zshrc) Setting variables in .bashrc or .zshrc is not required, but it helps to avoid many common errors.
Open your .bashrc
or .zshrc
file:
Add these lines at the end, editing NODE_MONIKER
be to whatever you'd like to name your node. Edit the ACCOUNT_NAME to whatever you'd like to call your wallet account:
Exit nano with ctrl^x
then enter y
to save the changes.
Restart your terminal, or use source ~/.bashrc
before you continue. (if Linux) Restart your terminal, or use source ~/.zshrc
before you continue. (if mac)
Note: We may need to reset the chain again as we are still cooking. This causes the
TELLORNODE_ID
to change. You can check the current correct id with:
Initialize .layer folder in your home directory
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
orconfigure_layer_mac.sh
scripts from the layerdocs repo.If on linux:
create the script file locally:
Navigate here, select all and copy the code to your clipboard.
Paste the code, then exit nano with
ctrl^x
then entery
to save the changes.
If on Mac:
create the script file locally:
Navigate here, select all and copy the code to your clipboard.
Paste the code, then exit nano with
ctrl^x
then entery
to save the changes.
Give your new script permission to execute and run it to replace the default configs with proper layer chain configs:
You're now ready to start your node with default sync settings. If you want to do a state sync, do the additional config steps here before you continue.
Create an account on Layer You will need a "wallet" account on layer to hold your TRB tokens that you will stake to become a validator reporter.
Security Tips: 1. This guide uses the "test" backend because this is a testnet guide. Always use a secure keyring-backend option like os, file, or pass if you're handling real money! 2. Handle mnemonics/keys with extreme care, even if it’s just a testnet address! 3. Never use an address that holds real "mainnet" funds for testing!
If you do not yet have an account / mnemonic phrase, Generate a new key pair with the command:
Be sure to copy the entire output with the mnemonic and keep it in a very safe place!
If you already have an account with it's mnemonic phrase Import your account with the command: (You will be prompted to input your mnemonic)
You can check accounts any time with:
./layerd keys list
Export your addresses. Your wallet account has two important addresses. First, get the "tellor" prefix address, which is used to send and receive tokens. Copy it and keep it in a safe place:
Next, add the --bech val
flag to get the "tellorvaloper" prefix address, which is used for validator commands. Copy it and keep it in a safe place:
Add these addresses to your .bashrc
or .zshrc
file. Be sure to replace your_tellor_prefix_address
and your_tellorvaloper_prefix_address
in your command:
Restart your terminal, or use source ~/.bashrc
before you continue. (if Linux) Restart your terminal, or use source ~/.zshrc
before you continue. (if mac)
Start your Layer 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. GNU screen is a great option for beginners. More advanced setups can be achieved using systemd.
Run the command:
If your node is configured correctly, you should see the node connecting to end points before rapidly downloading blocks. Please allow time for the node to sync before moving onto setting up a validator.
Last updated