go install github.com/cosmos/cosmos-sdk/cosmovisor/cmd/cosmovisor@v1.0.0
Install Node
Install the current version of node binary.
In order to check that the installation was successful, you can run the following command
berad --version
Which should output something like:
0.1.9-alpha
Join the network
Once the chain-id has been distributed, it is possible to join the network with the CHAIN_ID:
export HOMEDIR=/home/user/.berad
export KEYRING="os"
export CHAIN_ID="artio-80085" ## (replace with the actual chain-id)
export MONIKER="MYMONIKER" ## (replace with your moniker)
berad init $MONIKER --chain-id "artio-80085"
Set config file
berad config set client chain-id "$CHAIN_ID" --home "$HOMEDIR";
berad config set client keyring-backend $KEYRING --home "$HOMEDIR";
We can use sed to update various node configuration values without having to manually edit each file - which can be a pain.
Replace the values below with your own. These commands will update the following:
minimum_gas_prices
pruning configs
snapshot configs
sed -i -e "s|^minimum-gas-prices *=.*|minimum-gas-prices = \"0abgt\"|" $HOME/.berad/config/app.toml
sed -i -e "s|^pruning *=.*|pruning = \"custom\"|" $HOME/.berad/config/app.toml
sed -i -e "s|^pruning-keep-recent *=.*|pruning-keep-recent = \"113\"|" $HOME/.berad/config/app.toml
sed -i -e "s|^pruning-keep-every *=.*|pruning-keep-every = \"0\"|" $HOME/.berad/config/app.toml
sed -i -e "s|^pruning-interval *=.*|pruning-interval = \"17\"|" $HOME/.berad/config/app.toml
sed -i -e "s|^snapshot-interval *=.*|snapshot-interval = \"0\"|" $HOME/.berad/config/app.toml
sed -i -e "s|^snapshot-keep-recent *=.*|snapshot-keep-recent = \"2\"|" $HOME/.berad/config/app.toml
Updating node ports
We'll use a powerful tool called sed for this process. sed is a stream editor that can perform operations, like substitutions, on a text file.
We will specifically focus on updating the ports to use a standardized prefix for your chain. This ensures consistency and improves overall system organization. It will also allow you to run multiple chains on a single server.
Let's start by understanding what we're updating:
proxy_app: This is the address used for inter-process communication between the ABCI application and the consensus engine.
laddr: This is the address that your node listens on for incoming connections.
pprof_laddr: This is the address for the profiling server to listen on.
prometheus_listen_addr: This is the address for the Prometheus metrics server to listen on.
address: These are various addresses that your node may use to listen for different types of connections.
Set Your Chain and Port Prefix
Your chain in this case is BeraChain. For Berachain, we want to set the port prefix as 254. The port prefix will be used to replace the first 2 or 3 digits of the original ports.
# Set the prefix
export PREFIX=254
Update config.toml
Next, we will update the config.toml file. For 5-digit ports, the first 3 digits will be replaced. Here is how to calculate the new port values and update the config.toml file:
# Miner config
[polaris.polar.miner]
# The address to which mining rewards will be sent
etherbase = "YOURADDRESS HERE"
# Extra data included in mined blocks
extra-data = "0x"
Follow the Setup Cosmovisor instructions to setup cosmovisor and start the node.
Create (or restore) a local key pair
Either create a new key pair or restore an existing wallet for your validator:
# Create new keypair
berad keys add YOURKEY
# Restore existing juno wallet with mnemonic seed phrase.
# You will be prompted to enter mnemonic seed.
berad keys add YOURKEY --recover
# Query the keystore for your public address
berad keys show YOURKEY -a
After creating a new key, the key information and seed phrase will be shown. It is essential to write this seed phrase down and keep it in a safe place. The seed phrase is the only way to restore your keys.
Upgrade to a validator
Do not attempt to upgrade your node to a validator until the node is fully in sync as per the previous step.
To upgrade the node to a validator, you will need to submit a create-validator transaction:
The above transaction is just an example. There are many more flags that can be set to customise your validator, such as your validator website, or keybase.io id, etc. To see a full list:
berad tx staking create-validator --help
Backup critical files
There are certain files that you need to backup to be able to restore your validator if, for some reason, it damaged or lost in some way. Please make a secure backup of the following files located in ~/.dymension/config/:
priv_validator_key.json
node_key.json
It is recommended that you encrypt the backup of these files.