# 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. **Build the binary from source.**

```
git clone https://github.com/FirmaChain/firmachain
cd firmachain
git checkout v0.5.1-patch2
make install
firmachaind version
sudo mv ~/go/bin/firmachaind /usr/local/bin/firmachaind
```

4. **Initialize your node.**

```
firmachaind init <node_name> --chain-id colosseum-1
```

5. **Download genesis.**

```
wget https://raw.githubusercontent.com/FirmaChain/mainnet/main/colosseum-1/genesis.json -O $HOME/.firmachain/config/genesis.json
```

6. **Add seeds to `config.toml`.**

```
SEEDS="f89dcc15241e30323ae6f491011779d53f9a5487@mainnet-seed1.firmachain.dev:26656,04cce0da4cf5ceb5ffc04d158faddfc5dc419154@mainnet-seed2.firmachain.dev:26656,940977bdc070422b3a62e4985f2fe79b7ee737f7@mainnet-seed3.firmachain.dev:26656"
sed -i.bak -e "s/^seeds *=.*/seeds = \"$SEEDS\"/" $HOME/.firmachain/config/config.toml
```

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

```
sed -i 's|^minimum-gas-prices *=.*|minimum-gas-prices = "0.1ufct"|g' $HOME/.firmachain/config/app.toml
```

8. **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/.firmachain/config/app.toml
sed -i -e "s/^pruning-keep-recent *=.*/pruning-keep-recent = \"$pruning_keep_recent\"/" $HOME/.firmachain/config/app.toml
sed -i -e "s/^pruning-keep-every *=.*/pruning-keep-every = \"$pruning_keep_every\"/" $HOME/.firmachain/config/app.toml
sed -i -e "s/^pruning-interval *=.*/pruning-interval = \"$pruning_interval\"/" $HOME/.firmachain/config/app.toml
```

9. **Create service file.**

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

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

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

10. **Enable and start service.**

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