Skip to content

Install

Website | Twitter | Discord | Explorer


Public Endpoints | Genesis | Addrbook

https://mantra-test.rpc.moonbridge.team
Chain ID: mantra-hongbai-1 | Latest Version: v3.0.0 | Custom Port: 143
Specify the name of your “MONIKER” (validator) which will be visible in the explorer
MONIKER="YOUR_MONIKER_NAME"

Update system and install tools

sudo apt update && sudo apt upgrade -y
sudo apt install curl build-essential git jq lz4 ncdu bashtop -y

Install GO

cd $HOME
version="1.21.5"
wget "https://golang.org/dl/go$version.linux-amd64.tar.gz"
sudo rm -rf /usr/local/go
sudo tar -C /usr/local -xzf "go$version.linux-amd64.tar.gz"
rm "go$version.linux-amd64.tar.gz"
echo "export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin" >> $HOME/.bash_profile
source $HOME/.bash_profile

Install Cosmovisor

go install cosmossdk.io/tools/cosmovisor/cmd/cosmovisor@v1.5.0

Download and install

cd $HOME
# Install CosmWasm library
rm -rf /usr/lib/libwasmvm.x86_64.so
sudo wget -P /usr/lib https://github.com/CosmWasm/wasmvm/releases/download/v1.3.1/libwasmvm.x86_64.so
wget https://github.com/MANTRA-Finance/public/raw/main/mantrachain-hongbai/mantrachaind-linux-amd64.zip
unzip mantrachaind-linux-amd64.zip
mv mantrachaind $HOME/go/bin
rm mantrachaind-linux-amd64.zip
mantrachaind version --long | grep -e commit -e version

Config and Init node

# Set node configuration
mantrachaind config chain-id mantra-hongbai-1
mantrachaind config keyring-backend test
mantrachaind config node tcp://localhost:14357
# Initialize node
mantrachaind init $MONIKER --chain-id mantra-hongbai-1
# Download genesis and addrbook
curl -Ls https://snapshots.moonbridge.team/testnet/mantra/genesis.json > $HOME/.mantrachain/config/genesis.json
curl -Ls https://snapshots.moonbridge.team/testnet/mantra/addrbook.json > $HOME/.mantrachain/config/addrbook.json
# Set seeds and peers
SEEDS=""
PEERS=""
sed -i -e "s/^seeds *=.*/seeds = \"$SEEDS\"/; s/^persistent_peers *=.*/persistent_peers = \"$PEERS\"/" $HOME/.mantrachain/config/config.toml
# Setting minimum gas price
sed -i -e "s|^minimum-gas-prices *=.*|minimum-gas-prices = \"0.0002uom\"|" $HOME/.mantrachain/config/app.toml
# Setting pruning
sed -i -e 's|^pruning *=.*|pruning = "custom"|' $HOME/.mantrachain/config/app.toml
sed -i -e 's|^pruning-keep-recent *=.*|pruning-keep-recent = "100"|' $HOME/.mantrachain/config/app.toml
sed -i -e 's|^pruning-keep-every *=.*|pruning-keep-every = "0"|' $HOME/.mantrachain/config/app.toml
sed -i -e 's|^pruning-interval *=.*|pruning-interval = "10"|' $HOME/.mantrachain/config/app.toml
# Disable indexer
sed -i -e 's|^indexer *=.*|indexer = "null"|' $HOME/.mantrachain/config/config.toml
# Enable Prometheus
sed -i -e "s/prometheus = false/prometheus = true/" $HOME/.mantrachain/config/config.toml
# Setting custom ports
sed -i -e "s%^proxy_app = \"tcp://127.0.0.1:26658\"%proxy_app = \"tcp://127.0.0.1:14358\"%; s%^laddr = \"tcp://127.0.0.1:26657\"%laddr = \"tcp://0.0.0.0:14357\"%; s%^pprof_laddr = \"localhost:6060\"%pprof_laddr = \"localhost:14360\"%; s%^laddr = \"tcp://0.0.0.0:26656\"%laddr = \"tcp://0.0.0.0:14356\"%; s%^external_address = \"\"%external_address = \"$(wget -qO- eth0.me):14356\"%; s%^prometheus_listen_addr = \":26660\"%prometheus_listen_addr = \":14366\"%" $HOME/.mantrachain/config/config.toml
sed -i -e "s%:1437%:14317%g; s%:8080%:14380%g; s%:9090%:14390%g; s%:9091%:14391%g; s%:8545%:14345%g; s%:8546%:14346%g; s%:6065%:14365%g" $HOME/.mantrachain/config/app.toml

Configure Cosmovisor

mkdir -p $HOME/.mantrachain/cosmovisor/genesis/bin
mkdir -p $HOME/.mantrachain/cosmovisor/upgrades
cp $HOME/go/bin/mantrachaind $HOME/.mantrachain/cosmovisor/genesis/bin/

Create service

sudo tee /etc/systemd/system/mantrachaind.service > /dev/null << EOF
[Unit]
Description=Mantra Node
After=network-online.target
[Service]
User=$USER
ExecStart=$(which cosmovisor) run start
Restart=always
RestartSec=5
LimitNOFILE=65535
Environment="DAEMON_NAME=mantrachaind"
Environment="DAEMON_HOME=$HOME/.mantrachain"
Environment="UNSAFE_SKIP_BACKUP=true"
Environment="DAEMON_ALLOW_DOWNLOAD_BINARIES=false"
Environment="DAEMON_RESTART_AFTER_UPGRADE=true"
[Install]
WantedBy=multi-user.target
EOF
sudo systemctl daemon-reload
sudo systemctl enable mantrachaind

Download latest snapshot

curl -o - -L https://snapshots.moonbridge.team/testnet/mantra/snapshot_latest.tar.lz4 | lz4 -dc - | tar -x -C $HOME/.mantrachain
[[ -f $HOME/.mantrachain/data/upgrade-info.json ]] && cp $HOME/.mantrachain/data/upgrade-info.json $HOME/.mantrachain/cosmovisor/genesis/upgrade-info.json

Start service and check the logs

sudo systemctl start mantrachaind && sudo journalctl -u mantrachaind -f --no-hostname -o cat

Create wallet

mantrachaind keys add wallet

Check wallet balance

mantrachaind q bank balances $(mantrachaind keys show wallet -a)

Create validator

mantrachaind tx staking create-validator \
--amount 1000000uom \
--pubkey $(mantrachaind tendermint show-validator) \
--moniker "YOUR_MONIKER_NAME" \
--identity "YOUR_KEYBASE_ID" \
--details "YOUR_DETAILS" \
--website "YOUR_WEBSITE_URL" \
--security-contact "YOUR_EMAIL_ADDRESS" \
--chain-id mantra-hongbai-1 \
--commission-rate 0.10 \
--commission-max-rate 0.20 \
--commission-max-change-rate 0.01 \
--min-self-delegation 1 \
--from wallet \
--gas-adjustment 1.4 \
--gas auto \
--gas-prices 0.0002uom \
-y

Delete node

sudo systemctl stop mantrachaind
sudo systemctl disable mantrachaind
sudo rm -rf /etc/systemd/system/mantrachaind.service
sudo systemctl daemon-reload
sudo rm -f $(which mantrachaind)
sudo rm -rf $HOME/.mantrachain