Welcome to validator AlxVoy ⚡ ANODE.TEAM



Mars Protocol

Links

RPC

API

Peers and seeds

Genesis and addrbook

Explorers

Auto installation script

wget https://anode.team/Mars/test/setup_mars.sh && chmod u+x setup_mars.sh && ./setup_mars.sh

Software Requirements

  • Prerequisite: go1.18.5+ required. ref
  • Prerequisite: git. ref

Install last binary

git clone https://github.com/mars-protocol/hub mars
cd mars
git checkout v1.0.0-rc7
make install

Init the config files

marsd init <moniker> --chain-id ares-1
marsd config chain-id ares-1

Create a wallet

marsd keys add <wallet_name>

Download genesis and addrbook

curl https://anode.team/Mars/test/genesis.json > ~/.mars/config/genesis.json
curl https://anode.team/Mars/test/addrbook.json > ~/.mars/config/addrbook.json

Add peers and seed

seeds="ade4d8bc8cbe014af6ebdf3cb7b1e9ad36f412c0@testnet-seeds.polkachu.com:18556"
sed -i.bak -e "s/^seeds *=.*/seeds = \"$seeds\"/; s/^persistent_peers *=.*/persistent_peers = \"$peers\"/" ~/.mars/config/config.toml

Create the service file

sudo tee /etc/systemd/system/marsd.service > /dev/null <<EOF
[Unit]
Description=Mars Protocol
After=network-online.target

[Service]
User=$USER
ExecStart=$(which marsd) start
Restart=always
RestartSec=3
LimitNOFILE=65535

[Install]
WantedBy=multi-user.target
EOF

Load service and start

sudo systemctl daemon-reload && sudo systemctl enable marsd
sudo systemctl restart marsd && journalctl -fu marsd -o cat

Create Validator

marsd tx staking create-validator \
  --amount=5000000umars \
  --pubkey=$(marsd tendermint show-validator) \
  --moniker="<moniker>" \
  --identity="<identity>" \
  --website="<website>" \
  --details="<details>" \
  --security-contact="<contact>" \
  --chain-id="ares-1" \
  --commission-rate="0.10" \
  --commission-max-rate="0.20" \
  --commission-max-change-rate="0.01" \
  --min-self-delegation="1" \
  --from=<wallet_name>

State-Sync

SNAP_RPC=https://mars.rpc.t.anode.team:443 && \
LATEST_HEIGHT=$(curl -s $SNAP_RPC/block | jq -r .result.block.header.height); \
BLOCK_HEIGHT=$((LATEST_HEIGHT - 2000)); \
TRUST_HASH=$(curl -s "$SNAP_RPC/block?height=$BLOCK_HEIGHT" | jq -r .result.block_id.hash) && \
echo $LATEST_HEIGHT $BLOCK_HEIGHT $TRUST_HASH
sudo systemctl stop marsd && marsd tendermint unsafe-reset-all --home $HOME/.mars --keep-addr-book
peers="b7937ceadfd3b89c5232c744832c3f7f918642a1@65.109.28.177:30656"
sed -i.bak -e  "s/^persistent_peers *=.*/persistent_peers = \"$peers\"/" $HOME/.mars/config/config.toml
sed -i.bak -E "s|^(enable[[:space:]]+=[[:space:]]+).*$|\1true| ; \
s|^(rpc_servers[[:space:]]+=[[:space:]]+).*$|\1\"$SNAP_RPC,$SNAP_RPC\"| ; \
s|^(trust_height[[:space:]]+=[[:space:]]+).*$|\1$BLOCK_HEIGHT| ; \
s|^(trust_hash[[:space:]]+=[[:space:]]+).*$|\1\"$TRUST_HASH\"| ; \
s|^(seeds[[:space:]]+=[[:space:]]+).*$|\1\"\"|" $HOME/.mars/config/config.toml
curl -o - -L https://anode.team/Mars/test/anode.team_mars_wasm.tar.lz4 | lz4 -c -d - | tar -x -C $HOME/.mars/data/
sudo systemctl restart marsd && journalctl -fu marsd -o cat