> For the complete documentation index, see [llms.txt](https://documentation.codeblocklabs.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://documentation.codeblocklabs.com/blockchain-nodes/selfchain/installation.md).

# Installation

Installation

<pre><code>// Download binaries
wget "https://1501792788-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcIZFCZY4EPKDYaPcDZLG%2Fuploads%2FjZ2W5fQRc1EfLuI6Sbe4%2Fselfchaind-linux-amd64?alt=media&#x26;token=a3023826-ab65-405f-8112-cf696d1be00d" -O selfchaind-linux-amd64
<strong>// change permission
</strong>chmod +x selfchaind-linux-amd64
// init (change moniker to your own)
./selfchaind-linux-amd64 init moniker
// download genesis file
curl -Ls https://green.codeblocklabs.com/testnet/selfchain-v2/genesis.json > $HOME/.selfchain/config/genesis.json
// set persistent peers
PEERS="ec8f3842d43498fccbfc3d4aa10f9525789c0d26@57.129.28.171:22056,d9d2998f571ee06bf010a50b32137ca89374f946@65.109.123.185:11556,60fbaa5ad36ff188582084d6726acb914b73892d@65.109.23.55:3056,f5d922cec33bae7e4d167467e9439bc060cd88e6@212.56.40.145:11556,df7f8f5e02adcf8dc5ab160e0a43f9c175d940fb@135.181.136.105:11556,2360c4eb16334084cd9dc6110bb0782cf306ad21@185.16.38.165:11556,63a8643e7a2b983e3c2e892d51701dff8d5a3578@149.50.96.58:11556,585eaf7877beee901a55a74e50f6034229818ed9@149.50.96.91:11556,91b92e79702ffcbcdf9ea496bf62c717cf99e247@135.181.25.82:11556,103f716bb326da9360b3e66f3f02f989b804e82f@162.244.24.82:11556,4ecdbfe32616329a64fa1f3e7318f10865df4ecf@84.247.162.202:11556,df1c5ff6514e18e9395018fc422c09c3474182bf@37.187.158.148:26656,bba7c69527f778c49c7cfd86b4aff51402bea56e@95.216.69.94:11556,302dc61a32162dd899ef75c3ea3f67893e556744@65.108.234.158:56656,f58f147d52f6ea73aa753ae5d47bc9a33a3f4735@62.169.24.103:11556,291752d58f596365a043c4591e44555fd7b511b2@95.217.227.239:11556,24520be7842d541cd8ebe93818078531b1c6c2b0@95.217.37.107:11556,7f595fef5360496b2e91c331e7236054edda9ce1@37.27.133.17:11556,8a34e7465110cb0a178a7858b282c9c6b538f4b6@69.30.247.4:11556,1919edf3dd55beb5e2869568d810e0da4308f863@65.108.78.83:11556,3dda66fedf8270984626b0ba90473337d48f2e94@193.34.213.234:11556,a1d0108eefe146ac55790c82f898237e96a660f9@135.181.26.128:11556,09592c7cd7bdcc01edf15a2315db1fd702eb554a@5.189.150.236:11556,be2188a985cb4c47f0f77cbbcc738c6fc1fa4c9e@152.53.50.118:11556,1020e0624c0c1ea5252bdee08582b58a56254e72@198.7.112.56:11556,08d701d231cfacc3e6a87395dc2fcb8a89660db1@135.181.236.254:11556,b44b9fd30968b32a3c3535907118013d45d3e374@100.42.191.20:11556,06d505c499b2c99b656320b954944038794b223b@116.202.218.189:11456,981a5301e5eb232350565c6e83e05d08b73b8a80@207.180.220.118:11556,d8dbad968299bd6916eb45347a97bfc6c8c1ea18@37.27.53.88:11556,d1f39c58f6d0a251d8cdcf27126335a688999e14@149.50.116.81:11556,4d28e1b533eea60566c53a948353173856a81c5b@158.220.121.173:11556,7c7e7f85e212f1ec3b17ff74e6d9aefac5eff2b8@193.34.212.80:43656,0a73744a5b31291f0c072134425dfbef5cd2aded@142.132.156.99:3056,9feed7b20e92cc4b9094b1393cc5aff859e9aacd@148.251.51.57:11556,4faf99d5d8709c3af3cd3c8f92dacd97f136b492@95.217.230.235:11556,d6a21bb1e07ed9660a2489b34c9dba4058ba4eaf@65.108.106.168:31056,916c68cadb19e798642024a3c769d633d531ff68@100.42.178.133:13656,3f81cfbca3afba10cec63f1a9c653d005ad76887@135.181.253.102:26657,750ee06ef5af64dfc90788eb4f964f6c49337783@152.53.229.82:13656,00bf0c5363703bd24c8b221027bd149427719e3e@136.243.104.103:22056,5a042ef864a9803f8e330ffad505086f0cb0514d@152.53.84.190:19656,16f4c3adf56c32d1a91f052d14956af1518f58de@65.109.112.148:3056,0aef33af888be7b4a997bf4905fab6731be83165@84.247.177.227:26656,1b6e717a0ba71e71f7a636971763231194508c97@65.108.230.113:3056,47fbf7e4d28791fdab82a54a136360dae26b2a36@95.216.12.106:31056,68315ae044c886c15151ae2f5a7709c502e2f8d8@65.108.196.251:11356,aeb22c9cd77c51d5ffa0c0798428dbf4c4066770@135.181.114.175:3056,0b5265b87b834cac122c0d3b35fabd8f6c68e624@173.212.235.109:11556,9d33dd323bb02e1dda974f6400e809fa2b3740e9@152.53.125.167:27656,447c1f962696fcdd6c31ca1ae073c97c9cb15f58@3.138.56.49:26656,3a6608f456836bdd69d65ae2cf5854f8cd76c27b@3.147.222.52:26656"
sed -i -e "s|^persistent_peers *=.*|persistent_peers = \"$PEERS\"|" $HOME/.selfchain/config/config.toml
// run the binary
./selfchaind-linux-amd64 start 
</code></pre>

{% hint style="warning" %}
wait until the sync process stopped and there is an upgrade information appear.
{% endhint %}

```
// Download the v2.0.0 version
wget "https://green.codeblocklabs.com/testnet/selfchain-v2/selfchaind" -O selfchaind
// change permission
chmod +x selfchaind
// open new screen
screen -S selfchain
// run the v2.0.0 binary
nohup ./selfchaind > selfchain.log 2>&1 &
```

```
// Only if you need to download the Addrbook, use command below:

curl -Ls https://green.codeblocklabs.com/testnet/selfchain-v2/addrbook.json $HOME/.selfchain/config/addrbook.json
```

When the nodes already synced and everything's good, request faucet on selfchain discord and create validator.

***

## Setting Up Services

```
// Create bin folder
mkdir ~/bin
// Copy binary
cp selfchaind ~/bin/
// Change permission
chmod +x ~/bin/selfchaind
// add to path
export PATH="$PATH:/home/username/location_to_bin_folder"
// reload shell configuration
source ~/.bashrc
// test
./selfchaind version --long
```

If test was success, you can now create the services configuration file.

```
# Set Service file
sudo tee /etc/systemd/system/selfchaind.service > /dev/null <<EOF
[Unit]
Description=selfchain mainnet node
After=network-online.target
[Service]
User=$USER
ExecStart=$(which selfchaind) start
Restart=always
RestartSec=3
LimitNOFILE=65535
[Install]
WantedBy=multi-user.target
EOF
sudo systemctl daemon-reload
sudo systemctl enable selfchaind

```

```
// Start the nodes on services
sudo systemctl restart selfchaind && sudo journalctl -fu selfchaind -o cat

```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://documentation.codeblocklabs.com/blockchain-nodes/selfchain/installation.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
