💾Node Installation

Gravity Mainnet guide

  • Minimum hardware requirements:

Node Type
CPU
RAM
Storage

Mainnet

8

16GB

250GB

1) Auto_install script

wget -O gravitym https://raw.githubusercontent.com/111STAVR111/props/main/Gravity/gravitym && chmod +x gravitym && ./gravitym

2) Manual installation

Preparing the server

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

GO 1.21.6

ver="1.21.6"
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" >> $HOME/.bash_profile
source $HOME/.bash_profile
go version

Build 01.10.24

cd $HOME && mkdir -p go/bin/
mkdir gravity-bin && cd gravity-bin
wget -O gravity https://github.com/Gravity-Bridge/Gravity-Bridge/releases/download/v1.12.0/gravity-linux-amd64
mv gravity-linux-amd64 gravity
wget https://github.com/Gravity-Bridge/Gravity-Bridge/releases/download/v1.12.0/gbt
chmod +x *
mv $HOME/gravity /usr/bin/
mv $HOME/gbt /usr/bin/

gravity version --long | head

  • version: v1.12.0

  • commit: 5ae18bc3253933168137a257ccfadf4d81e2eef7

Initiation

gravity init STAVR_guide --chain-id gravity-bridge-3
gravity config chain-id gravity-bridge-3
gbt init

Create wallet

gravity keys add <wallet_name> --algo secp256k1 --coin-type 118
gravity keys add <wallet_orchestrator_name>
gravity eth_keys add <wallet_eth_name>

Key set for orchestrator

gbt keys set-ethereum-key --key <your Ethereum PRIVATE key>
gbt keys set-orchestrator-key --phrase "<your mnemonic from orchestrator wallet>"

Download Genesis

wget -O $HOME/.gravity/config/genesis.json "https://raw.githubusercontent.com/111STAVR111/props/main/Gravity/genesis.json"

sha256sum $HOME/.gravity/config/genesis.json

  • 3c1cb9bf8003a1045b415b19bc92890b5a69ec8cf1ef909b61d5503b5e1c1dff

Set up the minimum gas price and Peers/Seeds/Filter peers/MaxPeers

sed -i.bak -e "s/^minimum-gas-prices *=.*/minimum-gas-prices = \"0.001ugraviton\"/;" ~/.gravity/config/app.toml
external_address=$(wget -qO- eth0.me) 
sed -i.bak -e "s/^external_address *=.*/external_address = \"$external_address:26656\"/" $HOME/.gravity/config/config.toml
peers=""
sed -i.bak -e "s/^persistent_peers *=.*/persistent_peers = \"$peers\"/" $HOME/.gravity/config/config.toml
seeds=""
sed -i.bak -e "s/^seeds =.*/seeds = \"$seeds\"/" $HOME/.gravity/config/config.toml
sed -i 's/max_num_inbound_peers =.*/max_num_inbound_peers = 50/g' $HOME/.gravity/config/config.toml
sed -i 's/max_num_outbound_peers =.*/max_num_outbound_peers = 50/g' $HOME/.gravity/config/config.toml

Pruning (optional)

pruning="custom"
pruning_keep_recent="1000"
pruning_keep_every="0"
pruning_interval="10"
sed -i -e "s/^pruning *=.*/pruning = \"$pruning\"/" $HOME/.gravity/config/app.toml
sed -i -e "s/^pruning-keep-recent *=.*/pruning-keep-recent = \"$pruning_keep_recent\"/" $HOME/.gravity/config/app.toml
sed -i -e "s/^pruning-keep-every *=.*/pruning-keep-every = \"$pruning_keep_every\"/" $HOME/.gravity/config/app.toml
sed -i -e "s/^pruning-interval *=.*/pruning-interval = \"$pruning_interval\"/" $HOME/.gravity/config/app.toml

Indexer (optional)

indexer="null" &&
sed -i -e "s/^indexer *=.*/indexer = \"$indexer\"/" $HOME/.gravity/config/config.toml

Download addrbook

wget -O $HOME/.gravity/config/addrbook.json "https://raw.githubusercontent.com/111STAVR111/props/main/Gravity/addrbook.json"

Create a service file

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

[Service]
User=$USER
ExecStart=$(which gravity) start
Restart=on-failure
RestartSec=3
LimitNOFILE=65535

[Install]
WantedBy=multi-user.target
EOF

StateSync Gravity Mainnet

SOOON

SnapShot Mainnet updated every 5 hours

SOOON

Start

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

Create the service file Orchestrator

sudo tee /etc/systemd/system/orchestrator.service > /dev/null <<EOF
[Unit]
Description=Gravity Bridge Orchestrator
Requires=network.target
[Service]
Type=simple
TimeoutStartSec=10s
Restart=on-failure
RestartSec=10
ExecStart=$(which gbt) orchestrator \
--fees 5000ugraviton \
--gravity-contract-address 0xa4108aA1Ec4967F8b52220a4f7e94A8201F2D906 \
--ethereum-rpc "https://eth.althea.net/"
[Install]
WantedBy=default.target
EOF

Load service and start

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

Create validator

gravity tx staking create-validator \
--commission-rate 0.1 \
--commission-max-rate 0.2 \
--commission-max-change-rate 0.2 \
--min-self-delegation "1" \
--amount 1000000000000000000ugraviton \
--pubkey $(gravity tendermint show-validator) \
--from <wallet> \
--moniker="STAVR_guide" \
--chain-id gravity-bridge-3 \
--fees="500ugraviton" \
--identity="" \
--website="" \
--details="" -y

Monitoring

You can set up your node status alarm here - Monitoring

Security

You can create secure management of your wallet and your node by following this links.

TMKMS Wallet Security

Delete node

sudo systemctl stop gravity
sudo systemctl disable gravity
rm /etc/systemd/system/gravity.service
sudo systemctl daemon-reload
cd $HOME
rm -rf gravity-bin
rm -rf .gravity
rm -rf $(which gravity)

Last updated