Chain ID | Latest Version Tag | Sidecar version | Custom Port |
---|---|---|---|
diamond-1 | v5.5.0 | v5.5.0 | 182 |
Setup validator name
Replace YOUR_MONIKER_GOES_HERE with your validator name
MONIKER="YOUR_MONIKER_GOES_HERE"
Install dependencies
Update system and install build tools
sudo apt -q update
sudo apt -qy install curl git jq lz4 build-essential
sudo apt -qy upgrade
Install Go
sudo rm -rf /usr/local/go
curl -Ls https://go.dev/dl/go1.23.4.linux-amd64.tar.gz | sudo tar -xzf - -C /usr/local
eval $(echo 'export PATH=$PATH:/usr/local/go/bin' | sudo tee /etc/profile.d/golang.sh)
eval $(echo 'export PATH=$PATH:$HOME/go/bin' | tee -a $HOME/.profile)
Download and build binaries
# Clone project repository
cd $HOME
rm -rf zrchain
git clone https://github.com/zenrocklabs/zrchain.git
cd zrchain
git checkout v5.5.0
# Build binaries
make build
# Prepare binaries for Cosmovisor
mkdir -p $HOME/.zrchain/cosmovisor/genesis/bin
mv build/zenrockd $HOME/.zrchain/cosmovisor/genesis/bin/
rm -rf build
# Create application symlinks
ln -s $HOME/.zrchain/cosmovisor/genesis $HOME/.zrchain/cosmovisor/current -f
sudo ln -s $HOME/.zrchain/cosmovisor/current/bin/zenrockd /usr/local/bin/zenrockd -f
Install Cosmovisor and create a service
# Download and install Cosmovisor
go install cosmossdk.io/tools/cosmovisor/cmd/cosmovisor@v1.7.0
# Create service
sudo tee /etc/systemd/system/zenrock.service > /dev/null << EOF
[Unit]
Description=zenrock node service
After=network-online.target
[Service]
User=$USER
ExecStart=$(which cosmovisor) run start
Restart=on-failure
RestartSec=10
LimitNOFILE=65535
Environment="DAEMON_HOME=$HOME/.zrchain"
Environment="DAEMON_NAME=zenrockd"
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/.zrchain/cosmovisor/current/bin"
[Install]
WantedBy=multi-user.target
EOF
sudo systemctl daemon-reload
sudo systemctl enable zenrock.service
Set node configuration
# Set node configuration
zenrockd config set client chain-id diamond-1
zenrockd config set client keyring-backend file
zenrockd config set client node tcp://localhost:18257
Initialize the node
# Initialize the node
zenrockd init $MONIKER --chain-id diamond-1
# Download genesis and addrbook
curl -Ls https://snapshots.kjnodes.com/zenrock/genesis.json > $HOME/.zrchain/config/genesis.json
curl -Ls https://snapshots.kjnodes.com/zenrock/addrbook.json > $HOME/.zrchain/config/addrbook.json
# Add seeds
sed -i -e "s|^seeds *=.*|seeds = \"3f472746f46493309650e5a033076689996c8881@zenrock.rpc.kjnodes.com:18259\"|" $HOME/.zrchain/config/config.toml
# Set minimum gas price
sed -i -e "s|^minimum-gas-prices *=.*|minimum-gas-prices = \"2.5urock\"|" $HOME/.zrchain/config/app.toml
# Set pruning
sed -i \
-e 's|^pruning *=.*|pruning = "custom"|' \
-e 's|^pruning-keep-recent *=.*|pruning-keep-recent = "100"|' \
-e 's|^pruning-keep-every *=.*|pruning-keep-every = "0"|' \
-e 's|^pruning-interval *=.*|pruning-interval = "19"|' \
$HOME/.zrchain/config/app.toml
# Set custom ports
sed -i -e "s%^proxy_app = \"tcp://127.0.0.1:26658\"%proxy_app = \"tcp://127.0.0.1:18258\"%; s%^laddr = \"tcp://127.0.0.1:26657\"%laddr = \"tcp://127.0.0.1:18257\"%; s%^pprof_laddr = \"localhost:6060\"%pprof_laddr = \"localhost:18260\"%; s%^laddr = \"tcp://0.0.0.0:26656\"%laddr = \"tcp://0.0.0.0:18256\"%; s%^prometheus_listen_addr = \":26660\"%prometheus_listen_addr = \":18266\"%" $HOME/.zrchain/config/config.toml
sed -i -e "s%^address = \"tcp://0.0.0.0:1317\"%address = \"tcp://0.0.0.0:18217\"%; s%^address = \":8080\"%address = \":18280\"%; s%^address = \"0.0.0.0:9090\"%address = \"0.0.0.0:18290\"%; s%^address = \"0.0.0.0:9091\"%address = \"0.0.0.0:18291\"%; s%:8545%:18245%; s%:8546%:18246%; s%:6065%:18265%" $HOME/.zrchain/config/app.toml
Download latest chain snapshot
curl -L https://snapshots.kjnodes.com/zenrock/snapshot_latest.tar.lz4 | tar -Ilz4 -xf - -C $HOME/.zrchain
[[ -f $HOME/.zrchain/data/upgrade-info.json ]] && cp $HOME/.zrchain/data/upgrade-info.json $HOME/.zrchain/cosmovisor/genesis/upgrade-info.json
Start service and check the logs
sudo systemctl start zenrock.service && sudo journalctl -u zenrock.service -f --no-hostname -o cat
Validator setup
To set up a validator, follow the steps below. Official validator setup instructions can be found at https://github.com/zenrocklabs/zenrock-validators.
Step 1: Create a wallet
First of all we will need to create wallet for our validator. You have two options for that.
Option 1 - Create new wallet
zenrockd keys add wallet
Option 2 - Recover existing wallet
zenrockd keys add wallet --recover
Save the mnemonic
output as this is the only way to recover your validator wallet in case you lose it!
To list your wallets use command below
zenrockd keys list
Step 2: Fund a wallet
To create validator you have to top up previously created wallet with tokens.
To check wallet balance use command below
zenrockd q bank balances $(zenrockd keys show wallet -a)
Step 3: Create validator
Ensure that you have updated the validator details to match your own.
zenrockd tx validation create-validator <(cat <<EOF
{
"pubkey": $(zenrockd comet show-validator),
"amount": "1000000urock",
"moniker": "YOUR_MONIKER_NAME",
"identity": "YOUR_KEYBASE_ID",
"website": "YOUR_WEBSITE_URL",
"security": "YOUR_SECURITY_EMAIL",
"details": "YOUR_DETAILS",
"commission-rate": "0.05",
"commission-max-rate": "0.20",
"commission-max-change-rate": "0.05",
"min-self-delegation": "1"
}
EOF
) \
--chain-id diamond-1 \
--from wallet \
--gas-adjustment 1.4 \
--gas auto \
--gas-prices 2.5urock \
-y
Save the $HOME/.zrchain/config/priv_validator_key.json
file as this is the only way to recover your validator signing key in case you lose it!