Deploying a sentry and validator on Bluzelle's mainnet

This post will explain how to deploy and set up a sentry and validator on Bluzelle’s mainnet. The sentry will act as a proxy for the validator.

You’ll need 2 instances of your favorit linux distro, this guide was done using Debian 10. Make adjustments where needed.

1 vCPU, 4 gb ram and 80 gb of storage will get the job done (for now)

Install dependencies

sudo apt install git build-essential jq nano wget -y

Create a user to run Bluzelle Curium

sudo adduser blz

Increase the open files limit for the user blz

sudo nano /etc/security/limits.conf

blz hard nofile 1048576
blz soft nofile 65536

Install go

wget https://golang.org/dl/go1.16.3.linux-amd64.tar.gz

sudo tar -C /usr/local -xzf go1.16.3.linux-amd64.tar.gz

If you read this post a while after it was created check for updated versions of go.

Setting variables and environment for the user blz

Switch to the user blz

nano ~/.profile

export GOPATH=$HOME/go
export GOBIN=${GOPATH}/bin
export PATH=$PATH:$GOBIN:/usr/local/go/bin

source ~/.profile

mkdir -p ~/go/src/github.com/bluzelle
mkdir ~/go/bin
mkdir ~/go/pkg

Building Bluzelle Curium

Still as the user blz

cd ~/go/src/github.com/bluzelle

git clone https://github.com/bluzelle/curium.git

cd ~/go/src/github.com/bluzelle/curium

make mainet

Configuration of blzd

Get the chain id

curl --location --request GET 'https://client.sentry.net.bluzelle.com:1317 node_info' -s | jq '.node_info.network' | tr -d '"'

Come up with a name for your sentry and validator and create the config files on both instances.

blzd init <MySentry> --chain-id <chain-id> 2>&1 | jq .node_id

Save the output of the node IDs

More config commands

blzcli config chain-id <chain-id>
blzcli config output json 
blzcli config indent true 
blzcli config trust-node true
blzcli config keyring-backend file

On the sentry instance edit ~/.blzd/config/config.toml and add Bluzelle’s public sentries and your validator to persistent_peers. You can find public sentries provided by Bluzelle with

 curl -s http://sandbox.sentry.net.bluzelle.com:26657/net_info | jq -C '[.result.peers[] | select(.node_info.moniker | startswith("daemon-sentry-gateway")) | {moniker: .node_info.moniker, id: .node_info.id, ip_address: .remote_ip}] | sort_by(.moniker)'

or just paste the ones below, don’t forget to add your validator if pasting.

persistent_peers = "91be007a98f7e25e5184a99800d627fefc952a7f@65.1.75.40:26656, 9a613bbe8de4b5b447f790c3adc79c20b28c8658@3.36.151.135:26656,79dc1ba4aec31014bd4a777d187e83c32f2e890c@52.63.212.183:26656"

On the sentry instance add your validator’s node id, and node id only to private_peer_ids

On the validator instance add your sentry as the persistent peer

On both instances set addr_book_strict = false

On both instances set persistent_peers_max_dial_period = "1s"

On the sentry change max_num_inbound_peers and max_num_outbound_peers to sensible values.

On the validator set pex = false

On both instanced edit ~/.blzd/config/app.toml

minimum-gas-prices = "0.002ubnt"

and append the config file with

bluzelle_crud = true

Get mainnet’s genesis file

cd ~/.blzd/config/

rm genesis.json

curl http://sandbox.sentry.net.bluzelle.com:26657/genesis | jq '.result.genesis' > genesis.json

Create a systemd script to run Bluzelle Curium

sudo nano /etc/systemd/system/blzd.service

[Unit]
Description=Bluzelle curium
After=network.target
StartLimitIntervalSec=0

[Service]
Type=simple
Restart=always
RestartSec=3
User=blz
ExecStart=/home/blz/go/bin/blzd start
[Install]
WantedBy=multi-user.target

sudo systemctl enable blzd

Start and monitor the daemon

sudo systemctl start blzd

Couple of ways to monitor the daemon

sudo tail -F /var/log/syslog

sudo systemctl status blzd

sudo journalctl -u blzd

Wait for the chain to sync, this can take quite some time, you can check the block explorer to see what the current block height is and compare your progress or run the command

watch 'blzcli status | jq ".sync_info.catching_up == false"'

When that command returns true your node is synced. You can have both instances sync the chain simultaneously.

Import your BLZ wallet

As the user blz on the validator instance, import your BLZ wallet.

blzcli keys add <your_key_name> --recover

Enter the password (twice) to be used to encrypted the key file. Enter the same mnemonic used on the staking site and provide a password to protect the private key.

Check that the key is imported correctly and your balance is correct

blzcli q account $(blzcli keys show <your_key_name> -a) | jq ".value.coins"

Once the chain is synced, create the validator.

blzcli tx staking create-validator \
  --amount=<bonding amount in ubnt> \
  --pubkey=$(blzd tendermint show-validator) \
  --website="<your website>" \
  --details="<description of your organization>" \ 
  --security-contact="<contact information>" \
  --identity=<keyBase/UPort 16 HEX digit PGP public key hash> \
  --moniker=<your validator name> \
  --commission-rate=0.1 \
  --commission-max-rate=0.2 \
  --commission-max-change-rate=0.01 \
  --min-self-delegation=1 \
  --gas=auto --gas-adjustment=2.0 \
  --gas-prices=0.002ubnt \
  --from <your_key_name>

If you run into problems check the help pages blzcli tx staking create-validator -h