Installation with Cosmovisor
Install Dependencies
sudo apt -q update
sudo apt -qy install curl git jq lz4 build-essential fail2ban ufw
sudo apt -qy upgrade
Setup Moniker, Wallet, and PORT
change the WALLET
, MONIKER
, and CUSTOM_PORT
environment
echo "export WALLET="<your-wallet-name>"" >> $HOME/.bash_profile
echo "export MONIKER="<your-moniker-name>"" >> $HOME/.bash_profile
echo "export CUSTOM_PORT="<your-custom-port>"" >> $HOME/.bash_profile // Please note that updating the port is optional!
echo "export SIDE_CHAIN_ID="side-testnet-2"" >> $HOME/.bash_profile
source $HOME/.bash_profile
Install Go
cd $HOME
VER="1.21.3" // change to the latest version or spesific version
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
Build binary
Cloning project repository & Compile binaries
cd $HOME
sudo wget -O /usr/lib/libwasmvm.x86_64.so https://github.com/CosmWasm/wasmvm/releases/download/v1.3.0/libwasmvm.x86_64.so
wget https://testnet-files.itrocket.net/mantra/mantrachaind-linux-amd64.zip
unzip mantrachaind-linux-amd64.zip
rm mantrachaind-linux-amd64.zip
mv mantrachaind $HOME/go/bin
Prepare binaries for cosmovisor
mkdir -p $HOME/.mantrachain/cosmovisor/genesis/bin
mv build/mantrachaind $HOME/.mantrachain/cosmovisor/genesis/bin/
rm -rf build
Create symlinks
sudo ln -s $HOME/.mantrachain/cosmovisor/genesis $HOME/.mantrachain/cosmovisor/current -f
sudo ln -s $HOME/.mantrachain/cosmovisor/current/bin/mantrachaind /usr/local/bin/mantrachaind -f
Cosmovisor Setup
go install cosmossdk.io/tools/cosmovisor/cmd/cosmovisor@v1.5.0
Create Service File
sudo tee /etc/systemd/system/mantra.service > /dev/null << EOF
[Unit]
Description=mantra node service
After=network-online.target
[Service]
User=$USER
ExecStart=$(which cosmovisor) run start
Restart=on-failure
RestartSec=10
LimitNOFILE=65535
Environment="DAEMON_HOME=$HOME/.mantrachain"
Environment="DAEMON_NAME=mantrachaind"
Environment="UNSAFE_SKIP_BACKUP=true"
Environment="PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:$HOME/.mantrachain/cosmovisor/current/bin"
[Install]
WantedBy=multi-user.target
EOF
Enable service
sudo systemctl daemon-reload
sudo systemctl enable mantrachaind
Config Init App
mantrachaind config node tcp://localhost:${CUSTOM_PORT}657
mantrachaind config keyring-backend os
mantrachaind config chain-id mantrachain-testnet-1
mantrachaind init "MONIKER" --chain-id mantrachain-testnet-1
Download Genesis and Addressbook
we are still in the process to provide genesis and address book files, we recommend to use files from the official side protocol or from itrocket.net below
js filename="Download genesis & addrbook file" copy wget -O $HOME/.mantrachain/config/genesis.json https://testnet-files.itrocket.net/side/genesis.json wget -O $HOME/.mantrachain/config/addrbook.json https://testnet-files.itrocket.net/side/addrbook.json
### Configuration config.toml and app.toml
this for configuration seeds and peers in file config.toml
we are still in the process to provide seeds and peers, we recommend to use from the official side protocol or from itrocket.net below
SEEDS="9c14080752bdfa33f4624f83cd155e2d3976e303@side-testnet-seed.itrocket.net:45656" PEERS="bbbf623474e377664673bde3256fc35a36ba0df1@side-testnet-peer.itrocket.net:45656,9f718219b4987c9625b7e656f231095cefba29e8@95.214.54.146:26858,51d27832df0ebda927247d11eec133323c8f4347@88.198.7.204:36656,d351a91e78c78aef28707c8658d4a8aeb3723e65@128.140.67.251:45656,bba0fc728d37aabf7e2c25ed1c097398158161f1@89.117.53.20:26656,85a16af0aa674b9d1c17c3f2f3a83f28f468174d@167.235.242.236:26656,e6575e39599afba59bbe3422284b22edfb1adafb@23.88.5.169:24656,afeb64d050f0a2c30fa1f9e95ead422f74a2b558@46.4.50.247:11356,4e0fb7292b57e78a73d31a19a609ba6a0e74118f@161.97.170.6:26656,a70265a28a06e5a7d525920514ae17406dbeffd0@104.236.66.76:26656,6def6906f05a0d10a671d3cd2005529d320bb3c7@152.228.208.164:26656"
sed -i -e "s/^seeds _=._/seeds = \"$SEEDS\"/; s/^persistent_peers *=.*/persistent_peers = \"$PEERS\"/" $HOME/.mantrachain/config/config.toml
command for custom port, please note that updating the port is optional!
sed -i.bak -e "s%:1317%:${CUSTOM_PORT}317%g;
s%:8080%:${CUSTOM_PORT}080%g;
s%:9090%:${CUSTOM_PORT}090%g;
s%:9091%:${CUSTOM_PORT}091%g;
s%:8545%:${CUSTOM_PORT}545%g;
s%:8546%:${CUSTOM_PORT}546%g;
s%:6065%:${CUSTOM_PORT}065%g" $HOME/.mantrachain/config/app.toml
sed -i.bak -e "s%:26658%:${CUSTOM_PORT}658%g;
s%:26657%:${CUSTOM_PORT}657%g;
s%:6060%:${CUSTOM_PORT}060%g;
s%:26656%:${CUSTOM_PORT}656%g;
s%^external_address = \"\"%external_address = \"$(wget -qO- eth0.me):${CUSTOM_PORT}656\"%;
s%:26660%:${CUSTOM_PORT}660%g" $HOME/.mantrachain/config/config.toml
command for configuration prunning
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-interval *=.*/pruning-interval = \"50\"/" $HOME/.mantrachain/config/app.toml
command set minimum gas price, enable prometheus and disable indexing
sed -i 's|minimum-gas-prices =.*|minimum-gas-prices = "0.005uside"|g' $HOME/.mantrachain/config/app.toml
sed -i -e "s/prometheus = false/prometheus = true/" $HOME/.mantrachain/config/config.toml
sed -i -e "s/^indexer *=.*/indexer = \"null\"/" $HOME/.mantrachain/config/config.toml
start service
sudo systemctl start mantrachaind && sudo journalctl -u mantrachaind -f
Download snapshot
mantrachaind tendermint unsafe-reset-all --home $HOME/.mantrachain
if curl -s --head curl https://testnet-files.itrocket.net/side/snap_side.tar.lz4 | head -n 1 | grep "200" > /dev/null; then
curl https://testnet-files.itrocket.net/side/snap_side.tar.lz4 | lz4 -dc - | tar -xf - -C $HOME/.mantrachain
else
echo no have snap
fi