# 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

apt-get update
sudo apt-get install libsnappy-dev libleveldb-dev --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

snap refresh go --channel="1.23/stable"
```

3. **Build the binary from source.**

```
git clone https://github.com/provenance-io/provenance
cd provenance
git checkout v1.27.2
make clean
make install
provenanced version
```

4. **Initialize your node.**

```
provenanced init <node_name> --chain-id pio-mainnet-1
```

5. **Download genesis and addrbook, set up gas prices.**

```
sed -i -e 's/namespace = "cometbft"/namespace = "provenance"/' $HOME/.provenanced/config/config.toml
wget -O $HOME/.provenanced/config/genesis.json https://server-5.itrocket.net/mainnet/provenance/genesis.json
wget -O $HOME/.provenanced/config/addrbook.json  https://server-5.itrocket.net/mainnet/provenance/addrbook.json
sed -i 's|minimum-gas-prices =.*|minimum-gas-prices = "1nhash"|g' $HOME/.provenanced/config/app.toml
```

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

```
SEEDS="a280ec7a1b563cb71510723b860ed37d40494308@provenance-mainnet-seed.itrocket.net:57656"
PEERS="b75bb5d0c033b5a8ca24df607a757d09e4f99acd@provenance-mainnet-peer.itrocket.net:57656,7ada869ec50e679bd25f9c79caeaefc4b3ca6143@65.109.92.235:28656,16beca361bac8ab810e5087f2cb0b603320de41b@20.245.92.25:26656,768cef4673e00f92e9dde27ad0cc7374e3330b51@168.119.139.86:36696,93b2dbf54d15b838c6248e9973e2c8ee6594aed0@104.196.147.17:26656,a5a160c50ba3b8e276c6fbe2815d0be3347c2394@20.237.232.187:26656,8ae3188028f5185e0b3d3c96a761ab675399b3de@65.108.126.46:46656,9815d8b96f7c7855d995b6464dc0a397336a65db@65.109.104.118:46656,6241ee5049662bde4f45d5cb797f5f19464cb471@35.214.211.106:26656,be7ab5890f83062fe276b99dd6430bf0a8618230@65.108.230.113:20006,a56592e9903ed9eff6557af0bdd930d60b35d0fb@65.108.71.166:42656"
sed -i -e "/^\[p2p\]/,/^\[/{s/^[[:space:]]*seeds *=.*/seeds = \"$SEEDS\"/}" \
       -e "/^\[p2p\]/,/^\[/{s/^[[:space:]]*persistent_peers *=.*/persistent_peers = \"$PEERS\"/}" $HOME/.provenanced/config/config.toml
```

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

```
sed -i -e "s/^pruning *=.*/pruning = \"custom\"/" $HOME/.provenanced/config/app.toml 
sed -i -e "s/^pruning-keep-recent *=.*/pruning-keep-recent = \"100\"/" $HOME/.provenanced/config/app.toml
sed -i -e "s/^pruning-interval *=.*/pruning-interval = \"10\"/" $HOME/.provenanced/config/app.toml
sed -i -e "s/^indexer *=.*/indexer = \"null\"/" $HOME/.provenanced/config/config.toml
```

9. **Create service file.**

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

[Service]
User=$USER
ExecStart=$(which provenanced) start --home /root/.provenanced
Restart=on-failure
RestartSec=3
LimitNOFILE=65535

[Install]
WantedBy=multi-user.target
EOF
```

10. **Enable and start service.**

```
systemctl daemon-reload
systemctl enable provenanced
systemctl restart provenanced
journalctl -u provenanced -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/provenance/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.
