Search
Duplicate
Try Notion
🪙
Set up the validator
We need to set up the validator in an optimal way so the node only takes care of the block generation and nothing else.
Get the correct genesis file
While creating the gentx we generated a genesis.json file but that one doesn’t have all the transactions from the rest of the validators.
The first step is to copy and paste the genesis.json file generated in the previous page to our ~/.evmosd/config folder.
Connect to tmkms to avoid double signing
We need to change the priv_validator_laddr in our config.toml to point to our tmkms running locally.
sed -i -e "s%^priv_validator_laddr *=.*%priv_validator_laddr = \"tcp://127.0.0.1:26658\"%; " $HOME/.evmosd/config/config.toml
Bash
Set up pruning
We are going to keep up to 100 blocks in case something goes wrong, but we are going to remove all the other historical data.
NOTE: this will only remove the historical data but the current status in our database will be up to date with the result of executing all the transactions from the genesis file to the current block.
# Set pruning settings sed -i -e "s%^pruning *=.*%pruning = \"custom\"%; " $HOME/.evmosd/config/app.toml sed -i -e "s%^pruning-keep-recent *=.*%pruning-keep-recent = \"100\"%; " $HOME/.evmosd/config/app.toml sed -i -e "s%^pruning-keep-every *=.*%pruning-keep-every = \"0\"%; " $HOME/.evmosd/config/app.toml sed -i -e "s%^pruning-interval *=.*%pruning-interval = \"10\"%; " $HOME/.evmosd/config/app.toml # Disable snapshots sed -i -e "s%^snapshot-interval *=.*%snapshot-interval = 0%; " $HOME/.evmosd/config/app.toml
Bash
Make sure that the transaction indexer is off
To reduce the space used by the node, we are not going to keep a transaction index:
sed -i -e "s%^indexer *=.*%indexer = \"null\"%; " $HOME/.evmosd/config/config.toml
Bash
Limit all the api connections to localhost
We don’t want to be spammed by very heavy queries and not being able to keep up to date with the chain, because that is going to make us miss some blocks.
# Limit GRPC to local calls sed -i -e "s%^address = \"0.0.0.0:9090\"%address = \"127.0.0.1:9090\"%; " $HOME/.evmosd/config/app.toml sed -i -e "s%^address = \"0.0.0.0:9091\"%address = \"127.0.0.1:9091\"%; " $HOME/.evmosd/config/app.toml # Point eth endpoints to localhost in case we forget to disable it sed -i -e "s%^address = \"0.0.0.0:8545\"%address = \"127.0.0.1:8545\"%; " $HOME/.evmosd/config/app.toml sed -i -e "s%^ws-address = \"0.0.0.0:8546\"%ws-address = \"127.0.0.1:8546\"%; " $HOME/.evmosd/config/app.toml sed -i -e "s%^api = \"eth,net,web3\"%api = \"eth\"%; " $HOME/.evmosd/config/app.toml
Bash
Remove default seeds:
Remove the default seed nodes, we just want to connect to the workshop validators. Also we are running in a different chain-id so the mainnet validators won’t be able to connect to us.
sed -i -e "s%^seeds = \"40f4fac63da8b1ce8f850b0fa0f79b2699d2ce72@seed.evmos.jerrychong.com:26656,e3e11fca4ecf4035a751f3fea90e3a821e274487@bd-evmos-mainnet-seed-node-01.bdnodes.net:26656,fc86e7e75c5d2e4699535e1b1bec98ae55b16826@bd-evmos-mainnet-seed-node-02.bdnodes.net:26656\"%seeds = \"\"%; " $HOME/.evmosd/config/config.toml
Bash
Set up the persistent peers:
We are going to force our nodes to connect to all the nodes in the workshop.
In order to do that we need the hash, ip and port for all the peers and populate the persistent_peers list.
There is a command to get your node id (hash)
~/evmosd tendermint show-node-id #aa2b25045fe86323a5a97fbcc1a674b907b8be75
Bash
For the ip we are going to use the internal ip for our google vm, because all the vms are connected with each other. (Using the internal ip allows us to not open the 26656 port to internet)
sudo apt install net-tools ifconfig | grep inet | head -1 | xargs | cut -d " " -f2 # 10.128.0.51
Bash
Port is going to be the default one: 26656
Example:
sed -i -e "s%^persistent_peers *=.*%persistent_peers = \"f1cfdabf8e58e7ca4550ace6ad4db031e997f779@10.128.0.51:26656\"%; " $HOME/.evmosd/config/config.toml
Bash
Base sed command
We need to replace the workshop string with the node hash and remove the newlines
sed -i -e "s%^persistent_peers *=.*%persistent_peers = \" workshop1@10.128.0.57:26656, workshop2@10.128.0.58:26656, workshop3@10.128.0.60:26656, workshop4@10.128.0.62:26656, workshop5@10.128.15.192:26656, workshop6@10.128.0.61:26656, workshop7@10.128.15.194:26656, workshop8@10.128.15.193:26656, workshop9@10.128.0.63:26656, workshop10@10.128.0.59:26656, \"%; " $HOME/.evmosd/config/config.toml
Bash