Deploying a sentry and validator on bluzelleTestNetPublic-22

This post will explain how to deploy and set up a sentry and validator on Bluzelle’s current testnet. 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.15.1.linux-amd64.tar.gz

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

go 1.16 and above will not be compatible with this testnet

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 testnet

Configuration of blzd

Get the chain id

curl --location --request GET 'https://client.sentry.testnet.public.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.testnet.public.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 = "38f92e3e478bf28a534b709ca81c4c1371e39207@13.126.35.139:26656,3cc48e9e87cc25948bbd4f674d18fac4d0cdbd1d@18.192.138.237: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 the testnet genesis file

cd ~/.blzd/config/

rm genesis.json

curl http://sandbox.sentry.testnet.public.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.

Create a keyring and BLZ address

As the user blz on the validator instance, create a key name for the keyring

blzcli keys add <your_key_name>

Enter the password (twice) to be used to encrypted the key file. Save the output (address and mnemonic).

Wait a while for the chain to catch up with your newly created address and paste the following url in your browser and append it with your BLZ address to receive testnet tokens from the faucet.

https://client.sentry.testnet.public.bluzelle.com:1317/mint/

Example

https://client.sentry.testnet.public.bluzelle.com:1317/mint/bluzelle12hp4592hy4j5x733z2ce6eqq9e8rsmjp76ft7j

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, add the following to your validators app.toml file

oracle-user-address ="your_blz_address"
oracle-user-mnemonic ="your_blz_adress_mnemonic"

restart blzd

sudo systemctl restart blzd

Create your validator, 1500000000ubnt is a sensible bounding amount for testnet purposes.

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

Check for your validator on the Chain Explorer