December 14, 2022

Nibiru Testnet

introduction

Nibiru is a sovereign proof-of-stake blockchain, open-source platform, and member of a family of interconnected blockchains that comprise the Cosmos Ecosystem.

Nibiru unifies leveraged derivatives trading, spot trading, staking, and bonded liquidity provision into a seamless user experience, enabling users of over 40 blockchains to trade with leverage using a suite of composable decentralized applications.

The scope is large, financing $7.5 million. There is nothing to discuss, let's go!

1. Installing and running a node

Update packages and install dependencies

sudo apt update 
sudo apt upgrade --yes
sudo apt-get install jq

Compile binary file

curl -s https://get.nibiru.fi/! | bash

Check version

nibid version

Init chain (<moniker-name> = your name)

nibid init <moniker-name> --chain-id=nibiru-testnet-1 --home $HOME/.nibid

Create key-pair (<key-name> = youy keyname)

nibid keys add <key-name> 

Next, be sure to save the mnemonic,
as well as the address (we will need it for the faucet)

NIBIRU_ADDR=<your_address>
echo "export NIBIRU_ADDR="${NIBIRU_ADDR}"" >> $HOME/.bash_profile
source $HOME/.bash_profile

Download genesis

NETWORK=nibiru-testnet-1
curl -s https://networks.testnet.nibiru.fi/$NETWORK/genesis > genesis.json
cp genesis.json $HOME/.nibid/config/genesis.json

Download seed list

NETWORK=nibiru-testnet-1 
sed -i 's|seeds =.*|seeds = "'$(curl -s https://networks.testnet.nibiru.fi/$NETWORK/seeds)'"|g' $HOME/.nibid/config/config.toml

Set up the minimum price for gas

sed -i 's/minimum-gas-prices =.*/minimum-gas-prices = "0.025unibi"/g' $HOME/.nibid/config/app.toml

Update block parameters

CONFIG_TOML="$HOME/.nibid/config/config.toml" 
sed -i 's/timeout_propose =.*/timeout_propose = "100ms"/g' $CONFIG_TOML 
sed -i 's/timeout_propose_delta =.*/timeout_propose_delta = "500ms"/g' $CONFIG_TOML 
sed -i 's/timeout_prevote =.*/timeout_prevote = "100ms"/g' $CONFIG_TOML 
sed -i 's/timeout_prevote_delta =.*/timeout_prevote_delta = "500ms"/g' $CONFIG_TOML 
sed -i 's/timeout_precommit =.*/timeout_precommit = "100ms"/g' $CONFIG_TOML 
sed -i 's/timeout_precommit_delta =.*/timeout_precommit_delta = "500ms"/g' $CONFIG_TOML 
sed -i 's/timeout_commit =.*/timeout_commit = "1s"/g' $CONFIG_TOML 
sed -i 's/skip_timeout_commit =.*/skip_timeout_commit = false/g' $CONFIG_TOML

Update synchronization parameters

NETWORK=nibiru-testnet-1
sed -i 's|enable =.*|enable = true|g' $HOME/.nibid/config/config.toml
sed -i 's|rpc_servers =.*|rpc_servers = "'$(curl -s https://networks.testnet.nibiru.fi/$NETWORK/rpc_servers)'"|g' $HOME/.nibid/config/config.toml
sed -i 's|trust_height =.*|trust_height = "'$(curl -s https://networks.testnet.nibiru.fi/$NETWORK/trust_height)'"|g' $HOME/.nibid/config/config.toml
sed -i 's|trust_hash =.*|trust_hash = "'$(curl -s https://networks.testnet.nibiru.fi/$NETWORK/trust_hash)'"|g' $HOME/.nibid/config/config.toml

Create and start the node service

To install a node, the official documentation recommends using Cosmovisor, but we used systemd

printf "[Unit]
Description=Nibiru node
After=network-online.target
[Service]
User=$USER
ExecStart=`which nibid` start
Restart=on-failure
RestartSec=3
LimitNOFILE=65535
[Install]
WantedBy=multi-user.target" > /etc/systemd/system/nibirud.service
sudo systemctl daemon-reload 
sudo systemctl enable nibirud
sudo systemctl restart nibirud

Check logs

journalctl -u nibirud -f -n 100

2. Faucet request (2 ways)

1. Request tokens from the faucet:

FAUCET_URL="https://faucet.testnet-1.nibiru.fi/"
curl -X POST -d '{"address": "'"$NIBIRU_ADDR"'", "coins": ["10000000unibi","100000000000unusd"]}' $FAUCET_URL

Console output

2. Join Discord server of the project -> faucet brabch, next we have to send the command:

$request <your_address>, whet <your_address> - your address

Better to use second or both ways.
Discord is an important component for issuing rewards!

3. Running a validator node

!!! Before doing this, you need to make sure that the node is synchronized with the following command (the flag must be set to "false"):

nibid status | jq .SyncInfo.catching_up

Set up nibiru-testnet-1 chain

nibid config chain-id nibiru-testnet-1

We send a transaction to create a validator, be sure to change
next values: details, moniker, from

nibid tx staking create-validator \
--amount 10000000unibi \
--commission-max-change-rate "0.1" \
--commission-max-rate "0.30" \
--commission-rate "0.1" \
--min-self-delegation "1" \
--details "Octopus Space" \
--pubkey=$(nibid tendermint show-validator) \
--moniker octopus_space \
--chain-id nibiru-testnet-1 \
--gas-prices 0.025unibi \
--from octopus_space

from - name of the key you created in 1st point

Be sure to save the contents of the priv_validator_key.json
and node_key.json files in a safe place.
The path to the folder with the files can be displayed with the following command:

echo $HOME/.nibid/config


4. Additionally

Unjailing a validator (change <key_name> with your value):

nibid tx slashing unjail \
  --from=<key_name> \
  --chain-id=nibiru-testnet-1

You can check if the validator has been created in the explorer
by entering your address.

Get the address with this command:

echo $(nibid tendermint show-address)

Check if a validator is in the active set:

nibid query tendermint-validator-set | grep "$(nibid tendermint show-address)"


5. Conclusion

Thank you for your attention. Leave feedback about the guide, your feedback is very important to us! If you have any questions, feel free to to contact us in our TG group!

Project links:

Site - https://docs.nibiru.fi/

Discord - https://discord.gg/nibiru

Official Documentation - https://docs.nibiru.fi/run-nodes/testnet/

Do not forget to subscribe to our social networks. There we publish current news and activities.

Twitter | Telegram Group | Telegram Chat