Manual Installation
Install dependencies
UPDATE SYSTEM AND INSTALL BUILD TOOLS
Copy sudo apt update && sudo apt upgrade -y
sudo apt install curl tar wget clang pkg-config libssl-dev jq build-essential bsdmainutils git make ncdu gcc git jq chrony liblz4-tool -y
INSTALL GO
Copy cd $HOME
VER="1.23.2"
wget "https://golang.org/dl/go$VER.linux-amd64.tar.gz"
sudo rm -rf /usr/local/go
sudo tar -C /usr/local -xzf "go$VER.linux-amd64.tar.gz"
rm "go$VER.linux-amd64.tar.gz"
[ ! -f ~/.bash_profile ] && touch ~/.bash_profile
echo "export PATH=$PATH:/usr/local/go/bin:~/go/bin" >> ~/.bash_profile
source $HOME/.bash_profile
[ ! -d ~/go/bin ] && mkdir -p ~/go/bin
Set Vars
WALLET yerine istediğiniz bir ismi, MONIKER yerine bir validator adı yazmayı unutmayın.
Copy echo "export WALLET="wallet"" >> $HOME/.bash_profile
echo "export MONIKER="test"" >> $HOME/.bash_profile
echo "export MANTRA_CHAIN_ID="mantra-1"" >> $HOME/.bash_profile
echo "export MANTRA_PORT="22"" >> $HOME/.bash_profile
source $HOME/.bash_profile
Download and build binaries
Copy cd $HOME
wget -O mantrachaind-1.0.2-linux-amd64.tar.gz https://github.com/MANTRA-Chain/mantrachain/releases/download/v1.0.2/mantrachaind-1.0.2-linux-amd64.tar.gz
tar -xzf mantrachaind-1.0.2-linux-amd64.tar.gz
rm $HOME/mantrachaind-1.0.2-linux-amd64.tar.gz
chmod +x $HOME/mantrachaind
sudo mv $HOME/mantrachaind $HOME/go/bin/mantrachaind
Config init app
Copy mantrachaind config node tcp://localhost:${MANTRA_PORT}657
mantrachaind config keyring-backend os
mantrachaind config chain-id mantra-1
mantrachaind init "test" --chain-id mantra-1
Download Genesis and Addrbook
Copy wget -O $HOME/.mantrachain/config/genesis.json https://raw.githubusercontent.com/CoinHuntersTR/props/refs/heads/main/mantra/mainnet/genesis.json
wget -O $HOME/.mantrachain/config/addrbook.json https://raw.githubusercontent.com/CoinHuntersTR/props/refs/heads/main/mantra/mainnet/addrbook.json
Set seeds and peers
Copy # set seeds and peers
URL="https://mantra-dukong-rpc.chainad.org/net_info"
response=$(curl -s $URL)
PEERS=$(echo $response | jq -r '.result.peers[] | "\(.node_info.id)@\(.remote_ip):" + (.node_info.listen_addr | capture("(?<ip>.+):(?<port>[0-9]+)$").port)' | paste -sd "," -)
echo "PEERS=\"$PEERS\""
# Update the persistent_peers in the config.toml file
sed -i -e "s|^seeds *=.*|seeds = \"$SEEDS\"|; s|^persistent_peers *=.*|persistent_peers = \"$PEERS\"|" $HOME/.mantrachain/config/config.toml
Config Pruning
Copy pruning="custom"
pruning_keep_recent="1000"
pruning_keep_every="0"
pruning_interval="10"
sed -i -e "s/^pruning *=.*/pruning = \"$pruning\"/" $HOME/.mantrachain/config/app.toml
sed -i -e "s/^pruning-keep-recent *=.*/pruning-keep-recent = \"$pruning_keep_recent\"/" $HOME/.mantrachain/config/app.toml
sed -i -e "s/^pruning-keep-every *=.*/pruning-keep-every = \"$pruning_keep_every\"/" $HOME/.mantrachain/config/app.toml
sed -i -e "s/^pruning-interval *=.*/pruning-interval = \"$pruning_interval\"/" $HOME/.mantrachain/config/app.toml
set minimum gas price, enable prometheus and disable indexing
Copy sed -i.bak -e "s/^minimum-gas-prices *=.*/minimum-gas-prices = \"0.01uom\"/;" ~/.mantrachain/config/app.toml
external_address=$(wget -qO- eth0.me)
sed -i.bak -e "s/^external_address *=.*/external_address = \"$external_address:26656\"/" $HOME/.mantrachain/config/config.toml
peers=""
sed -i.bak -e "s/^persistent_peers *=.*/persistent_peers = \"$peers\"/" $HOME/.mantrachain/config/config.toml
seeds=""
sed -i.bak -e "s/^seeds =.*/seeds = \"$seeds\"/" $HOME/.mantrachain/config/config.toml
sed -i 's/max_num_inbound_peers =.*/max_num_inbound_peers = 50/g' $HOME/.mantrachain/config/config.toml
sed -i 's/max_num_outbound_peers =.*/max_num_outbound_peers = 50/g' $HOME/.mantrachain/config/config.toml
create service file
Copy sudo tee /etc/systemd/system/mantrachaind.service > /dev/null <<EOF
[Unit]
Description=mantrachaind
After=network-online.target
[Service]
User=$USER
ExecStart=$(which mantrachaind) start
Restart=on-failure
RestartSec=3
LimitNOFILE=65535
[Install]
WantedBy=multi-user.target
EOF
enable and start service
Copy sudo systemctl daemon-reload
sudo systemctl enable mantrachaind
sudo systemctl restart mantrachaind && sudo journalctl -fu mantrachaind -o cat
Snapshot
Stop the service and reset the data
Copy sudo systemctl stop mantrachaind
cp $HOME/.mantrachain/data/priv_validator_state.json $HOME/.mantrachain/priv_validator_state.json.backup
rm -rf $HOME/.mantrachain/data
Download latest snapshot
Copy curl -L https://snapshots.coinhunterstr.com/mainnet/mantra/snapshot_latest.tar.lz4 | lz4 -dc - | tar -xf - -C $HOME/.mantrachain
mv $HOME/.mantrachain/priv_validator_state.json.backup $HOME/.mantrachain/data/priv_validator_state.json
Restart the service and check the log
Copy sudo systemctl restart mantrachaind && sudo journalctl -u mantrachaind -f --no-hostname -o cat
Auto Installation
Copy bash <(wget -qO- https://raw.githubusercontent.com/CoinHuntersTR/props/refs/heads/main/AutoInstall/MantraMainnet.sh)
Sync Node
Node ağ ile eşleşmiş olması gerekiyor. Bunun için mantrachaind status 2>&1 | jq
komutunu çalıştırdığınızda false
çıktısı vermesi gerekir. True
çıktı alırsanız aşağıdaki adımlara devam etmeyin.
Run a Validator
İlk önce Pubkeyimizi alıyoruz.
Copy mantrachaind comet show-validator
{"@type":"/cosmos.crypto.ed25519.PubKey","key":"0LuMdRNJpWGiH+b+................"}
buna benzer bir çıktı alacaksınız.
Sonrasında validator json dosyası açıyoruz.
Aşağıdaki dosyayı kendinize göre düzenlemeyi unutmayın. Validator ismi, site linkleri vs.
Copy cat << EOF > ~/validator.json
{
"pubkey":{"@type":"/cosmos.crypto.ed25519.PubKey","key":"BVTxen+wn6ZgBPUqsgdFDonZ3cr2r+eoYRfF8sTx6kQ="},
"amount": "10000uom",
"moniker": "",
"identity": "",
"website": "",
"security": "",
"details": " Coin Hunters Community ",
"commission-rate": "0.1",
"commission-max-rate": "0.2",
"commission-max-change-rate": "0.01",
"min-self-delegation": "1"
}
EOF
terminale yapıştırdıktan sonra, CTRL X Y enter ile çıkıyoruz.
Şimdi tekrardan node restart atalım
Copy sudo systemctl restart mantrachaind && sudo journalctl -u mantrachaind -f
Şimdi aşağıdaki komutu çalıştırıyoruz. wallet
yerine kendi cüzdan isminizi yazmayı unutmayın. Terminale cüzdan kurmak için Useful Commands
bölümüne bakabilirsiniz.
Copy mantrachaind tx staking create-validator ~/validator.json --from wallet --gas="auto" --gas-adjustment 2 --gas-prices="0.01uom"