⚙️ Installation

🛠️ Hardware Requirements

Additional requirements

⚡ Automatic installation

bash <(curl -s https://raw.githubusercontent.com/UnityNodes/scripts/main/mantrachain/install-mantra.sh)

📝 Manual installation

Installation packeges and dependencies

# Install dependencies for building from source
sudo apt update
sudo apt install -y lz4 jq make git gcc build-essential curl chrony unzip gzip snapd tmux bc

# Install Go
sudo rm -rf /usr/local/go
curl -L https://go.dev/dl/go1.21.6.linux-amd64.tar.gz | sudo tar -xzf - -C /usr/local
echo 'export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin' >> $HOME/.bash_profile
source .bash_profile

Install node

Replace "NODE_MONIKER" with your name moniker

# Clone project repository
cd $HOME
git clone https://github.com/MANTRA-Finance/public.git
cd public
git checkout v3.0.0

# Build binary
make install

# Set node CLI configuration
mantrachaind config chain-id mantra-hongbai-1
mantrachaind config keyring-backend os
mantrachaind config node tcp://localhost:26657
source $HOME/.bash_profile

# Initialize the node
mantrachaind  init "NODE_MONIKER" --chain-id mantra-hongbai-1

# Download genesis and addrbook files
curl https://config-t.noders.services/mantra/genesis.json -o ~/.mantrachaind/config/genesis.json
curl https://config-t.noders.services/mantra/addrbook.json -o ~/.mantrachaind/config/addrbook.json


# Set peers
sed -i.bak -e "s/^persistent_peers *=.*/persistent_peers = \"f32589afc557a5c4a372f38dae72fbaaa8a5b98d@mantra-t-rpc.noders.services:30656\"/" ~/.mantrachaind/config/config.toml

# Set minimum gas price
sed -i -e "s|^minimum-gas-prices *=.*|minimum-gas-prices = \"0.001uom\"|" ~/.mantrachaind/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"|' \
  ~/.mantrachaind/config/app.toml

# Download latest chain data snapshot
SNAP_NAME=$(curl -s https://snapshots.l0vd.com/mantra-testnet/ | egrep -o ">mantrachain-testnet-1.*\.tar.lz4" | tr -d ">")
curl https://snapshots.l0vd.com/mantra-testnet/${SNAP_NAME} | lz4 -dc - | tar -xf - -C $HOME/.mantrachain


# Create a service
sudo tee /etc/systemd/system/mantrachaind.service > /dev/null << EOF
[Unit]
Description=mantra node service
After=network-online.target

[Service]
User=$USER
ExecStart=$(which mantrachaind) start
Restart=on-failure
RestartSec=10
LimitNOFILE=65535
Environment="PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin"

[Install]
WantedBy=multi-user.target
EOF

sudo systemctl daemon-reload
sudo systemctl enable mantrachaind.service

# Start the service and check the logs
sudo systemctl start mantrachaind.service
sudo journalctl -u mantrachaind.service -f -o cat

📝 Create Validator

1️⃣ Create wallet

mantrachaind keys add wallet

Save all information after entering the command, without this you will not be able to restore data to the wallet. SAVE SEED PHRASE (12 words).

2️⃣ Show priv_validator_key.json


cat $HOME/.mantrachain/config/priv_validator_key.json
SAVE YOUR PRIVATE KEY AFTER ENTERING THE COMMAND

3️⃣ Create validator

mantrachaind tx staking create-validator \
--amount 1000000uaum \
--commission-max-change-rate "0.01" \
--commission-max-rate "0.20" \
--commission-rate "0.1" \
--min-self-delegation "1" \
--details "" \
--pubkey $(mantrachaind tendermint show-validator) \
--moniker="YOUR_MONIKER" \
--chain-id  \
--from="wallet" \
--gas-prices 0.0001uaum \
--gas-adjustment 1.5 \
--gas auto \
--yes

Last updated