# Download and install Cosmovisorgoinstallcosmossdk.io/tools/cosmovisor/cmd/[email protected]# Create servicesudotee/etc/systemd/system/marsd.service>/dev/null<<EOF[Unit]Description=mars-main node serviceAfter=network-online.target[Service]User=$USERExecStart=$(which cosmovisor) run startRestart=on-failureRestartSec=10LimitNOFILE=65535Environment="DAEMON_HOME=$HOME/.mars"Environment="DAEMON_NAME=marsd"Environment="UNSAFE_SKIP_BACKUP=true"[Install]WantedBy=multi-user.targetEOFsudosystemctldaemon-reloadsudosystemctlenablemarsd
Initialize the node
# Set node configurationmarsdconfigchain-idmars-1marsdconfigkeyring-backendtest# Initialize the nodemarsdinit $MONIKER --chain-idmars-1# Download genesis and addrbookcurl-Lshttps://snapshots.stakeandrelax.net/mars/genesis.json> $HOME/.mars/config/genesis.jsoncurl-Lshttps://snapshots.stakeandrealx.net/mars/addrbook.json> $HOME/.mars/config/addrbook.json# Remove the empty wasm folder if you have an empty one, just in caserm-r~/.mars/data/wasm# Get our wasm folderwget-Owasmonly.tar.lz4https://snapshots.stakeandrealx.net/wasm/mars/wasmonly.tar.lz4--inet4-only# Extract the wasm folder into the right placelz4-c-dwasmonly.tar.lz4|tar-x-C $HOME/.mars/data# Clean uprmwasmonly.tar.lz4# Add seedssed -i -e "s|^seeds *=.*|seeds = \"9e7f28b8c0ac9d8d17bb17a390421d540a29eb3f@mars-rpc.stakeandrelax.net:18557\"|" $HOME/.mars/config/config.toml
# Set pruningsed-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"|' \ $HOME/.mars/config/app.toml