# Installation

1. **Update packages and install useful tools.**

```
sudo apt update && sudo apt upgrade --yes && \
sudo apt install git build-essential ufw curl jq snapd screen ncdu nano fuse ufw --yes
```

2. **Install `go` using `snap`**.

```
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
```

3. **Download the binary.**

```
git clone https://github.com/gravity-bridge/gravity-bridge
cd gravity-bridge/module
git checkout v1.13.3
make install
gravity version
```

4. **Initialize your node.**

```
gravity init <node_name> --chain-id gravity-bridge-3
```

5. **Download genesis.**

```
curl https://raw.githubusercontent.com/Gravity-Bridge/gravity-docs/main/genesis.json > $HOME/.gravity/config/genesis.json
```

6. **Add seeds and persistent peers to `config.toml`.**

```
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
```

7. #### Set up minimum gas price.

```
sed -i 's|^minimum-gas-prices *=.*|minimum-gas-prices = "0ugraviton"|g' $HOME/.gravity/config/app.toml
```

7. **Set up pruning (optional).**

```
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
```

9. **Create service file.**

```
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
```

10. **Enable and start service.**

```
systemctl daemon-reload
systemctl enable gravity-node
systemctl restart gravity-node
journalctl -u gravity-node -f -o cat
```

{% hint style="info" %}
If you would like to speed up the sync process, you may try using State Sync.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://services.stakeangle.com/mainnets/gravity-bridge/installation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
