sudo apt update && sudo apt upgrade --yes && \
sudo apt install git build-essential ufw curl jq snapd screen ncdu nano fuse ufw --yes
sudo snap install go --classic && \
echo 'export GOPATH="$HOME/go"' >> ~/.profile && \
echo 'export GOBIN="$GOPATH/bin"' >> ~/.profile && \
echo 'export PATH="$GOBIN:$PATH"' >> ~/.profile && \
source ~/.profile && \
go version
git clone https://github.com/gravity-bridge/gravity-bridge
cd gravity-bridge/module
git checkout v1.12.0
make install
gravity version
gravity init <node_name> --chain-id gravity-bridge-3
curl https://raw.githubusercontent.com/Gravity-Bridge/gravity-docs/main/genesis.json > $HOME/.gravity/config/genesis.json
SEEDS="ade4d8bc8cbe014af6ebdf3cb7b1e9ad36f412c0@seeds.polkachu.com:14256,86bd5cb6e762f673f1706e5889e039d5406b4b90@gravity.seed.node75.org:10556"
PEERS="73e27e9b376d2f58d80e29e8175542cb01c3024d@135.181.73.170:26856, ef9748625b4739c5411e276cf2cb0d2742a037f9@54.36.63.85:26656, 39490daffac0c7847b0d2617e412b2942055a82b@95.214.53.46:26656, 906114620df87a270b89404fdc7f15b3760fa34e@95.214.53.27:42656"
sed -i -e "s/^seeds *=.*/seeds = \"$SEEDS\"/; s/^persistent_peers *=.*/persistent_peers = \"$PEERS\"/" $HOME/.gravity/config/config.toml
sed -i 's|^minimum-gas-prices *=.*|minimum-gas-prices = "0ugraviton"|g' $HOME/.gravity/config/app.toml
pruning="custom"
pruning_keep_recent="100"
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
sudo tee /etc/systemd/system/gravity-node.service > /dev/null <<EOF
[Unit]
Description=Gravity blockchain node
Requires=network.target
[Service]
Type=simple
TimeoutStartSec=10s
Restart=always
RestartSec=10
ExecStart=$(which gravity) start
LimitNOFILE=500000
LimitNPROC=500000
Environment="HOME=/root"
[Install]
WantedBy=default.target
EOF
systemctl daemon-reload
systemctl enable gravity-node
systemctl restart gravity-node
journalctl -u gravity-node -f -o cat