🔌 Installation
1️⃣ Installation packages and dependencies
sudo apt update && sudo apt upgrade -y
sudo apt install curl git wget htop tmux build-essential jq make lz4 gcc unzip -y
➡️ Go Installation
cd $HOME
VER="1.23.4"
wget "https://golang.org/dl/go$VER.linux-amd64.tar.gz"
sudo rm -rf /usr/local/go
sudo tar -C /usr/local -xzf "go$VER.linux-amd64.tar.gz"
rm "go$VER.linux-amd64.tar.gz"
[ ! -f ~/.bash_profile ] && touch ~/.bash_profile
echo "export PATH=$PATH:/usr/local/go/bin:~/go/bin" >> ~/.bash_profile
source $HOME/.bash_profile
[ ! -d ~/go/bin ] && mkdir -p ~/go/bin
2️⃣ Install node
Reminder
You can change the port and wallet name.
echo "export TELLOR_WALLET="mictowallet"" >> $HOME/.bash_profile
echo "export TELLOR_PORT="51"" >> $HOME/.bash_profile
source $HOME/.bash_profile
mkdir -p $HOME/.layer/cosmovisor/genesis/bin
mkdir -p $HOME/.layer/cosmovisor/upgrades/v4.0.1/bin
mkdir -p $HOME/.layer/cosmovisor/upgrades/v4.0.3/bin
wget https://github.com/tellor-io/layer/releases/download/v4.0.0/layer_Linux_x86_64.tar.gz && tar -xvzf layer_Linux_x86_64.tar.gz
rm -rf layer_Linux_x86_64.tar.gz CHANGELOG.md LICENSE README.md
mv $HOME/layerd $HOME/.layer/cosmovisor/genesis/bin/
chmod +x $HOME/.layer/cosmovisor/genesis/bin/layerd
wget https://github.com/tellor-io/layer/releases/download/v4.0.2/layer_Linux_x86_64.tar.gz && tar -xvzf layer_Linux_x86_64.tar.gz
rm -rf layer_Linux_x86_64.tar.gz CHANGELOG.md LICENSE README.md
mv $HOME/layerd $HOME/.layer/cosmovisor/upgrades/v4.0.1/bin/layerd
chmod +x $HOME/.layer/cosmovisor/upgrades/v4.0.1/bin/layerd
wget https://github.com/tellor-io/layer/releases/download/v4.0.3/layer_Linux_x86_64.tar.gz && tar -xvzf layer_Linux_x86_64.tar.gz
rm -rf layer_Linux_x86_64.tar.gz CHANGELOG.md LICENSE README.md
mv $HOME/layerd $HOME/.layer/cosmovisor/upgrades/v4.0.3/bin/layerd
chmod +x $HOME/.layer/cosmovisor/upgrades/v4.0.3/bin/layerd
wget https://github.com/tellor-io/layer/releases/download/v5.0.0/layer_Linux_x86_64.tar.gz && tar -xvzf layer_Linux_x86_64.tar.gz
rm -rf layer_Linux_x86_64.tar.gz CHANGELOG.md LICENSE README.md
mv $HOME/layerd $HOME/.layer/cosmovisor/upgrades/v5.0.0/bin/layerd
chmod +x $HOME/.layer/cosmovisor/upgrades/v5.0.0/bin/layerd
sudo ln -sfn $HOME/.layer/cosmovisor/genesis $HOME/.layer/cosmovisor/current
sudo ln -sfn $HOME/.layer/cosmovisor/current/bin/layerd /usr/local/bin/layerd
go install cosmossdk.io/tools/cosmovisor/cmd/[email protected]
cd
➡️ Create a service
sudo tee /etc/systemd/system/layerd.service > /dev/null <<EOF
[Unit]
Description=Tellor node service
After=network-online.target
[Service]
User=$USER
ExecStart=$(which cosmovisor) run start --home $HOME/.layer --keyring-backend test --key-name $TELLOR_WALLET --api.enable --api.swagger
Restart=on-failure
RestartSec=10
LimitNOFILE=65535
Environment="DAEMON_HOME=$HOME/.layer"
Environment="DAEMON_NAME=layerd"
Environment="UNSAFE_SKIP_BACKUP=true"
Environment="PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:$HOME/.layer/cosmovisor/current/bin"
[Install]
WantedBy=multi-user.target
EOF
➡️ Let’s activate it
sudo systemctl daemon-reload
sudo systemctl enable layerd
➡️ Initialize the node & other
layerd init "Moniker-Name" --chain-id layertest-4
sed -i -e '/^chain-id = /c\chain-id = "layertest-4"' $HOME/.layer/config/client.toml
sed -i -e "s|^node *=.*|node = \"tcp://localhost:${TELLOR_PORT}657\"|" $HOME/.layer/config/client.toml
sed -i -e '/^keyring-backend = /c\keyring-backend = "test"' $HOME/.layer/config/client.toml
➡️ Genesis addrbook
curl https://files.mictonode.com/tellor/genesis/genesis.json -o $HOME/.layer/config/genesis.json
curl https://files.mictonode.com/tellor/addrbook/addrbook.json -o $HOME/.layer/config/addrbook.json
➡️ Port
sed -i.bak -e "s%:26658%:${TELLOR_PORT}658%g;
s%:26657%:${TELLOR_PORT}657%g;
s%:6060%:${TELLOR_PORT}060%g;
s%:26656%:${TELLOR_PORT}656%g;
s%^external_address = \"\"%external_address = \"$(wget -qO- eth0.me):${TELLOR_PORT}656\"%;
s%:26660%:${TELLOR_PORT}660%g" $HOME/.layer/config/config.toml
sed -i.bak -e "s%:1317%:${TELLOR_PORT}317%g;
s%:8080%:${TELLOR_PORT}080%g;
s%:9090%:${TELLOR_PORT}090%g;
s%:9091%:${TELLOR_PORT}091%g;
s%:8545%:${TELLOR_PORT}545%g;
s%:8546%:${TELLOR_PORT}546%g;
s%:6065%:${TELLOR_PORT}065%g" $HOME/.layer/config/app.toml
➡️ Peers and Seeds
SEEDS="[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656"
PEERS="[email protected]:56656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:59656,[email protected]:47656,[email protected]:32656,[email protected]:26656,[email protected]:47656,[email protected]:51656,[email protected]:26656,[email protected]:26656,[email protected]:34656,[email protected]:51656,[email protected]:26656,[email protected]:51656,[email protected]:30856,[email protected]:51656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:51656,[email protected]:51656"
sed -i -e "s/^seeds *=.*/seeds = \"$SEEDS\"/; s/^persistent_peers *=.*/persistent_peers = \"$PEERS\"/" $HOME/.layer/config/config.toml
➡️ Pruning
sed -i -e "s/^pruning *=.*/pruning = \"custom\"/" $HOME/.layer/config/app.toml
sed -i -e "s/^pruning-keep-recent *=.*/pruning-keep-recent = \"100\"/" $HOME/.layer/config/app.toml
sed -i -e "s/^pruning-interval *=.*/pruning-interval = \"10\"/" $HOME/.layer/config/app.toml
➡️ Indexer & Other
sed -i -e "s/^indexer *=.*/indexer = \"null\"/" $HOME/.layer/config/config.toml
➡️ Gas Settings
sed -i 's|minimum-gas-prices =.*|minimum-gas-prices = "0loya"|g' $HOME/.layer/config/app.toml
➡️ Prometheus & Other
sed -i -e "s/prometheus = false/prometheus = true/" $HOME/.layer/config/config.toml
sed -i 's/timeout_commit = "5s"/timeout_commit = "1s"/' ~/.layer/config/config.toml
➡️ Starter Snap (maintenance)
➡️ Create wallet
Warning
Don’t forget to backup the wallet words!
layerd keys add $TELLOR_WALLET
➡️ Let’s get started
sudo systemctl restart layerd
journalctl -fu layerd -o cat
➡️ Log Command
sudo journalctl -fu layerd -o cat
➡️ Create Validator
Reminder
You can’t create a validator without Sync. You must have to catch the latest block.
rm -rf /root/validator.json
cat > ./validator.json << EOF
{
"pubkey": $(layerd tendermint show-validator),
"amount": "1000000loya",
"moniker": "Moniker-Name",
"identity": "optional identity signature (ex. UPort or Keybase)",
"website": "validator's (optional) website",
"security": "validator's (optional) security contact email",
"details": "validator's (optional) details",
"commission-rate": "0.1",
"commission-max-rate": "0.2",
"commission-max-change-rate": "0.05",
"min-self-delegation": "1"
}
EOF
layerd tx staking create-validator ./validator.json --chain-id=layertest-4 --gas 300000 --gas-prices="0.00025loya" --from=$TELLOR_WALLET -y
➡️ Delegate to Yourself
layerd tx staking delegate $(layerd keys show $TELLOR_WALLET --bech val -a) 1000000loya --from $TELLOR_WALLET --chain-id layertest-4 --gas 300000 --gas-prices="0.00025loya" -y
➡️ Import wallet
layerd keys add $TELLOR_WALLET --recover
➡️ Edit Validator
layerd tx staking edit-validator \
--chain-id layertest-4 \
--commission-rate 0.05 \
--new-moniker "validator-name" \
--identity "" \
--details "" \
--website "" \
--security-contact "" \
--from $TELLOR_WALLET \
--node http://localhost:${TELLOR_PORT}657 \
--gas 300000 --gas-prices="0.00025loya" \
-y
➡️ Complete deletion
cd $HOME
sudo systemctl stop layerd
sudo systemctl disable layerd
sudo rm -rf /etc/systemd/system/layerd.service
sudo systemctl daemon-reload
sudo rm -f /usr/local/bin/layerd
sudo rm -f $(which layerd)
sudo rm -rf $HOME/.layer
sed -i "/TELLOR_PORT_/d" $HOME/.bash_profile
➡️ Block check
local_height=$(layerd status | jq -r .sync_info.latest_block_height); network_height=$(curl -s https://tellor-testnet-rpc.mictonode.com/status | jq -r .result.sync_info.latest_block_height); blocks_left=$((network_height - local_height)); echo "Your node height: $local_height"; echo "MictoNode height: $network_height"; echo "Blocks left: $blocks_left"
- Your node height - the current block of your node
- Network height - the last block of the network
- Blocks left - how many blocks your node has left to sync.