# Installation

{% tabs %}
{% tab title="Step 1" %}
{% code title="Install Pre Requisites" fullWidth="true" %}

```
sudo apt update
sudo apt install git build-essential curl jq lz4 --yes

wget https://go.dev/dl/go1.20.2.linux-amd64.tar.gz
tar -C /usr/local -xzf go1.20.2.linux-amd64.tar.gz
rm go1.20.2.linux-amd64.tar.gz

export PATH=$PATH:/usr/local/go/bin
cat <<EOF >> ~/.profile  
export GOPATH=$HOME/go  
export GO111MODULE=on  
export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin  
EOF

source ~/.profile

go version

# OUTPUT
# go version go1.20.2 linux/amd64
```

{% endcode %}
{% endtab %}

{% tab title="Step 2" %}
{% code title="Install Bitsong Node" fullWidth="true" %}

```
git clone https://github.com/bitsongofficial/go-bitsong.git
cd go-bitsong
git checkout v0.23.0
make install
bitsongd version

# OUTPUT
# 0.23.0
```

{% endcode %}
{% endtab %}

{% tab title="Step 3" %}
{% code title="Create Background Service" fullWidth="true" %}

```
sudo tee /etc/systemd/system/bitsongd.service > /dev/null << EOF

[Unit]
Description=Bitsong Node
After=network-online.target

[Service]
User=$USER
ExecStart=/home/$USER/go/bin/bitsongd start
Restart=always
RestartSec=3
LimitNOFILE=10000

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

{% endcode %}

{% code title="Enable Bitsong Node In Background" fullWidth="true" %}

```
sudo systemctl enable bitsongd
```

{% endcode %}
{% endtab %}

{% tab title="Step 4" %}
{% code title="Initialize Bitsong Node" fullWidth="true" %}

```
bitsongd config chain-id bitsong-2b
bitsongd init "your node name" --chain-id bitsong-2b
```

{% endcode %}

{% code title="Set Gas Price" fullWidth="true" %}

```
sed -i 's|^minimum-gas-prices *=.*|minimum-gas-prices = "0.0026ubtsg"|g' $HOME/.bitsongd/config/app.toml
```

{% endcode %}

{% code title="Get Genesis" fullWidth="true" %}

```
 wget https://snapshot.safeblock.space/bitsong/genesis.json -P $HOME/.bitsongd/config
```

{% endcode %}
{% endtab %}

{% tab title="Step 5" %}
Start by StateSync or Snapshot

{% content-ref url="/pages/7qG9cj1LuScsvoqSbHIB" %}
[State Sync](/mainnet-networks/bitsong/guides/state-sync.md)
{% endcontent-ref %}

{% content-ref url="/pages/3W87awo2r8k54Lxh0Ytq" %}
[Snapshot](/mainnet-networks/bitsong/guides/snapshot.md)
{% endcontent-ref %}
{% endtab %}

{% tab title="Step 6" %}
{% code title="Start Bitsong Node" fullWidth="true" %}

```
sudo systemctl start bitsongd && sudo journalctl -fu bitsongd -o cat
```

{% endcode %}
{% endtab %}
{% endtabs %}


---

# 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://docs.safeblock.space/mainnet-networks/bitsong/guides/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.
