Mars
How To Install Full Node Mars Protocol Testnet
Setting up vars
Your Nodename (validator) that will shows in explorer
NODENAME=<Your_Nodename_Moniker>
Save variables to system
echo "export NODENAME=$NODENAME" >> $HOME/.bash_profile
if [ ! $WALLET ]; then
echo "export WALLET=wallet" >> $HOME/.bash_profile
fi
echo "export MARS_CHAIN_ID=ares-1" >> $HOME/.bash_profile
source $HOME/.bash_profile
Update packages
sudo apt update && sudo apt upgrade -y
Install dependencies
sudo apt install curl build-essential git wget jq make gcc tmux net-tools -y
Install go
if ! [ -x "$(command -v go)" ]; then
ver="1.19.4"
cd $HOME
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"
echo "export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin" >> ~/.bash_profile
source ~/.bash_profile
fi
Download and build binaries
cd $HOME
git clone https://github.com/mars-protocol/hub.git
cd hub
git checkout v1.0.0-rc7
make install
Config app
marsd config chain-id $MARS_CHAIN_ID
marsd config keyring-backend test
Init app
marsd init $NODENAME --chain-id $MARS_CHAIN_ID
Download configuration
curl -s https://raw.githubusercontent.com/mars-protocol/networks/main/ares-1/genesis.json > $HOME/.mars/config/genesis.json
curl -s https://snapshots1-testnet.nodejumper.io/mars-testnet/addrbook.json > $HOME/.mars/config/addrbook.json
Set seeds and peers
PEERS="37fc77cca6c945d12c6e54166c3b9be2802ad1e6@mars-testnet.nodejumper.io:30656,[email protected]:28656,[email protected]:15656,[email protected]:33656,[email protected]:26656,[email protected]:18556,[email protected]:18556,[email protected]:46656,[email protected]:10556,[email protected]:7240,[email protected]:27656,[email protected]:23656,[email protected]:60756,[email protected]:26656,[email protected]:26656,[email protected]:27056,[email protected]:27656,[email protected]:22656,[email protected]:11124,[email protected]:27312,[email protected]:7240,[email protected]:26656,[email protected]:61356,[email protected]:26656,[email protected]:20656,[email protected]:55556,[email protected]:22656,[email protected]:7240,[email protected]:27656,[email protected]:26656,[email protected]:26656,[email protected]:20656,[email protected]:28656,[email protected]:20656,[email protected]:7240,[email protected]:20656,[email protected]:20656,[email protected]:26656,[email protected]:44656,[email protected]:26656,[email protected]:26656,[email protected]:20656,[email protected]:18556,[email protected]:26656,[email protected]:20656,[email protected]:20656,[email protected]:45656,[email protected]:26656,[email protected]:20656,[email protected]:32656,[email protected]:30656"
sed -i 's|^persistent_peers *=.*|persistent_peers = "'$PEERS'"|' $HOME/.mars/config/config.toml
Disable indexing
indexer="null"
sed -i -e "s/^indexer *=.*/indexer = \"$indexer\"/" $HOME/.mars/config/config.toml
Config pruning
pruning="custom"
pruning_keep_recent="100"
pruning_keep_every="0"
pruning_interval="19"
sed -i -e "s/^pruning *=.*/pruning = \"$pruning\"/" $HOME/.mars/config/app.toml
sed -i -e "s/^pruning-keep-recent *=.*/pruning-keep-recent = \"$pruning_keep_recent\"/" $HOME/.mars/config/app.toml
sed -i -e "s/^pruning-keep-every *=.*/pruning-keep-every = \"$pruning_keep_every\"/" $HOME/.mars/config/app.toml
sed -i -e "s/^pruning-interval *=.*/pruning-interval = \"$pruning_interval\"/" $HOME/.mars/config/app.toml
Set minimum gas price
sed -i -e "s|^minimum-gas-prices *=.*|minimum-gas-prices = \"0umars\"|" $HOME/.mars/config/app.toml
Create service
sudo tee /etc/systemd/system/marsd.service > /dev/null << EOF
[Unit]
Description=Mars Node
After=network-online.target
[Service]
User=$USER
ExecStart=$(which marsd) start
Restart=on-failure
RestartSec=10
LimitNOFILE=10000
[Install]
WantedBy=multi-user.target
EOF
Register and start service
sudo systemctl daemon-reload
sudo systemctl enable marsd
sudo systemctl restart marsd && sudo journalctl -u marsd -f -o cat
Last updated