# 0G Validator Node

Recommended Hardware: 8 Cores, 64GB RAM, 500GB of storage (NVME)

### Installation <a href="#installation" id="installation"></a>

Install dependencies, if needed

```bash
sudo apt update && \
sudo apt install curl git jq build-essential gcc unzip wget lz4 -y
```

Install go, if needed

```bash
cd $HOME && \
ver="1.22.0" && \
wget "https://golang.org/dl/go$ver.linux-amd64.tar.gz" && \
sudo rm -rf /usr/local/go && \
sudo tar -C /usr/local -xzf "go$ver.linux-amd64.tar.gz" && \
rm "go$ver.linux-amd64.tar.gz" && \
echo "export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin" >> ~/.bash_profile && \
source ~/.bash_profile && \
go version
```

Build 0gchaind binary from source

```bash
git clone -b v0.3.0 https://github.com/0glabs/0g-chain.git
cd 0g-chain
make install
0gchaind version
```

Setup your variable settings

```bash
echo 'export MONIKER="My_Node"' >> ~/.bash_profile
echo 'export CHAIN_ID="zgtendermint_16600-2"' >> ~/.bash_profile
echo 'export WALLET_NAME="wallet"' >> ~/.bash_profile
echo 'export RPC_PORT="26657"' >> ~/.bash_profile
source $HOME/.bash_profile
```

Initialize node & create home directory for .0gchain

```bash
cd $HOME
0gchaind init $MONIKER --chain-id $CHAIN_ID
0gchaind config chain-id $CHAIN_ID
0gchaind config node tcp://localhost:$RPC_PORT
0gchaind config keyring-backend os # You can set it to "test" so you will not be asked for a password
```

Download genesis file

```
wget https://github.com/0glabs/0g-chain/releases/download/v0.2.3/genesis.json -O $HOME/.0gchain/config/genesis.json
```

Set 0G chain seeds

```
SEEDS="81987895a11f6689ada254c6b57932ab7ed909b6@54.241.167.190:26656,010fb4de28667725a4fef26cdc7f9452cc34b16d@54.176.175.48:26656,e9b4bc203197b62cc7e6a80a64742e752f4210d5@54.193.250.204:26656,68b9145889e7576b652ca68d985826abd46ad660@18.166.164.232:26656" && \
sed -i.bak -e "s/^seeds *=.*/seeds = \"${SEEDS}\"/" $HOME/.0gchain/config/config.toml
```

Confirm your ports (These are standard values, feel free to edit port(s) you wish to use)

```
EXTERNAL_IP=$(wget -qO- eth0.me) \
PROXY_APP_PORT=26658 \
P2P_PORT=26656 \
PPROF_PORT=6060 \
API_PORT=1317 \
GRPC_PORT=9090 \
GRPC_WEB_PORT=9091
```

Set required variable in config.toml & app.toml for your node

```
sed -i \
    -e "s/\(proxy_app = \"tcp:\/\/\)\([^:]*\):\([0-9]*\).*/\1\2:$PROXY_APP_PORT\"/" \
    -e "s/\(laddr = \"tcp:\/\/\)\([^:]*\):\([0-9]*\).*/\1\2:$RPC_PORT\"/" \
    -e "s/\(pprof_laddr = \"\)\([^:]*\):\([0-9]*\).*/\1localhost:$PPROF_PORT\"/" \
    -e "/\[p2p\]/,/^\[/{s/\(laddr = \"tcp:\/\/\)\([^:]*\):\([0-9]*\).*/\1\2:$P2P_PORT\"/}" \
    -e "/\[p2p\]/,/^\[/{s/\(external_address = \"\)\([^:]*\):\([0-9]*\).*/\1${EXTERNAL_IP}:$P2P_PORT\"/; t; s/\(external_address = \"\).*/\1${EXTERNAL_IP}:$P2P_PORT\"/}" \
    $HOME/.0gchain/config/config.toml
```

```
sed -i \
    -e "/\[api\]/,/^\[/{s/\(address = \"tcp:\/\/\)\([^:]*\):\([0-9]*\)\(\".*\)/\1\2:$API_PORT\4/}" \
    -e "/\[grpc\]/,/^\[/{s/\(address = \"\)\([^:]*\):\([0-9]*\)\(\".*\)/\1\2:$GRPC_PORT\4/}" \
    -e "/\[grpc-web\]/,/^\[/{s/\(address = \"\)\([^:]*\):\([0-9]*\)\(\".*\)/\1\2:$GRPC_WEB_PORT\4/}" \
    $HOME/.0gchain/config/app.toml
```

Pruning (Optional to save storage space)

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

Set min gas price

```
sed -i "s/^minimum-gas-prices *=.*/minimum-gas-prices = \"0ua0gi\"/" $HOME/.0gchain/config/app.toml
```

Enable indexer

```
sed -i "s/^indexer *=.*/indexer = \"kv\"/" $HOME/.0gchain/config/config.toml
```

Create 0gd service for your node to run in the background

```
sudo tee /etc/systemd/system/0gd.service > /dev/null <<EOF
[Unit]
Description=0G Node
After=network.target

[Service]
User=$USER
Type=simple
ExecStart=$(which 0gchaind) start --home $HOME/.0gchain
Restart=on-failure
LimitNOFILE=65535

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

Start node

```
sudo systemctl daemon-reload && \
sudo systemctl enable 0gd && \
sudo systemctl restart 0gd && \
sudo journalctl -u 0gd -f -o cat
```

**Check for your syncing progress**

```
0gchaind status | jq '{ latest_block_height: .sync_info.latest_block_height, catching_up: .sync_info.catching_up }'
```

The result should be **`"catching_up": false`** when your node is fully synced

Result example

```
{
  "latest_block_height": "419865",
  "catching_up": false
}
```

NodeGuru's explorer for checking latest block height [here](https://testnet.0g.explorers.guru/)

## Create wallet

```
0gchaind keys add $WALLET_NAME --eth

# DO NOT FORGET TO SAVE THE SEED PHRASE & YOUR PASSPHRASE YOU SET FOR THIS WALLET
# You can add --recover flag to restore existing key instead of creating
```

**Extract the 0x address and use it for receiving testnet token**

```
echo "0x$(0gchaind debug addr $(0gchaind keys show $WALLET_NAME -a) | grep hex | awk '{print $3}')"
```

&#x20;**Request for Testnet token**

\| [Faucet](https://faucet.0g.ai/) | - use your 0x address to request

Check your wallet balance (node must be synced in order to see the current balance)

```
0gchaind q bank balances $(0gchaind keys show $WALLET_NAME -a) 
```

Result example - 1 A0GI = 1,000,000 ua0gi

```
balances:
- amount: "41694146"
  denom: ua0gi
pagination:
  next_key: null
  total: "0"
```

## &#x20;**Create validator**

```
0gchaind tx staking create-validator \
--amount=1000000ua0gi \
--pubkey=$(0gchaind tendermint show-validator) \
--moniker="$MONIKER" \
--chain-id=zgtendermint_16600-2 \
--commission-rate="0.10" \
--commission-max-rate="0.20" \
--commission-max-change-rate="0.01" \
--details="" \
--website="" \
--min-self-delegation="1" \
--from="$WALLET_NAME" \
--gas=auto \
--gas-adjustment=1.4 \
-y
```

Once your validator is created you can look up your validator [here](https://testnet.0g.explorers.guru/validators). Most likely it will be in `inactive` set as you will need enough stake to reach top 125 TVL validator. This is normal \~\~\~

**Run curl test to check for your RPC port if it's works properly**

```
# set EXTERNAL_IP variable
EXTERNAL_IP=$(wget -qO- eth0.me)

# query for current block height (json-rpc)
curl -X POST http://$EXTERNAL_IP:8545 -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}'

# query for Net version (json-rpc)
curl -X POST http://$EXTERNAL_IP:8545 -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","method":"net_version","params":[],"id":1}'
```

Result example

Current block height

```
{"jsonrpc":"2.0","id":1,"result":"0x66972"}
```

Net version (evm chain-id)

```
{"jsonrpc":"2.0","id":1,"result":"16600"}
```

## Upgrade Your Node <a href="#upgrade-your-node" id="upgrade-your-node"></a>

At height 574000

```
cd $HOME
wget -O 0gchaind https://zgchaind-test.s3.ap-east-1.amazonaws.com/0gchaind-linux-v0.3.0
chmod +x $HOME/0gchaind
sudo mv $HOME/0gchaind $HOME/go/bin/
sudo systemctl restart 0gd
```

Check log

```
tail -f -n 100 $HOME/.0gchain/log/chain.log
```

## Congratulation!!&#x20;

Now you have completed your node for 0gchain and we will move on to creating your storage node next.


# 0G Storage Node

Recommended Hardware: 4 Cores, 16GB RAM, 1TB of storage (NVME)

## **System updates, installation of required dependencies**

```
sudo apt-get update
sudo apt-get install clang cmake build-essential pkg-config libssl-dev
sudo apt install cargo
```

#### Install go

```
cd $HOME && \
ver="1.22.0" && \
wget "https://golang.org/dl/go$ver.linux-amd64.tar.gz" && \
sudo rm -rf /usr/local/go && \
sudo tar -C /usr/local -xzf "go$ver.linux-amd64.tar.gz" && \
rm "go$ver.linux-amd64.tar.gz" && \
echo "export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin" >> ~/.bash_profile && \
source ~/.bash_profile && \
go version
```

**Install rust**

```
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source $HOME/.cargo/env
```

*When prompted choice of 1,2 and 3 just hit enter to continue*

**Build zgs\_node binary from source with rust**

```
cd $HOME
git clone https://github.com/0glabs/0g-storage-node.git
cd $HOME/0g-storage-node
git tag -d v0.4.1
git checkout 302aa88e2fde448c7f80e42ad8d8f1fce1cafc2c
git submodule update --init
cargo build --release
```

**copy config.toml**

```
cp $HOME/0g-storage-node/run/config-testnet-turbo.toml $HOME/0g-storage-node/run/config.toml
```

edit config.toml

```
nano $HOME/0g-storage-node/run/config.toml
```

Set  config.toml

```
log_contract_address : 0xbD2C3F0E65eDF5582141C35969d66e34629cC768
mine_contract_address : 0x6815F41019255e00D6F34aAB8397a6Af5b6D806f
reward_contract_address : 0x51998C4d486F406a788B766d93510980ae1f9360
Deployed Block Number: 595059
confirmation_block_count = 6
network_boot_nodes = ["/ip4/54.219.26.22/udp/1234/p2p/16Uiu2HAmTVDGNhkHD98zDnJxQWu3i1FL1aFYeh9wiQTNu4pDCgps","/ip4/52.52.127.117/udp/1234/p2p/16Uiu2HAkzRjxK2gorngB1Xq84qDrT4hSVznYDHj6BkbaE4SGx9oS","/ip4/18.162.65.205/udp/1234/p2p/16Uiu2HAm2k6ua2mGgvZ8rTMV8GhpW71aVzkQWy7D37TTDuLCpgmX"]
```

## **Create zgs service (storage node) for your node to run in the background**

```
sudo tee /etc/systemd/system/zgs.service > /dev/null <<EOF
[Unit]
Description=ZGS Node
After=network.target

[Service]
User=$USER
WorkingDirectory=$HOME/0g-storage-node/run
ExecStart=$HOME/0g-storage-node/target/release/zgs_node --config $HOME/0g-storage-node/run/config.toml
Restart=on-failure
RestartSec=10
LimitNOFILE=65535

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

**Start Storage node**

```
sudo systemctl daemon-reload && \
sudo systemctl enable zgs && \
sudo systemctl restart zgs
```

#### Show logs by date

* full logs command

```
tail -f ~/0g-storage-node/run/log/zgs.log.$(TZ=UTC date +%Y-%m-%d)
```

* tx\_seq-only logs command

```
tail -f ~/0g-storage-node/run/log/zgs.log.$(TZ=UTC date +%Y-%m-%d) | grep tx_seq:
```

* minimized-logs command

```
tail -f ~/0g-storage-node/run/log/zgs.log.$(TZ=UTC date +%Y-%m-%d) | grep -v "discv5\|network\|connect\|16U\|nounce"
```

* check your storage node through rpc

```
while true; do 
    response=$(curl -s -X POST http://localhost:5678 -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","method":"zgs_getStatus","params":[],"id":1}')
    logSyncHeight=$(echo $response | jq '.result.logSyncHeight')
    connectedPeers=$(echo $response | jq '.result.connectedPeers')
    echo -e "logSyncHeight: \033[32m$logSyncHeight\033[0m, connectedPeers: \033[34m$connectedPeers\033[0m"
    sleep 5; 
done
```

## Test Stoarge Node with storage CLI

Build Storage CLI with source code

```
git clone -b v0.5.1 https://github.com/0glabs/0g-storage-client.git
cd $HOME/0g-storage-client
git stash
git fetch --all --tags
git checkout e283cdbfef2f3e5c94f97ef4c1815b464851f399 
git submodule update --init
go build
```

Create upload.sh

```
nano $HOME/upload.sh
```

```
# Generate the file
  size=$(shuf -i 10240-51200 -n 1)
  filename=$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 10).md
  /root/0g-storage-client/./0g-storage-client gen --size $size --file ${filename}

# Upload the file
  /root/0g-storage-client/./0g-storage-client upload \
  --url http://127.0.0.1:8545 \
  --contract "" \
  --key "" \
  --node http://127.0.0.1:5678 \
  --file ./${filename} \
  --tags 0x

# Remove the file
  rm ./${filename}
done

```

Create upload service for your node to run in the background

```
sudo tee /etc/systemd/system/upload.service > /dev/null <<EOF
[Unit]
Description=station track service
After=network-online.target
[Service]
User=root
WorkingDirectory=/root/
ExecStart=sh ./upload.sh
Restart=always
RestartSec=3
LimitNOFILE=65535
[Install]
WantedBy=multi-user.target
EOF
```

Start upload

```
sudo systemctl daemon-reload && \
sudo systemctl enable upload && \
sudo systemctl restart upload
```

check log

```
sudo journalctl -u upload -f
```

If you see this result, the test was successful

<figure><img src="https://4035067140-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC9MoDmPzf2bJhCnlF4JC%2Fuploads%2F40sxPXO7brPdjtljH8kI%2Fimage.png?alt=media&amp;token=7e5093a9-be46-4521-b1ab-9775f430c4ca" alt=""><figcaption></figcaption></figure>


# Update Storage Node

Recommended Hardware: 4 Cores, 16GB RAM, 1TB of storage (NVME)

Stop service && backup config.toml

```
sudo systemctl stop zgs && cp $HOME/0g-storage-node/run/config.toml $HOME/0g-storage-node/run/config.toml.backup
```

Update

```
cd $HOME/0g-storage-node
git stash
git fetch --all --tags
git checkout 27979c2 
git submodule update --init
cargo build --release
```

update config.toml

```
mv $HOME/0g-storage-node/run/config.toml.backup $HOME/0g-storage-node/run/config.toml
```

ZGS Service Restart

```
sudo systemctl restart zgs
```

Log Check

```
tail -f ~/0g-storage-node/run/log/zgs.log.$(TZ=UTC date +%Y-%m-%d)
```

Block Sync Check

```
while true; do 
    response=$(curl -s -X POST http://localhost:5678 -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","method":"zgs_getStatus","params":[],"id":1}')
    logSyncHeight=$(echo $response | jq '.result.logSyncHeight')
    connectedPeers=$(echo $response | jq '.result.connectedPeers')
    echo -e "logSyncHeight: \033[32m$logSyncHeight\033[0m, connectedPeers: \033[34m$connectedPeers\033[0m"
    sleep 5; 
done
```


# 0G Storage KV

Recommended Hardware: 8 Cores, 16GB RAM, 260GB of storage (NVME)

**Ensure Rust is Installed**

Check if Rust is installed by running:

```
rustc --version
```

If Rust is not installed, follow this [section](/0g-storage-node) to install it.

**Build Storage KV from source code**

```
git clone https://github.com/0glabs/0g-storage-kv.git
cd 0g-storage-kv
git submodule update --init
cargo build --release
```

**Copy the example config\_example.toml & rename to config.toml**

```
cp $HOME/0g-storage-kv/run/config_example.toml $HOME/0g-storage-kv/run/config.toml
```

**Set parameters for Storage Node**

```
STORAGE_PORT=$(grep -oP '(?<=rpc_listen_address = "0.0.0.0:)\d+(?=")' $HOME/0g-storage-node/run/config.toml)
ZGS_LOG_SYNC_BLOCK=$(grep -oP '(?<=log_sync_start_block_number = )\d+' $HOME/0g-storage-node/run/config.toml)
STORAGE_RPC_ENDPOINT=http://$(wget -qO- eth0.me):$STORAGE_PORT
BLOCKCHAIN_RPC_ENDPOINT=$(sed -n 's/blockchain_rpc_endpoint = "\([^"]*\)"/\1/p' $HOME/0g-storage-node/run/config.toml)
LOG_CONTRACT_ADDRESS=$(sed -n 's/log_contract_address = "\([^"]*\)"/\1/p' $HOME/0g-storage-node/run/config.toml)
MINE_CONTRACT_ADDRESS=$(sed -n 's/mine_contract_address = "\([^"]*\)"/\1/p' $HOME/0g-storage-node/run/config.toml)
JSON_PORT=$(sed -n '/\[json-rpc\]/,/^address/ s/address = "0.0.0.0:\([0-9]*\)".*/\1/p' $HOME/.0gchain/config/app.toml)
JSON_RPC_ENDPOINT=http://$(wget -qO- eth0.me):$JSON_PORT

echo -e "\nSTORAGE_RPC_ENDPOINT: $STORAGE_RPC_ENDPOINT\nLOG_CONTRACT_ADDRESS: $LOG_CONTRACT_ADDRESS\nMINE_CONTRACT_ADDRESS: $MINE_CONTRACT_ADDRESS\nBLOCKCHAIN_RPC_ENDPOINT: $BLOCKCHAIN_RPC_ENDPOINT\nJSON_RPC_ENDPOINT: $JSON_RPC_ENDPOINT\nZGS_LOG_SYNC_BLOCK: $ZGS_LOG_SYNC_BLOCK\n\nScript by \033[35mNodeCattel\033[0m"
```

Use `sed` to update these parameters:

```
sed -i "s|rpc_listen_address = .*|rpc_listen_address = \"0.0.0.0:6789\"|" $HOME/0g-storage-kv/run/config.toml
sed -i "s|zgs_node_urls = .*|zgs_node_urls = \"$STORAGE_RPC_ENDPOINT\"|" $HOME/0g-storage-kv/run/config.toml
sed -i "s|log_config_file = .*|log_config_file = \"$HOME/0g-storage-kv/run/log_config\"|" $HOME/0g-storage-kv/run/config.toml
sed -i "s|blockchain_rpc_endpoint = .*|blockchain_rpc_endpoint = \"$BLOCKCHAIN_RPC_ENDPOINT\"|" $HOME/0g-storage-kv/run/config.toml
sed -i "s|log_contract_address = .*|log_contract_address = \"$LOG_CONTRACT_ADDRESS\"|" $HOME/0g-storage-kv/run/config.toml
sed -i "s|log_sync_start_block_number = .*|log_sync_start_block_number = $ZGS_LOG_SYNC_BLOCK|" $HOME/0g-storage-kv/run/config.toml
```

**Create zgs-kv service (storage KV) to run in the background**

```
sudo tee /etc/systemd/system/zgs-kv.service > /dev/null <<EOF
[Unit]
Description=ZGS-KV Node
After=network.target

[Service]
User=$USER
WorkingDirectory=$HOME/0g-storage-kv/run
ExecStart=$HOME/0g-storage-kv/target/release/zgs_kv --config $HOME/0g-storage-kv/run/config.toml
Restart=on-failure
RestartSec=10
LimitNOFILE=65535

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

**Start Storage KV node**

```
sudo systemctl daemon-reload && \
sudo systemctl enable zgs-kv && \
sudo systemctl restart zgs-kv
```

**View Storage KV log**

```
sudo journalctl -u zgs-kv.service -f
```

**Stop Storage KV node - (if you wish to stop the service)**

```
sudo systemctl stop zgs-kv
```


# Update 0G Storage KV

Recommended Hardware: 8 Cores, 16GB RAM, 260GB of storage (NVME)

Stop service && backup config.toml

```
sudo systemctl stop zgs-kv && cp $HOME/0g-storage-kv/run/config.toml $HOME/config.toml.backup && rm -r $HOME/0g-storage-kv
```

Update

```
git clone -b v1.2.0 https://github.com/0glabs/0g-storage-kv.git
cd $HOME/0g-storage-kv
git stash
git fetch --all --tags
git checkout 97ba360 
git submodule update --init
cargo build --release
```

Setup config.toml

```
mv $HOME/config.toml.backup $HOME/0g-storage-kv/run/config.toml
```

ZGS KV Service Restart

```
sudo systemctl restart zgs-kv
```

Log Check

```
sudo journalctl -u zgs-kv.service -f
```


# 0G DA Node

Recommended Hardware: 8 Cores, 16GB RAM, 1TB of storage (NVME)

## **System updates, installation of required dependencies**

```
sudo apt-get update
sudo apt install make clang pkg-config libssl-dev
sudo apt-get install libssl-dev
apt-get install protobuf-compiler
sudo apt install build-essential curl
```

**Install rust**

```
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source $HOME/.cargo/env
```

Installation

```
cd $HOME
git clone https://github.com/0glabs/0g-da-node.git
cd $HOME/0g-da-node
cargo build --release
./dev_support/download_params.sh
```

**Setup your variable settings**

```
sudo cp $HOME/0g-da-node/config_example.toml $HOME/0g-da-node/config.toml
```

On the first run of DA node, it will register the signer information in DA contract. To generate a BLS private key if don't have:

```
cargo run --bin key-gen
```

## **Create** zgda **service  for your node to run in the background**

```
sudo tee /etc/systemd/system/zgda.service > /dev/null <<EOF
[Unit]
Description=DA Node
After=network.target

[Service]
User=$USER
WorkingDirectory=$HOME/0g-da-node
ExecStart=$HOME/0g-da-node/target/release/server --config $HOME/0g-da-node/config.toml
Restart=on-failure
RestartSec=10
LimitNOFILE=65535

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

**Start DA node**

```
sudo systemctl daemon-reload && \
sudo systemctl enable zgda && \
sudo systemctl restart zgda
```

#### Check log

```
sudo journalctl -u zgda -f -o cat
```


# Update 0G DA Node

Recommended Hardware: 8 Cores, 16GB RAM, 260GB of storage (NVME)

Stop service && backup config.toml

```
sudo systemctl stop zgda && cp $HOME/0g-da-node/config.toml $HOME/config.toml.backup && rm -r $HOME/0g-da-node
```

Update

```
git clone https://github.com/0glabs/0g-da-node.git
cd $HOME/0g-da-node
git checkout tags/v1.1.2 -b v1.1.2
cargo build --release
./dev_support/download_params.sh
```

Setup config.toml

```
mv $HOME/config.toml.backup $HOME/0g-da-node/config.toml
sed -i -e "s|0xDFC8B84e3C98e8b550c7FEF00BCB2d8742d80a69|0x857C0A28A8634614BB2C96039Cf4a20AFF709Aa9|" $HOME/0g-da-node/config.toml
```

**DA node** Service Restart

```
sudo systemctl restart zgda
```

Log Check

```
sudo journalctl -u zgda.service -f
```


# 0G DA Client

Recommended Hardware: 2 Cores, 8GB RAM, 100Gb of storage (NVME)

## **System updates, installation of required dependencies**

```
sudo apt-get update
sudo apt-get install cmake
sudo apt-get install screen
```

Install Go

```
wget https://go.dev/dl/go1.22.0.linux-amd64.tar.gz
rm -rf /usr/local/go && tar -C /usr/local -xzf go1.22.0.linux-amd64.tar.gz
export PATH=$PATH:/usr/local/go/bin
```

Installation

```
cd $HOME
git clone -b v1.0.0-testnet https://github.com/0glabs/0g-da-client.git
cd $HOME/0g-da-client
make build
```

Configuration

```
nano $HOME/0g-da-client/disperser/Makefile
```

Replace run\_combined: build\_combined

`--chain.rpc`

`--chain.private-key`

`--combined-server.storage.flow-contract`

Creat service

```
sudo tee /etc/systemd/system/0gdacli.service > /dev/null <<EOF
[Unit]
Description=0G-DA-ClI Node
After=network.target

[Service]
User=root
WorkingDirectory=$HOME/0g-da-client/disperser
ExecStart=/usr/bin/make run_combined
Restart=always
RestartSec=10
LimitNOFILE=65535
Environment="PATH=/usr/local/go/bin:/usr/bin:/bin"

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

Start service

```
sudo systemctl daemon-reload && \
sudo systemctl enable 0gdacli && \
sudo systemctl start 0gdacli
```

Check log:

```
sudo journalctl -u 0gdacli -f -o cat
```


# Initia-Testnet

Recommended Hardware: 4 Cores, 16GB RAM, 1TB of storage (NVME)

## Install go and all necessary tools:

```
wget https://go.dev/dl/go1.22.3.linux-amd64.tar.gz && \
rm -rf /usr/local/go && tar -C /usr/local -xzf go1.22.3.linux-amd64.tar.gz && \
export PATH=$PATH:/usr/local/go/bin && \
echo "export PATH=$PATH:/usr/local/go/bin" >> $HOME/.profile && \
rm go1.22.3.linux-amd64.tar.gz && \
source $HOME/.profile && \
go env -w GOBIN='/usr/local/go/bin/' && \
sudo apt install -y build-essential jq
```

Download initia and install:

```
cd "$HOME" && git clone https://github.com/initia-labs/initia && \
cd initia && git checkout v0.2.15 && make install && \
ln -s /usr/local/go/bin/initiad /usr/bin/
```

Add peers:

```
PEERS=$(curl -s --max-time 3 --retry 2 --retry-connrefused "https://rpc-initia-testnet.trusted-point.com/hetzner_peers.txt") | \
if [ -z "$PEERS" ]; then 
    echo "No peers were retrieved from the URL." 
else 
    echo -e "\nPEERS: "$PEERS"" 
    sed -i -e "s|^persistent_peers *=.*|persistent_peers = \"$PEERS\"|" "$HOME/.initia/config/config.toml" 
    echo -e "\nConfiguration file updated successfully.\n" 
fi
```

Add seeds:

```
SEEDS="cae5090c0fde1de1c9890e9139dbdda24233737b@seeds.cros-nest.com:26756,d1d43cc7c7aef715957289fd96a114ecaa7ba756@testnet-seeds.nodex.one:24510" && \
sed -i \
    -e "s/^seeds *=.*/seeds = \"$SEEDS\"/" \
    "$HOME/.initia/config/config.toml"
```

(OPTIONAL) Change ports:

```
CUSTOM_PORT=48 && \
sed -i.bak -e "s%:26658%:${CUSTOM_PORT}658%g;
s%:26657%:${CUSTOM_PORT}657%g;
s%:6060%:${CUSTOM_PORT}060%g;
s%:26656%:${CUSTOM_PORT}656%g;
s%:26660%:${CUSTOM_PORT}660%g" $HOME/.initia/config/config.toml && \
sed -i.bak -e "s%:1317%:${CUSTOM_PORT}317%g;
s%:8080%:${CUSTOM_PORT}080%g;
s%:9090%:${CUSTOM_PORT}090%g;
s%:9091%:${CUSTOM_PORT}091%g;
s%:8545%:${CUSTOM_PORT}545%g;
s%:8546%:${CUSTOM_PORT}546%g;
s%:6065%:${CUSTOM_PORT}065%g" $HOME/.initia/config/config.toml
```

Dissable the indexer:

```
sed -i -e 's|^indexer *=.*|indexer = "null"|' $HOME/.initia/config/config.toml
```

Set Minimum Gas Prices:

```
sed -i -e "s|^minimum-gas-prices *=.*|minimum-gas-prices = \"0.15uinit,0.01uusdc\"|" $HOME/.initia/config/app.toml
```

Update ulimit:

```
ulimit -n 65535 && \
echo -e "*                soft    nofile          65535\n\
*                hard    nofile          65535" >> /etc/security/limits.conf
```

Set IP:\
(If you are running in your own PC this command doesn’t work, you must use your public IP)

```
IP=$(hostname -I | awk '{print $1}') && \
sed -i -e "s|^external_address *=.*|external_address = \"$IP:26656\"|" $HOME/.initia/config/config.toml
```

ONLY If you set a custom port in the step 7 use:

```
IP=$(hostname -I | awk '{print $1}') | CUSTOM_PORT=48 && \
sed -i -e "s%^external_address *=.*%external_address = \"${IP}:${CUSTOM_PORT}656\"%" $HOME/.initia/config/config.toml
```

Update pruning

```
sed -i   -e 's|^pruning *=.*|pruning = "custom"|' \
  -e 's|^pruning-keep-recent *=.*|pruning-keep-recent = "100"|' \
  -e 's|^pruning-keep-every *=.*|pruning-keep-every = "0"|' \
  -e 's|^pruning-interval *=.*|pruning-interval = "10"|' \
  $HOME/.initia/config/app.toml
```

Change \<moniker> by your node’s name

```
initiad init <moniker> --chain-id initiation-1
```

Use initiad at service:

```
tee /etc/systemd/system/initiad.service > /dev/null <<EOF
[Unit]
Description=initiad
[Service]
Type=simple
User=$USER
ExecStart=$(which initiad) start
Restart=on-abort
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=initiad
LimitNOFILE=65535
[Install]
WantedBy=multi-user.target 
EOF
```

Download a Snapshot:

```
sudo apt update && \
sudo apt install snapd -y && \
sudo snap install lz4 && \
cp ~/.initia/data/priv_validator_state.json  ~/.initia/priv_validator_state.json && \
initiad tendermint unsafe-reset-all --keep-addr-book --home $HOME/.initia && \
curl -o - -L https://snapshot-initia.dongqn.com/testnet-snapshots/initia/initia_308650.tar.lz4 | lz4 -c -d - | tar -x -C $HOME/.initia && \
mv ~/.initia/priv_validator_state.json  ~/.initia/data/priv_validator_state.json && \
wget https://initia.s3.ap-southeast-1.amazonaws.com/initiation-1/genesis.json -O $HOME/.initia/config/genesis.json
```

Launch:

```
sudo systemctl daemon-reload && \
sudo systemctl enable initiad && \
sudo systemctl start initiad && \
sudo journalctl -u initiad -f -o cat
```

## Validator <a href="#id-5b82" id="id-5b82"></a>

**Create your validator when your node is synced**

Check node height:

```
local_height=$(initiad status | jq -r .sync_info.latest_block_height); network_height=$(curl -s https://rpc-initia-testnet.trusted-point.com/status | jq -r .result.sync_info.latest_block_height); blocks_left=$((network_height - local_height)); echo "Your node height: $local_height"; echo "Network height: $network_height"; echo "Blocks left: $blocks_left"
```

Add new key:

```
initiad keys add wallet
```

Show your wallet address:

```
initiad keys show wallet -a
```

Request tokens in the faucet:\
<https://faucet.testnet.initia.xyz/>

Check balance:

```
initiad query bank balances $(initiad keys show wallet -a)
```

## Create validator:

```
initiad tx mstaking create-validator \
--amount 1000000uinit \
--pubkey $(initiad tendermint show-validator) \
--moniker "YOUR_MONIKER_NAME" \
--identity "YOUR_KEYBASE_ID" \
--details "YOUR_DETAILS" \
--website "YOUR_WEBSITE_URL" \
--chain-id initiation-1 \
--commission-rate 0.05 \
--commission-max-rate 0.20 \
--commission-max-change-rate 0.05 \
--from wallet \
--gas-adjustment 1.4 \
--gas auto \
--gas-prices 0.15uinit \
-y
```

**Congrats! your validator is done!**

* Update validator info:

```
initiad tx mstaking edit-validator \
--moniker "YOUR_MONIKER_NAME" \
--identity "YOUR_KEYBASE_ID" \
--details "YOUR_DETAILS" \
--website "YOUR_WEBSITE_URL" \
--chain-id initiation-1 \
--commission-rate 0.05 \
--from wallet \
--gas-adjustment 1.4 \
--gas auto \
--gas-prices 0.15uinit \
-y
```

* Delegate yourself:

```
initiad tx mstaking delegate $(initiad keys show wallet --bech val -a) 1000000uinit --from wallet --chain-id initiation-1 --gas-adjustment 1.4 --gas auto --gas-prices 0.15uinit -y
```

* Unjail your validator:

```
initiad tx slashing unjail --from wallet --chain-id initiation-1 --gas-adjustment 1.4 --gas auto --gas-prices 0.15uinit -y
```

## **Oracle** <a href="#a5a0" id="a5a0"></a>

1. Download and install:

```
cd "$HOME" && git clone https://github.com/skip-mev/slinky.git && cd slinky && \
git checkout v0.4.3 && make build && \
ln -s "$HOME/slinky/build/slinky" "/usr/bin/"
```

2\. Update app.toml:

```
sed -i '0,/^enabled *=/{//!b};:a;n;/^enabled *=/!ba;s|^enabled *=.*|enabled = "true"|' $HOME/.initia/config/app.toml && \
sed -i -e 's|^oracle_address *=.*|oracle_address = "127.0.0.1:8080"|' $HOME/.initia/config/app.toml && \
sed -i -e 's|^client_timeout *=.*|client_timeout = "300ms"|' $HOME/.initia/config/app.toml
```

3\. Use Oracle at service:

```
tee /etc/systemd/system/oracle.service > /dev/null <<EOF
[Unit]
Description=oracle

[Service]
Type=simple
User=$USER
ExecStart=/usr/bin/slinky --oracle-config-path "$HOME/slinky/config/core/oracle.json" --market-map-endpoint 0.0.0.0:9090
Restart=on-abort
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=oracle
LimitNOFILE=65535

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

4\. Launch oracle and restart node:

```
sudo systemctl daemon-reload && \
sudo systemctl enable oracle && \
sudo systemctl start oracle && \
sudo systemctl restart initiad && \
sudo journalctl -u oracle -f -o cat
```


# XRPL EVM-Testnet

Recommended Hardware: 8 Cores, 32GB RAM, 1TB of storage (NVME)

## Installation:

Install dependencies, if needed:

```
sudo apt update && \
sudo apt install curl git jq build-essential gcc unzip wget lz4 -y
```

Install go, if needed:

```
ver="1.21.13"
wget "https://golang.org/dl/go$ver.linux-amd64.tar.gz"
sudo rm -rf /usr/local/go
sudo tar -C /usr/local -xzf "go$ver.linux-amd64.tar.gz"
rm "go$ver.linux-amd64.tar.gz"
echo "export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin" >> $HOME/.bash_profile
source $HOME/.bash_profile
go version
```

## Download Binary:

```
wget https://github.com/xrplevm/node/releases/download/v7.0.0/node_7.0.0_Linux_amd64.tar.gz
tar -xzf node_7.0.0_Linux_amd64.tar.gz
sudo mv /root/bin/exrpd /usr/local/bin/
chmod +x /usr/local/bin/exrpd
which exrpd
exrpd version
```

Setup your variable settings:

```
echo "export WALLET="wallet"" >> $HOME/.bash_profile
echo "export MONIKER="dongqn"" >> $HOME/.bash_profile
echo "export EXRPD_CHAIN_ID="xrplevm_1449000-1"" >> $HOME/.bash_profile
source $HOME/.bash_profile
```

Initialize node & create home directory for .exrpd

```
cd $HOME
exrpd init $MONIKER --chain-id $EXRPD_CHAIN_ID
```

Download genesis file:

```
wget -O $HOME/.exrpd/config/genesis.json "https://raw.githubusercontent.com/xrplevm/networks/refs/heads/main/testnet/genesis.json"
```

Set up node configuration:

```
sed -i.bak -e "s/^chain-id *=.*/chain-id = \"xrplevm_1449000-1\"/;" ~/.exrpd/config/client.toml
sed -i.bak -e "s/^keyring-backend *=.*/keyring-backend = \"os\"/;" ~/.exrpd/config/client.toml
sed -i.bak -e "s/^minimum-gas-prices *=.*/minimum-gas-prices = \"0.0025axrp\"/;" ~/.exrpd/config/app.toml
external_address=$(wget -qO- eth0.me)
sed -i.bak -e "s/^external_address *=.*/external_address = \"$external_address:26656\"/" $HOME/.exrpd/config/config.toml
PEERS=`curl -sL https://raw.githubusercontent.com/xrplevm/networks/main/testnet/peers.txt | sort -R | head -n 10 | awk '{print $1}' | paste -s -d, -`
sed -i.bak -e "s/^seeds *=.*/seeds = \"$PEERS\"/" ~/.exrpd/config/config.toml
sed -i -e "s/^filter_peers *=.*/filter_peers = \"true\"/" $HOME/.exrpd/config/config.toml
```

(OPTIONAL) Set up pruning:

```
pruning="custom"
pruning_keep_recent="1000"
pruning_interval="100"
sed -i -e "s/^pruning *=.*/pruning = \"$pruning\"/" $HOME/.exrpd/config/app.toml
sed -i -e "s/^pruning-keep-recent *=.*/pruning-keep-recent = \"$pruning_keep_recent\"/" $HOME/.exrpd/config/app.toml
sed -i -e "s/^pruning-interval *=.*/pruning-interval = \"$pruning_interval\"/" $HOME/.exrpd/config/app.toml
```

(OPTIONAL) Set up indexer:

```
indexer="null"
sed -i -e "s/^indexer *=.*/indexer = \"$indexer\"/" $HOME/.exrpd/config/config.toml
```

(OPTIONAL) Enable/Disable Snapshots:

```
snapshot_interval=1000
sed -i.bak -e "s/^snapshot-interval *=.*/snapshot-interval = \"$snapshot_interval\"/" ~/.exrpd/config/app.toml
```

Use initiad at service:

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

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

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

Launch:

```
systemctl daemon-reload
systemctl enable exrpd
systemctl restart exrpd && journalctl -u exrpd -f -o cat
```

**Check for your syncing progress**

```
exrpd status 2>&1 | jq
```

## Create wallet

```
exrpd keys add wallet --key-type eth_secp256k1
```

## **Creating a validator** <a href="#id-5b82" id="id-5b82"></a>

The XRPL EVM runs in a Proof of Authority consensus mechanism. In order to start signing for new blocks and participate in the network consensus, the current validators need to accept your node as a new trusted validator. This democratic process requires the approval of the majority of the current validators.

To begin the process, join the [XRPL EVM Sidechain Discord](https://discord.gg/xrplevm) and select your validator role in the `#roles` channel. After that, you will need to introduce yourself in the `#become-a-validator` channel. Explain who you are and why you want to run a validator. Generally, you will be accepted if you have a real interest in the project, either because you want to use the network for a company, are a recognized member of the community who wants to contribute to its long-term governance, or just have an academic interest.

While doing your introduction, you will need to provide the details that identify your validator.

* **Moniker**: The public name of your validator
* **Validator operator address**: The address of the operator of the node that starts with *ethmvaloper* . Can be obtained by running:

```
exrpd keys show wallet --bech val
```

* **Public key**: The public key of your node. Can be obtained by running:

```
exrpd tendermint show-validator
```

After that, a proposal to accept your validator will be voted on over a period of 7 days. During this time, some members may write to you publicly or privately to ask more questions. You can view the process on the [XRPL EVM Sidechain Explorer](https://governance.xrplevm.org/xrp/proposals).

#### (Optional) Download a Snapshot <a href="#id-6.-optional-download-a-snapshot" id="id-6.-optional-download-a-snapshot"></a>

```
systemctl stop exrpd
exrpd tendermint unsafe-reset-all --home $HOME/.exrpd
if curl -s --head curl https://share102.utsa.tech/xrpl/xrpl.tar.lz4 | head -n 1 | grep "200" > /dev/null; then
  curl https://share102.utsa.tech/xrpl/xrpl.tar.lz4 | lz4 -dc - | tar -xf - -C $HOME/.exrpd
    else
  echo "no snapshot found"
fi

systemctl restart exrpd && journalctl -u exrpd -f -o cat

```


# RepublicAI-Testnet

Recommended Hardware: 4 Cores, 16GB RAM, 500GB of storage (NVME)

#### Install Dependencies

```
sudo apt update && sudo apt upgrade -y
sudo apt install -y curl git jq patchelf
```

#### Install GLIBC 2.39 (Isolated)

```
cd $HOME
wget -O glibc-2.39-ubuntu24.tar.gz https://raw.githubusercontent.com/coinsspor/coinsspor/main/glibc-2.39-ubuntu24.tar.gz
tar -xzvf glibc-2.39-ubuntu24.tar.gz
sudo mkdir -p /opt/glibc-2.39/lib
sudo mv glibc-transfer/* /opt/glibc-2.39/lib/
/opt/glibc-2.39/lib/ld-linux-x86-64.so.2 --version
rm -rf glibc-transfer glibc-2.39-ubuntu24.tar.gz
```

#### Install Go (if not installed)

```
go version || {
    cd $HOME
    GO_VERSION="1.22.5"
    wget "https://golang.org/dl/go${GO_VERSION}.linux-amd64.tar.gz"
    sudo rm -rf /usr/local/go
    sudo tar -C /usr/local -xzf "go${GO_VERSION}.linux-amd64.tar.gz"
    rm "go${GO_VERSION}.linux-amd64.tar.gz"
    
    echo 'export GOROOT=/usr/local/go' >> $HOME/.bash_profile
    echo 'export GOPATH=$HOME/go' >> $HOME/.bash_profile
    echo 'export GO111MODULE=on' >> $HOME/.bash_profile
    echo 'export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin' >> $HOME/.bash_profile
    source $HOME/.bash_profile
}
go version
```

#### Download and Patch Republic Binary

```
cd $HOME
VERSION="v0.1.0"
curl -L "https://media.githubusercontent.com/media/RepublicAI/networks/main/testnet/releases/${VERSION}/republicd-linux-amd64" -o republicd
chmod +x republicd
patchelf --set-interpreter /opt/glibc-2.39/lib/ld-linux-x86-64.so.2 republicd
patchelf --set-rpath /opt/glibc-2.39/lib republicd
sudo cp republicd $HOME/go/bin/republicd
republicd version
```

#### Initialize Node

```
republicd init dongqn --chain-id 	raitestnet_77701-1
curl -s https://raw.githubusercontent.com/RepublicAI/networks/main/testnet/genesis.json > $HOME/.republic/config/genesis.json

```

#### Configure Peers

```
PEERS="e281dc6e4ebf5e32fb7e6c4a111c06f02a1d4d62@3.92.139.74:26656,cfb2cb90a241f7e1c076a43954f0ee6d42794d04@54.173.6.183:26656,dc254b98cebd6383ed8cf2e766557e3d240100a9@54.227.57.160:26656"
sed -i "s/^persistent_peers *=.*/persistent_peers = \"$PEERS\"/" $HOME/.republic/config/config.toml
```

#### Configure Gas Price and Pruning

```
# Set minimum gas price
sed -i 's/minimum-gas-prices = "0arai"/minimum-gas-prices = "250000000arai"/' $HOME/.republic/config/app.toml

# Configure pruning (optional - saves disk space)
sed -i -e 's|^pruning *=.*|pruning = "custom"|' \
  -e 's|^pruning-keep-recent *=.*|pruning-keep-recent = "100"|' \
  -e 's|^pruning-keep-every *=.*|pruning-keep-every = "0"|' \
  -e 's|^pruning-interval *=.*|pruning-interval = "19"|' \
  $HOME/.republic/config/app.toml
```

#### Create Systemd Service

<pre><code><strong>sudo tee /etc/systemd/system/republicd.service > /dev/null &#x3C;&#x3C;EOF
</strong>[Unit]
Description=Republic Node
After=network-online.target

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

[Install]
WantedBy=multi-user.target
EOF
</code></pre>

#### Start Node

```
systemctl daemon-reload
systemctl enable republicd
systemctl restart republicd && journalctl -u republicd -f -o cat
```

### Verify Installation

```
republicd status 2>&1 | jq
```

### Wallet Operations

```abap
- Create New Wallet
republicd keys add wallet
- Import Existing Wallet
republicd keys add wallet --recover
- Check Balance
republicd query bank balances $(republicd keys show wallet -a)

```

### Create Validator

```
republicd tx staking create-validator \
  --amount=1000000000000000000000arai \
  --pubkey=$(republicd comet show-validator \
  --moniker="dongqn" \
  --identity="0D60B8464B1B7BB3" \
  --details="Making Node Setup Dongqn" \
  --website="https://dongqn.com" \
  --chain-id=raitestnet_77701-1 \
  --commission-rate="0.10" \
  --commission-max-rate="0.20" \
  --commission-max-change-rate="0.01" \
  --min-self-delegation="1" \
  --gas=auto \
  --gas-adjustment=1.5 \
  --gas-prices="250000000arai" \
  --from=wallet \
  -y
```


# Allora Full Node (RPC)

Recommended Hardware: 8 Cores, 64GB RAM, 500GB of storage (NVME)

### nstallation <a href="#installation" id="installation"></a>

Install dependencies, if needed

```bash
sudo apt update && sudo apt upgrade -y
sudo apt install git
sudo apt-get install apt-transport-https ca-certificates curl software-properties-common -y
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt-get update
sudo apt-get install docker-ce jq python3-pip -y
```

Clone repository Allora:

```bash
git clone -b main https://github.com/allora-network/allora-chain.git
```

Sửa file docker-compose.yaml như hình:

<figure><img src="https://4035067140-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC9MoDmPzf2bJhCnlF4JC%2Fuploads%2FF9YNu0w910beOzmPFRX1%2Fimage.png?alt=media&amp;token=f0f40992-0761-42d7-a7c6-85cf7e57e712" alt=""><figcaption></figcaption></figure>

#### Run the Node with Docker Compose

```bash
cd $HOME
cd allora-chain
sudo docker-compose pull
sudo docker-compose up -d
```

#### Monitoring Logs

```
sudo docker-compose  logs -f
```

You can interact with the running node through RPC calls. For example, to check the node's status:

```
curl -s http://localhost:26657/status | jq .
```

Once your node has finished synching and is caught up with the network, this command will return `false`:

```
curl -so- http\://localhost:26657/status | jq .result.sync_info.catching_up
```


# Hedge-Tesnet

Recommended Hardware: 8 Cores, 64GB RAM, 500GB of storage (NVME)

### Installation <a href="#installation" id="installation"></a>

Install dependencies, if needed

```bash
sudo apt update && sudo apt upgrade -y
sudo apt install curl git jq build-essential gcc unzip wget lz4 -y
sudo apt-get install wget liblz4-tool aria2 -y
```

Install go, if needed

```bash
cd $HOME && \
ver="1.22.0" && \
wget "https://golang.org/dl/go$ver.linux-amd64.tar.gz" && \
sudo rm -rf /usr/local/go && \
sudo tar -C /usr/local -xzf "go$ver.linux-amd64.tar.gz" && \
rm "go$ver.linux-amd64.tar.gz" && \
echo "export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin" >> ~/.bash_profile && \
source ~/.bash_profile && \
go version
```

Dowload ibwasmvm.x86\_64.so

```bash
set -eux; \
  wget -O /lib/libwasmvm.x86_64.so https://github.com/CosmWasm/wasmvm/releases/download/v1.3.0/libwasmvm.x86_64.so
```

Dowload Hedged

```bash
mkdir -p $HOME/go/bin
sudo wget -O hedged https://github.com/hedgeblock/testnets/releases/download/v0.1.0/hedged_linux_amd64_v0.1.0
chmod +x hedged
sudo mv hedged $HOME/go/bin
```

Config Node

```bash
hedged config chain-id berberis-1
hedged config keyring-backend test
hedged init "Moniker" --chain-id berberis-1
```

```
sudo wget -O $HOME/.hedge/config/genesis.json "https://raw.githubusercontent.com/dongqn/GuideNode/main/Hedge/genesis.json"
sudo wget -O $HOME/.hedge/config/addrbook.json "https://raw.githubusercontent.com/dongqn/GuideNode/main/Hedge/addrbook.json"
```

```
sed -i.bak -e "s/^minimum-gas-prices *=.*/minimum-gas-prices = \"0.025uhedge\"/;" ~/.hedge/config/app.toml
peers="456e1905d54e91069fad178738bffdd77f6c4c61@95.217.230.235:11856,78f06f08f53204c06cb9f977564178a6524c4919@65.109.83.40:26856,24e2ba947d2692dead86f5c03b4741d69db08c1b@65.109.93.124:26856,3f4bc2cef7a8817eb2e66dcb292e57f9c4162c17@84.247.189.94:11856,37009116ccd9c207afe4de6dcc69adfd9c9bee2b@142.132.161.179:26656,5cbd9c8f1d6a989caf0e20854e8f871014b6da34@159.69.36.113:26656,ea67e3171934755c36a591fced601956c9e9b741@77.237.243.100:26656,b52d56d1d6b653be8e5215b85846fe65ee55af19@89.58.36.209:2656,e17e1afbd58c6262c6d6a8c991b4a1e570d6c1c4@84.247.128.239:26656,02b883a7ab541c37949fd72ad51fd40809f03123@46.101.149.208:26656,2129f6296413e134d94c5a0b98905cc4108860f8@194.5.157.3:26656,a6d4b9dabb8428e0eaefe61619258f3a97001824@213.199.61.251:26656,02b58ec274d0eb9d7d9a4e6b6dfdcd310a0046cb@217.196.49.36:26656,268da5b10276ea13c4d839fe387249428b407f3d@148.113.8.196:24056,bc64e8794465dd46399bf6f49a564098e09b0843@164.92.96.212:26656,b2a0bfb93d98e62802ec21eac60eaf11f17354d8@89.117.145.86:11856,289626099b5ee210bbb5b4141697c98f726b2293@207.180.196.56:26656,f5d973568fec14272c8b3ced0cb74277ff5866fa@62.171.131.124:26656,153f0d20405f7343b7b0c93cbed8c3957379416f@57.128.63.126:26656,2c6ae886df41b08b6361de953ad44c6f574afb05@51.178.92.69:12656,70f7dc74d3b6afa12b988d61707229e8e191d9a2@213.246.45.16:55656,0c9fa03479edf7093241305be1f6b5a361039c28@45.85.147.82:11856,1a6b131e0cfb2055dcf69a4dff13ecd1ba139ff5@118.70.184.87:12656,880ba25ffe4410ef8606562106d871fae996311a@94.72.100.234:34656,60bc3ebe21a75cf5c189944f5185b0585698e929@81.17.98.161:26656,b5d5226ac957b8b384644e0aa2736be4b40f806c@46.38.232.86:14656,1967e0c2e99401c49fbed2c7f1aa224a675e09a2@142.132.156.99:31056,eb4a3c7cd6baa8d249d8f8300004f9eb85bb13c7@158.220.108.184:12656,7879005ab63c009743f4d8d220abd05b64cfee3d@54.92.167.150:26656,d8651a9562d693baa0eb9190df2982e7096fac63@5.189.157.127:26656,6710c70956dd763160a2cacb932fb135dcb1de86@152.53.46.144:12656,688f0b64793e675c15a59d7d7ac3eb649f86e978@173.249.57.190:26656,d6875c002ff3dacacbb1c971169f1e2c1193119b@65.109.139.2:26656,0b7dbbbf7ae007daafe3c49c142fce5dcc9a1c55@94.72.125.122:26656,54f0c004ee99ee82c6c2c54595ee4f2aa7572b53@116.203.18.135:26656,2e6c06a968b25454940903945003aac08ab0632e@135.181.105.5:26656,c363b364f61ff8d4a2e063e0223bdfcb8c4d0831@213.199.48.49:27656,7292af244f9c87937a01d8e5bcd090449d4404f0@62.171.176.118:11856,93165d63303c5632b060a8dcfc8a440fd001c0c8@103.156.0.148:26656,0bb66c6dcbf5122bde07b3a6b7301b48b9b350e1@194.163.190.35:11856,1d27fbe4d26e60a67d1b4b9062089894d127503b@149.102.159.7:26656,bb866adfd1c6330da67da1ae2abed9a8b859dfe2@75.119.137.169:26656,2b7036066115632bcb6f775bab516266fb0b4234@103.37.60.202:26656,e611f55f2b2e76a95ffee427cc8375737c2f4073@158.220.103.29:26656,d7a743ecacaadf9be29d3da733d5c90cff7cf3f5@154.12.227.137:26656,820a9d47ccfbab46b0fe71a86a4ad048ed8894da@184.174.38.118:11856,797b8b0dbb9ae4b5c5f07d10a254ab0160c90a4b@23.88.53.64:26656,eab329a812987efda7b6b015b06554390194634f@109.205.178.231:27656,35b4dc6f1f4d4da6f293cd79b34fd0e21367a08f@37.60.227.6:11856,78ee8c630e42c5699a5e30a5c285252cb2ba29e1@37.27.36.74:26656,11f718501c4b90881e867a7d3a10c381a361df51@195.26.240.132:26656,1b4ccd39bfaf92b03c8fa9ef333cb74552d43a9c@65.109.39.80:11856,c18568e8ca345d5617153afc54b32af500282bd9@77.237.240.208:26556,c7c80f0f5b6dfe4837abd6a7eab4c8342e5c2a95@65.109.115.56:11856,e634bbdc8a1fee53b9c2abc779c653c21adb7496@168.119.10.134:26995,9878d322ad5f18696a92a620b3451426134f46e6@62.169.25.68:11856,8372a1ebdf8a82fb238ca0213a83f656918e9612@171.252.20.45:26656,d8691cfda61f947f18b2f5a040905292291aa060@27.79.182.194:26650,e79199d42b86cf5a231d7a0efa5f22b28e7b7026@165.22.84.5:26656,f87f88dd82f5a7166845c379384e4c7a7fb45995@27.79.160.157:12656,da60b9e1d8f8618307de3ef0d9a61eac6bf7d634@45.144.29.157:26656,a695d84fb638b78eecfe3fd3a05c3d94dad2b901@173.212.203.50:11656,903a6a6275d3bfcbc9e1890a20ca7346b83c8dc8@195.26.246.50:44456"
sed -i.bak -e "s/^persistent_peers *=.*/persistent_peers = \"$peers\"/" $HOME/.hedge/config/config.toml
seeds="7879005ab63c009743f4d8d220abd05b64cfee3d@54.92.167.150:26656,b52d56d1d6b653be8e5215b85846fe65ee55af19@testnet-seeds.genznodes.dev:2656"
sed -i.bak -e "s/^seeds =.*/seeds = \"$seeds\"/" $HOME/.hedge/config/config.toml
sed -i 's/max_num_inbound_peers =.*/max_num_inbound_peers = 50/g' $HOME/.hedge/config/config.toml
sed -i 's/max_num_outbound_peers =.*/max_num_outbound_peers = 50/g' $HOME/.hedge/config/config.toml
sed -i "s/^indexer *=.*/indexer = \"null\"/" $HOME/.hedge/config/config.toml
```

Pruning and indexer

```
pruning="custom" && \
pruning_keep_recent="100" && \
pruning_keep_every="0" && \
pruning_interval="10" && \
sed -i -e "s/^pruning *=.*/pruning = \"$pruning\"/" $HOME/.hedge/config/app.toml && \
sed -i -e "s/^pruning-keep-recent *=.*/pruning-keep-recent = \"$pruning_keep_recent\"/" $HOME/.hedge/config/app.toml && \
sed -i -e "s/^pruning-keep-every *=.*/pruning-keep-every = \"$pruning_keep_every\"/" $HOME/.hedge/config/app.toml && \
sed -i -e "s/^pruning-interval *=.*/pruning-interval = \"$pruning_interval\"/" $HOME/.hedge/config/app.toml
```

Create hedged service for your node to run in the background

```
sudo tee /etc/systemd/system/hedged.service > /dev/null <<EOF
[Unit]
Description=Hedged Node
After=network-online.target
[Service]
User=$USER
ExecStart=$(which hedged) start
Restart=always
RestartSec=3
LimitNOFILE=65535
[Install]
WantedBy=multi-user.target
EOF
```

Start node

```
sudo systemctl daemon-reload && \
sudo systemctl enable hedged && \
sudo systemctl restart hedged && \
sudo journalctl -u hedged -f -o cat
```

**Check for your syncing progress**

```
hedged status 2>&1 | jq
```

## Create wallet

<pre><code>hedged keys add wallet

<strong># DO NO FORGET TO SAVE THE SEED PHRASE &#x26; YOUR PASSPHRASE YOU SET FOR THIS WALLET
</strong># You can add --recover flag to restore existing key instead of creating
</code></pre>

Check Balance

```
hedged q bank balances $(hedged keys show wallet -a)
```

## &#x20;**Create validator**

```
hedged tx staking create-validator \
--amount=1000000uhedge \
--pubkey=$(hedged tendermint show-validator) \
--moniker="Moniker" \
--chain-id=berberis-1 \
--commission-rate=0.10 \
--commission-max-rate=0.20 \
--commission-max-change-rate=0.1 \
--min-self-delegation=1 --from=wallet \
--gas-prices=0.025uhedge \
--gas-adjustment=1.5 \
--gas=auto \
-y
```

Delegate to your self

```
hedged tx staking delegate $(hedged keys show wallet --bech val -a) 1000000uhedge --from wallet --chain-id berberis-1 --gas-prices=0.025uhedge --gas-adjustment=1.5 --gas=auto -y
```

Unjail

```
hedged tx slashing unjail --from wallet --chain-id=berberis-1 --gas-prices=0.025uhedge --gas-adjustment=1.5 --gas=auto -y 
```

Get Validator Info

```
hedged status 2>&1 | jq -r '.ValidatorInfo // .validator_info'
```

### Node Snapshot Testnet Hedgeblock

Install requirement if don't have:

```
sudo apt install lz4 -y
```

Stop node

```
sudo systemctl stop hedged
```

Back up priv\_validator\_state.json

```
cp $HOME/.hedge/data/priv_validator_state.json $HOME/.hedge/priv_validator_state.json.bak
```

Reset chain data

```
hedged tendermint unsafe-reset-all --home $HOME/.hedge --keep-addr-book
```

Download Snapshot Data

```
aria2c -x 16 -s 16 https://snapshot-de-1.genznodes.dev/hedgeblock/hedge-testnet-2422536.tar.lz4
lz4 -c -d hedge-testnet-2422536.tar.lz4 | tar -x -C $HOME/.hedge/
```

Validator node move priv\_validator\_state.json that was backed up earlier

```
mv $HOME/.hedge/priv_validator_state.json.bak $HOME/.hedge/data/priv_validator_state.json
```

Restart node

```
sudo systemctl restart hedged
journalctl -fu hedged -o cat
```

## Congratulation!!&#x20;

Now you have completed your node for 0gchain and we will move on to creating your storage node next.


# Symphony  Validator Node

Recommended Hardware: 8 Cores, 64GB RAM, 500GB of storage (NVME)

### Installation <a href="#installation" id="installation"></a>

Install dependencies, if needed

```bash
sudo apt update && sudo apt upgrade -y
sudo apt install curl tar wget clang pkg-config libssl-dev jq build-essential bsdmainutils git make ncdu gcc git jq htop tmux chrony liblz4-tool -y
```

Install go, if needed

```bash
cd $HOME
VER="1.22.2"
wget "https://golang.org/dl/go$VER.linux-amd64.tar.gz"
sudo rm -rf /usr/local/go
sudo tar -C /usr/local -xzf "go$VER.linux-amd64.tar.gz"
rm "go$VER.linux-amd64.tar.gz"
[ ! -f ~/.bash_profile ] && touch ~/.bash_profile
echo "export PATH=$PATH:/usr/local/go/bin:~/go/bin" >> ~/.bash_profile
source $HOME/.bash_profile
[ ! -d ~/go/bin ] && mkdir -p ~/go/bin
go version
```

Build symphonyd binary from source

```bash
cd $HOME
git clone https://github.com/Orchestra-Labs/symphony
cd symphony
git checkout v0.4.1
make install
```

Setup your variable settings

```bash
symphonyd init $MONIKER --chain-id symphony-testnet-4
sed -i -e "s|^keyring-backend *=.*|keyring-backend = \"os\"|" $HOME/.symphonyd/config/client.toml
sed -i -e "s|^chain-id *=.*|chain-id = \"symphony-testnet-4\"|" $HOME/.symphonyd/config/client.toml
sed -i -e "s|^node *=.*|node = \"tcp://localhost:12157\"|" $HOME/.symphonyd/config/client.toml
```

Download genesis file

```
curl -Ls https://snapshot.sychonix.com/testnet/symphony/genesis.json > $HOME/.symphonyd/config/genesis.json
curl -Ls https://snapshot.sychonix.com/testnet/symphony/addrbook.json > $HOME/.symphonyd/config/addrbook.json
```

Config Seeds and Peers

```
SEEDS="de40129d6a823e7dff8edec28a60998373b43ed0@symphony-testnet.sychonix.com:12156"
PEERS="$(curl -sS https://rpc-symphony-t.sychonix.com/net_info | jq -r '.result.peers[] | "\(.node_info.id)@\(.remote_ip):\(.node_info.listen_addr)"' | awk -F ':' '{print $1":"$(NF)}' | sed -z 's|\n|,|g;s|.$||')"
sed -i -e "s|^seeds *=.*|seeds = '"$SEEDS"'|; s|^persistent_peers *=.*|persistent_peers = '"$PEERS"'|" $HOME/.symphonyd/config/config.toml
```

Config Pruning

```
sed -i \
  -e 's|^pruning *=.*|pruning = "custom"|' \
  -e 's|^pruning-keep-recent *=.*|pruning-keep-recent = "100"|' \
  -e 's|^pruning-interval *=.*|pruning-interval = "17"|' \
  $HOME/.symphonyd/config/app.toml
```

Set Minimum Gas Price, Enable Prometheus, and Disable the Indexer

```
sed -i -e "s|^minimum-gas-prices *=.*|minimum-gas-prices = \"0.25note\"|" $HOME/.symphonyd/config/app.toml
sed -i -e "s/prometheus = false/prometheus = true/" $HOME/.symphonyd/config/config.toml
sed -i -e "s/^indexer *=.*/indexer = \"null\"/" $HOME/.symphonyd/config/config.toml
```

Set custom port

```
sed -i -e "s%:1317%:12117%; s%:8080%:12180%; s%:9090%:12190%; s%:9091%:12191%; s%:8545%:12145%; s%:8546%:12146%; s%:6065%:12165%" $HOME/.symphonyd/config/app.toml
sed -i -e "s%:26658%:12158%; s%:26657%:12157%; s%:6060%:12160%; s%:26656%:12156%; s%:26660%:12161%" $HOME/.symphonyd/config/config.toml
```

Create symphonyd service for your node to run in the background

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

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

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

Start node

```
sudo systemctl daemon-reload
sudo systemctl enable symphonyd
sudo systemctl restart symphonyd && sudo journalctl -fu symphonyd -o cat
```

**Check for your syncing progress**

```
symphonyd status 2>&1 | jq
```

## Create wallet

```
symphonyd keys add $WALLET_NAME

# DO NOT FORGET TO SAVE THE SEED PHRASE & YOUR PASSPHRASE YOU SET FOR THIS WALLET
# You can add --recover flag to restore existing key instead of creating
```

## &#x20;**Create validator**

```
symphonyd tx staking create-validator \
--amount=500note \
--pubkey=$(symphonyd tendermint show-validator) \
--moniker=$MONIKER \
--identity="YOUR_KEYBASE_ID" \
--security-contact="sp@dongqn.com" \
--details="I love blockchain" \
--website="https://dongqn.com" \
--chain-id=symphony-testnet-4 \
--commission-rate=0.05 \
--commission-max-rate=0.20 \
--commission-max-change-rate=0.01 \
--min-self-delegation=1 \
--from=wallet \
--fees=500note \
-y
```

View Validator details:

```
symphonyd q staking validator $(symphonyd keys show "wallet" --bech val -a)
```

Unjail:

```
symphonyd tx slashing unjail --from wallet --chain-id symphony-testnet-2 --fees 500note -y
```

Send token to another wallet:

```
symphonyd tx bank send wallet <TO_WALLET_ADDRESS> 100000note --chain-id symphony-testnet-2 --fees 500note -y
```

Delegate tokens to yourself:

```
symphonyd tx staking delegate $(symphonyd keys show wallet --bech val -a) 100note --from wallet --chain-id symphony-testnet-2 --fees 500note -y
```

## Congratulation!!&#x20;


# Aaron Network  Validator

Recommended Hardware: 8 Cores, 64GB RAM, 500GB of storage (NVME)

### Installation <a href="#installation" id="installation"></a>

Install dependencies, if needed

```bash
sudo apt update && sudo apt upgrade -y
sudo apt install curl tar wget clang pkg-config libssl-dev jq build-essential bsdmainutils git make ncdu gcc git jq htop tmux chrony liblz4-tool -y
```

Install go, if needed

```bash
cd $HOME
VER="1.23.3"
wget "https://golang.org/dl/go$VER.linux-amd64.tar.gz"
sudo rm -rf /usr/local/go
sudo tar -C /usr/local -xzf "go$VER.linux-amd64.tar.gz"
rm "go$VER.linux-amd64.tar.gz"
[ ! -f ~/.bash_profile ] && touch ~/.bash_profile
echo "export PATH=$PATH:/usr/local/go/bin:~/go/bin" >> ~/.bash_profile
source $HOME/.bash_profile
[ ! -d ~/go/bin ] && mkdir -p ~/go/bin
go version
```

Install ignite

```
sudo curl https://get.ignite.com/cli | sudo bash
sudo mv ignite /usr/local/bin/
```

Build aaronetwork binary from source

```bash
cd $HOME
git clone https://github.com/aaronetwork/aaronetwork-chain.git
cd aaronetwork-chain
git checkout v1.0.0
ignite chain build
```

Setup your variable settings

```bash
aaronetworkd init dongqn --chain-id aaronetwork
```

Download genesis file

```
wget -O $HOME/.aaronetwork/config/genesis.json https://raw.githubusercontent.com/aaronetwork/chain-genesis/refs/heads/main/genesis.json
```

Config Seeds, Peers, Pruning

```
sed -i.bak -e  "s%^node = \"tcp://localhost:26657\"%node = \"tcp://localhost:14657\"%" $HOME/.aaronetwork/config/client.toml
sed -i.bak -e "s%^proxy_app = \"tcp://127.0.0.1:26658\"%proxy_app = \"tcp://127.0.0.1:14658\"%; s%^laddr = \"tcp://127.0.0.1:26657\"%laddr = \"tcp://0.0.0.0:14657\"%; s%^pprof_laddr = \"localhost:6060\"%pprof_laddr = \"localhost:14060\"%; s%^laddr = \"tcp://0.0.0.0:26656\"%laddr = \"tcp://0.0.0.0:14656\"%; s%^prometheus_listen_addr = \":26660\"%prometheus_listen_addr = \":14660\"%" $HOME/.aaronetwork/config/config.toml
sed -i.bak -e "s%^address = \"tcp://localhost:1317\"%address = \"tcp://localhost:14317\"%; s%^address = \"localhost:9090\"%address = \"localhost:14090\"%" $HOME/.aaronetwork/config/app.toml
peers="dc647a7389d3396b0a0d72d71240b02c30c47ef7@63.250.41.78:26656,1a8c6f839120a18ff270bf3a0e57e14db6d2301c@212.34.129.79:26656,7105c9f21b0a22ba243f22d9a27ea940d2638e79@77.238.248.110:26656"
sed -i.bak -e "s/^persistent_peers *=.*/persistent_peers = \"$peers\"/" ~/.aaronetwork/config/config.toml
sed -i -e "s/^minimum-gas-prices *=.*/minimum-gas-prices = \"0uaaron\"/" $HOME/.aaronetwork/config/app.toml
sed -i -e 's|^pruning *=.*|pruning = "custom"|' -e 's|^pruning-keep-recent *=.*|pruning-keep-recent = "100"|' -e 's|^pruning-keep-every *=.*|pruning-keep-every = "0"|' -e 's|^pruning-interval *=.*|pruning-interval = "19"|' $HOME/.aaronetwork/config/app.toml
sed -i 's|^indexer *=.*|indexer = "null"|' $HOME/.aaronetwork/config/config.toml
```

Create symphonyd service for your node to run in the background

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

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

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

Start node

```
sudo systemctl daemon-reload
sudo systemctl enable aaronetworkd
sudo systemctl restart aaronetworkd && sudo journalctl -fu aaronetworkd -o cat
```

**Check for your syncing progress**

```
aaronetworkd status 2>&1 | jq
```

## Create wallet

```
aaronetworkd keys add wallet

# DO NOT FORGET TO SAVE THE SEED PHRASE & YOUR PASSPHRASE YOU SET FOR THIS WALLET
# You can add --recover flag to restore existing key instead of creating
```

## &#x20;**Create validator**

```
cd $HOME
# Create validator.json file
echo "{\"pubkey\":{\"@type\":\"/cosmos.crypto.ed25519.PubKey\",\"key\":\"$(aaronetworkd comet show-validator | grep -Po '\"key\":\s*\"\K[^"]*')\"},
    \"amount\": \"1000000uaaron\",
    \"moniker\": \"dongqn\",
    \"identity\": \"0D60B8464B1B7BB3\",
    \"website\": \"https://dongqn.com\",
    \"security\": \"\",
    \"details\": \"Making Node Setup Dongqn\",
    \"commission-rate\": \"0.1\",
    \"commission-max-rate\": \"0.2\",
    \"commission-max-change-rate\": \"0.01\",
    \"min-self-delegation\": \"1\"
}" > validator.json
aaronetworkd tx staking create-validator validator.json \
    --from wallet \
    --chain-id aaronetwork
```

View Validator details:

```
aaronetworkd q staking validator $(aaronetworkd keys show "wallet" --bech val -a)
```

Unjail:

```
aaronetworkd tx slashing unjail --from wallet --chain-id aaronetwork
```

Send token to another wallet:

```
aaronetworkd tx bank send wallet <TO_WALLET_ADDRESS> 1000000uaaron --from wallet --chain-id aaronetwork
```

Delegate tokens to yourself:

```
aaronetworkd tx staking delegate $(aaronetworkd keys show wallet --bech val -a) 1000000uaaron --from wallet --chain-id aaronetwork
```

## Congratulation!!&#x20;


# Story Validator Node

Recommended Hardware: 8 Cores, 64GB RAM, 500GB of storage (NVME)

### Installation <a href="#installation" id="installation"></a>

Install dependencies, if needed

```bash
sudo apt update
sudo apt-get update
sudo apt install curl git make jq build-essential gcc unzip wget lz4 aria2 -y
```

Install go, if needed

```bash
cd $HOME && \
ver="1.22.0" && \
wget "https://golang.org/dl/go$ver.linux-amd64.tar.gz" && \
sudo rm -rf /usr/local/go && \
sudo tar -C /usr/local -xzf "go$ver.linux-amd64.tar.gz" && \
rm "go$ver.linux-amd64.tar.gz" && \
echo "export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin" >> ~/.bash_profile && \
source ~/.bash_profile && \
go version
```

Download Story-Geth binary

```bash
wget https://story-geth-binaries.s3.us-west-1.amazonaws.com/geth-public/geth-linux-amd64-0.9.2-ea9f0d2.tar.gz
tar -xzvf geth-linux-amd64-0.9.2-ea9f0d2.tar.gz
[ ! -d "$HOME/go/bin" ] && mkdir -p $HOME/go/bin
if ! grep -q "$HOME/go/bin" $HOME/.bash_profile; then
  echo 'export PATH=$PATH:$HOME/go/bin' >> $HOME/.bash_profile
fi
sudo cp geth-linux-amd64-0.9.2-ea9f0d2/geth $HOME/go/bin/story-geth
source $HOME/.bash_profile
story-geth version
```

Download Story binary

```bash
wget https://story-geth-binaries.s3.us-west-1.amazonaws.com/story-public/story-linux-amd64-0.9.11-2a25df1.tar.gz
tar -xzvf story-linux-amd64-0.9.11-2a25df1.tar.gz
[ ! -d "$HOME/go/bin" ] && mkdir -p $HOME/go/bin
if ! grep -q "$HOME/go/bin" $HOME/.bash_profile; then
  echo 'export PATH=$PATH:$HOME/go/bin' >> $HOME/.bash_profile
fi
sudo cp story-linux-amd64-0.9.11-2a25df1/story $HOME/go/bin/story
source $HOME/.bash_profile
story version
```

Init Iliad node

```bash
story init --network iliad --moniker "Your_moniker_name"
```

#### live peers <a href="#live-peers" id="live-peers"></a>

```
PEERS="2f372238bf86835e8ad68c0db12351833c40e8ad@story-testnet-peer.itrocket.net:26656,fe5b39d2bd701ed12a953894cc1449d4c5c6d699@135.125.189.91:26656,9ed1e069802812f484faa68a2c6dd61f6bc1be0b@88.99.61.173:26656,a320f8a15892bddd7b5502527e0d11c5b5b9d0e3@69.67.150.107:29931,5ca8af7a122bc4a9a294704a711c7e5e430876ff@38.242.138.228:26656,00c495396dfee53a31476d7619d1cc252b9a47b9@89.58.62.213:26656,ba7a053ab29149aa5ffcdae0248428ce49c53bc0@185.119.116.250:26656,ee5ecaf1364cb3238113ba9a29813c17fab97694@157.173.197.110:26656,a03f525b72ece596b6ea3609b49c676751fafc14@94.141.103.163:26656"
sed -i -e "/^\[p2p\]/,/^\[/{s/^[[:space:]]*persistent_peers *=.*/persistent_peers = \"$PEERS\"/}" $HOME/.story/story/config/config.toml
```

Create story-geth service file

```
sudo tee /etc/systemd/system/story-geth.service > /dev/null <<EOF
[Unit]
Description=Story Geth Client
After=network.target

[Service]
User=root
ExecStart=/root/go/bin/story-geth --iliad --syncmode full
Restart=on-failure
RestartSec=3
LimitNOFILE=4096

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

Create story service file

```
sudo tee /etc/systemd/system/story.service > /dev/null <<EOF
[Unit]
Description=Story Consensus Client
After=network.target

[Service]
User=root
ExecStart=/root/go/bin/story run
Restart=on-failure
RestartSec=3
LimitNOFILE=4096

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

Reload and start story-geth

```
sudo systemctl daemon-reload && \
sudo systemctl enable story-geth && \
sudo systemctl start story-geth
```

Reload and start story

```
sudo systemctl daemon-reload && \
sudo systemctl enable story && \
sudo systemctl start story
```

Check logs

```
sudo journalctl -u story-geth -f -o cat
sudo journalctl -u story -f -o cat
```

Check sync status

```
curl localhost:26657/status | jq
```

Create validator

Export private key *By default, when you run `story init` a validator key is created for you. To view your validator key, run the following command:*

```
story validator export
```

*In addition, if you want to export the derived EVM private key of your validator into the default data config directory, please run the following:*

```
story validator export --export-evm-key
```

*Note that to participate in consensus, at least 1 IP must be staked (equivalent to `1000000000000000000 wei`)! Faucet link:* [*https://faucet.story.foundation/*](https://faucet.story.foundation/)

```
story validator create --stake 1000000000000000000 --private-key "your_private_key"
```

Validator Staking

```
story validator stake \
   --validator-pubkey "VALIDATOR_PUB_KEY_IN_BASE64" \
   --stake 1000000000000000000 \
   --private-key xxxxxxxxxxxxxx
```

Replace `VALIDATOR_PUB_KEY_IN_BASE64`

Amount: `1000000000000000000`=1 IP Token

Check your Validator on Explorer: <https://testnet.story.explorers.guru/>

### Snapshot <a href="#snap" id="snap"></a>

```
sudo systemctl stop story story-geth
cp $HOME/.story/story/data/priv_validator_state.json $HOME/.story/story/priv_validator_state.json.backup
rm -rf $HOME/.story/story/data $$HOME/.story/geth/iliad/geth/{chaindata,blobpool,nodes}
curl https://server-5.itrocket.net/testnet/story/story_2024-08-30_153938_snap.tar.lz4 | lz4 -dc - | tar -xf - -C $HOME/.story
mv $HOME/.story/story/priv_validator_state.json.backup $HOME/.story/story/data/priv_validator_state.json
sudo systemctl restart story story-geth && sudo journalctl -u story -f
```


# Empe Validator Node

Recommended Hardware: 8 Cores, 64GB RAM, 500GB of storage (NVME)

### Installation <a href="#installation" id="installation"></a>

Install dependencies, if needed

```bash
sudo apt update && sudo apt upgrade -y
sudo apt install curl tar wget clang pkg-config libssl-dev jq build-essential bsdmainutils git make ncdu gcc git jq htop tmux chrony liblz4-tool -y
```

Install go, if needed

```bash
cd $HOME
VER="1.22.2"
wget "https://golang.org/dl/go$VER.linux-amd64.tar.gz"
sudo rm -rf /usr/local/go
sudo tar -C /usr/local -xzf "go$VER.linux-amd64.tar.gz"
rm "go$VER.linux-amd64.tar.gz"
[ ! -f ~/.bash_profile ] && touch ~/.bash_profile
echo "export PATH=$PATH:/usr/local/go/bin:~/go/bin" >> ~/.bash_profile
source $HOME/.bash_profile
[ ! -d ~/go/bin ] && mkdir -p ~/go/bin
go version
```

Binary&#x20;

```bash
curl -LO https://github.com/empe-io/empe-chain-releases/raw/master/v0.1.0/emped_linux_amd64.tar.gz
tar -xvf emped_linux_amd64.tar.gz
sudo mv emped ~/go/bin
chmod u+x ~/go/bin/emped
```

Initialize node & create home directory for .empe-chain

```bash
emped init My_Node --chain-id empe-testnet-2
emped config chain-id empe-testnet-2
emped config keyring-backend test
```

Download genesis file

```
wget -O $HOME/.empe-chain/config/genesis.json https://raw.githubusercontent.com/dongqn/GuideNode/main/Empe/genesis.json
wget -O $HOME/.empe-chain/config/addrbook.json https://raw.githubusercontent.com/dongqn/GuideNode/main/Empe/addrbook.json
```

Set custom port

```
PORT=20
emped config node tcp://localhost:${PORT}657
sed -i -e "s%^proxy_app = \"tcp://127.0.0.1:26658\"%proxy_app = \"tcp://127.0.0.1:${PORT}658\"%; s%^laddr = \"tcp://127.0.0.1:26657\"%laddr = \"tcp://127.0.0.1:${PORT}657\"%; s%^pprof_laddr = \"localhost:6060\"%pprof_laddr = \"localhost:${PORT}060\"%; s%^laddr = \"tcp://0.0.0.0:26656\"%laddr = \"tcp://0.0.0.0:${PORT}656\"%; s%^prometheus_listen_addr = \":26660\"%prometheus_listen_addr = \":${PORT}660\"%" $HOME/.empe-chain/config/config.toml
sed -i -e "s%^address = \"tcp://localhost:1317\"%address = \"tcp://localhost:${PORT}317\"%; s%^address = \":8080\"%address = \":${PORT}080\"%; s%^address = \"localhost:9090\"%address = \"localhost:${PORT}090\"%; s%^address = \"localhost:9091\"%address = \"localhost:${PORT}091\"%" $HOME/.empe-chain/config/app.toml
```

Config Seeds and Peers

```
peers="7419cc5bafc3c9c49b18ec67e3263344cbcc30f2@49.13.215.45:43656,91fb8e75a4b92589211d47d5a9ce934d32733043@116.202.48.104:26656,771b5350519d6081784f70d9be692e76b635529a@188.245.88.126:43656,06bd2afb77d94d2f3c5fe8abbdabb4499ca95793@65.21.97.150:40656,5406f64d38f433cca31c2f6e96d5619fa92be5b5@168.119.179.250:26656,e941537fbe6d86c9bf58aeb880e3212dc3f82086@84.247.141.94:656,94529b5e044f208d1869980f456a53fcef8fb321@14.167.155.13:43656,829207ca2cf7debb16787a79c9fc1aa94e9b55ea@116.203.238.65:43656,080d9cc12e08fb64dd0f4528d0da4a84d5d9428e@37.27.83.234:26656,9e120e5cb5822fbb224d5c1ae2c7f0149b80fc99@45.67.216.220:43656"
sed -i.bak -e "s/^persistent_peers *=.*/persistent_peers = \"$peers\"/" $HOME/.empe-chain/config/config.toml
sed -i.bak -e "s/^minimum-gas-prices *=.*/minimum-gas-prices = \"0.0uempe\"/" $HOME/.empe-chain/config/app.toml
```

Config Pruning

```
sed -i \
-e 's|^pruning *=.*|pruning = "custom"|' \
-e 's|^pruning-keep-recent *=.*|pruning-keep-recent = "100"|' \
-e 's|^pruning-keep-every *=.*|pruning-keep-every = "2000"|' \
-e 's|^pruning-interval *=.*|pruning-interval = "10"|' \
$HOME/.empe-chain/config/app.toml
sed -i 's|^indexer *=.*|indexer = "null"|' $HOME/.empe-chain/config/config.toml
```

Create emped  service for your node to run in the background

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

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

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

Start node

```
sudo systemctl daemon-reload
sudo systemctl enable emped
sudo systemctl restart emped
sudo journalctl -u emped -f -o cat
```

**Check for your syncing progress**

```
emped status 2>&1 | jq .SyncInfo
```

## Create wallet

```
emped keys add $WALLET_NAME

# DO NOT FORGET TO SAVE THE SEED PHRASE & YOUR PASSPHRASE YOU SET FOR THIS WALLET
# You can add --recover flag to restore existing key instead of creating
```

## &#x20;**Create validator**

```
emped tx staking create-validator \
--amount=79000000uempe \
--moniker="" \
--identity="" \
--details="" \
--website="" \
--pubkey=$(emped tendermint show-validator) \
--chain-id=empe-testnet-2 \
--commission-rate="0.10" \
--commission-max-rate="0.20" \
--commission-max-change-rate="0.01" \
--min-self-delegation="1000000" \
--from=wallet \
--fees=20000uempe \
-y
```

Check Balances:

```
emped q bank balances $(emped keys show wallet -a)
```

View Validator details:

```
emped q staking validator $(emped keys show "wallet" --bech val -a)
```

Unjail:

```
emped  tx slashing unjail --from wallet --chain-id empe-testnet-2 --gas=auto --fees=20000uempe -y
```

Send token to another wallet:

```
emped tx bank send wallet <TO_WALLET_ADDRESS> 1000000uempe --from wallet --chain-id empe-testnet-2 --fees=20000uempe -y
```

Delegate tokens to yourself:

```
emped tx staking delegate $(emped keys show wallet --bech val -a) 10000000uempe --from wallet --chain-id empe-testnet-2 --fees=20000uempe -y
```

## Congratulation!!&#x20;


# Nillion Validator Node

Recommended Hardware: 8 Cores, 64GB RAM, 500GB of storage (NVME)

### Installation <a href="#installation" id="installation"></a>

Install dependencies, if needed

```bash
sudo apt update && \
sudo apt install curl git jq build-essential gcc unzip wget lz4 -y
```

Install go, if needed

```bash
cd $HOME
VER="1.21.6"
wget "https://golang.org/dl/go$VER.linux-amd64.tar.gz"
sudo rm -rf /usr/local/go
sudo tar -C /usr/local -xzf "go$VER.linux-amd64.tar.gz"
rm "go$VER.linux-amd64.tar.gz"
[ ! -f ~/.bash_profile ] && touch ~/.bash_profile
echo "export PATH=$PATH:/usr/local/go/bin:~/go/bin" >> ~/.bash_profile
source $HOME/.bash_profile
[ ! -d ~/go/bin ] && mkdir -p ~/go/bin
```

Build 0gchaind binary from source

```bash
cd $HOME
wget -O nilchaind https://explorer.dongqn.com/guidenode/nillion/nilchaind
chmod +x nilchaind
mv nilchaind $HOME/go/bin/
nilchaind version
```

Setup your variable settings

```bash
nilchaind config set client chain-id nillion-chain-testnet-1
nilchaind config set client keyring-backend test
nilchaind config set client node tcp://localhost:18057
```

Initialize node & create home directory&#x20;

```bash
cd $HOME
nilchaind init dongqn --chain-id nillion-chain-testnet-1 --home=$HOME/.nillionapp
```

Download genesis file

```
curl -Ls https://explorer.dongqn.com/guidenode/nillion/genesis.json > $HOME/.nillionapp/config/genesis.json
curl -Ls https://explorer.dongqn.com/guidenode/nillion/addrbook.json > $HOME/.nillionapp/config/addrbook.json
```

Set nillion chain seeds

```
SEEDS="3f472746f46493309650e5a033076689996c8881@nillion-testnet.rpc.kjnodes.com:18059" && \
sed -i.bak -e "s/^seeds *=.*/seeds = \"${SEEDS}\"/" $HOME/.nillionapp/config/config.toml
```

Set min gas price

```
sed -i -e "s|^minimum-gas-prices *=.*|minimum-gas-prices = \"0unil\"|" $HOME/.nillionapp/config/app.toml
```

Pruning (Optional to save storage space)

```
sed -i \
  -e 's|^pruning *=.*|pruning = "custom"|' \
  -e 's|^pruning-keep-recent *=.*|pruning-keep-recent = "100"|' \
  -e 's|^pruning-keep-every *=.*|pruning-keep-every = "0"|' \
  -e 's|^pruning-interval *=.*|pruning-interval = "19"|' \
  $HOME/.nillionapp/config/app.toml
```

Create nillion service for your node to run in the background

```
sudo tee /etc/systemd/system/nillion.service > /dev/null <<EOF
[Unit]
Description=Nillion Node
After=network.target

[Service]
User=$USER
Type=simple
ExecStart=$(which nilchaind) start --home $HOME/.nillionapp
Restart=on-failure
LimitNOFILE=65535

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

Start node

```
sudo systemctl daemon-reload && \
sudo systemctl enable nillion && \
sudo systemctl restart nillion && \
sudo journalctl -u nillion -f -o cat
```

**Check for your syncing progress**

```
nilchaind status --node tcp://127.0.0.1:26657 2>&1 | jq
```

## Create wallet

```
nilchaind keys add $WALLET_NAME

# DO NOT FORGET TO SAVE THE SEED PHRASE & YOUR PASSPHRASE YOU SET FOR THIS WALLET
# You can add --recover flag to restore existing key instead of creating
```

Check your wallet balance (node must be synced in order to see the current balance)

```
nilchaind q bank balances $(nilchaind keys show $WALLET_NAME -a) 
```


# Gensyn Testnet Node CPU

Recommended Hardware: 4 Cores, 16GB RAM, 256GB of storage (NVME), RTX 3090, RTX 4090, A100

1\. **Update System Packages**

```
sudo apt-get update && sudo apt-get upgrade -y
```

### 2. **Install General Utilities and Tools** <a href="#id-2373" id="id-2373"></a>

```
sudo apt install screen curl iptables build-essential git wget lz4 jq make gcc nano automake autoconf tmux htop nvme-cli libgbm1 pkg-config libssl-dev libleveldb-dev tar clang bsdmainutils ncdu unzip libleveldb-dev  -y
```

### 3. **Install Python** <a href="#fe5f" id="fe5f"></a>

```
sudo apt-get install python3 python3-pip
sudo apt install python3.10-venv
```

### 4. **Install Node** <a href="#id-0829" id="id-0829"></a>

```
sudo apt-get update
curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
sudo apt-get install -y nodejs
sudo npm install -g yarn
```

### 5. **Install Yarn** <a href="#id-7d68" id="id-7d68"></a>

```
curl -o- -L https://yarnpkg.com/install.sh | sh
export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
source ~/.bashrc
```

### 6. Swap <a href="#id-6.-clone-the-repository" id="id-6.-clone-the-repository"></a>

```
sudo swapoff /swapfile
sudo rm /swapfile
sudo dd if=/dev/zero of=/swapfile bs=1M count=16384
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab
```

### 7. Clone the Repository

```
git clone https://github.com/gensyn-ai/rl-swarm/
cd rl-swarm
```

Open a screen to run it in background

```
screen -S swarm
```

Install swarm

```
cd $HOME/rl-swarm && python3 -m venv .venv && . .venv/bin/activate && git pull
CUDA_VISIBLE_DEVICES="" CPU_ONLY=1 bash run_rl_swarm.sh
```

Press `Y`

* It will show like this :thumbsup:

<figure><img src="https://4035067140-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC9MoDmPzf2bJhCnlF4JC%2Fuploads%2FYLW7m2IAc5tBz94spPcD%2Fimage.png?alt=media&amp;token=8f1aca98-1001-4d43-beb4-befe97ef84b9" alt=""><figcaption></figcaption></figure>

You need to visit the URL which you will find on your terminal there and then, log in using your email. After logging in, it will display something like this

<figure><img src="https://4035067140-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC9MoDmPzf2bJhCnlF4JC%2Fuploads%2FUmwphqm6Y7H2HXz0Ioh5%2Fimage.png?alt=media&amp;token=a0239a65-92b3-4179-8235-f7c556808319" alt=""><figcaption></figcaption></figure>

* It will ask you this question : `Would you like to push models you train in the RL swarm to the Hugging Face Hub? [y/N]` ; You should write `N` there
* You will see something like this; it indicates that everything is working fine. You can now detach from this screen session.

<figure><img src="https://4035067140-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC9MoDmPzf2bJhCnlF4JC%2Fuploads%2Fbr1kmQYHtxnVVZLPg2JY%2Fimage.png?alt=media&amp;token=8a6ba663-6bcb-430e-bf34-acf4af741269" alt=""><figcaption></figcaption></figure>

### **8. Detach from `screen session`**

* Use `Ctrl + A` and then press `D` to detach from this screen session.

### ⚠️ OTP Issue / URL not accessible :

* If you can't get OTP in your email and also can't login using google, then use this method :
* Install ngrok in different tab on the same vps ( don't close previous tab where gensyn is running)

```
wget https://bin.equinox.io/c/bNyj1mQVY4c/ngrok-v3-stable-linux-amd64.tgz && tar -xvzf ngrok-v3-stable-linux-amd64.tgz && sudo mv ngrok /usr/local/bin/
```

* Now visit : <https://ngrok.com/>
* Sign up using email
* Now go to `Your authtoken` section and then click on "show authtoken" option and then copy that command
* Now open your VPS in other tab and paste the command
* Now use this command `ngrok http 3000`
* Then click on the following url with ngrok domain and then access gynsyn page and login using email address (✅ working, tested)


# API Reference

Dive into the specifics of each API endpoint by checking out our complete documentation.

## Pets

All the methods associated with `CRUD`ing some pets. Which isn't as weird as it sounds:

{% content-ref url="/pages/vUf3g95v1hiHgzg7dBNi" %}
[Pets](/reference/api-reference/pets)
{% endcontent-ref %}

## Users

Everything related to users:

{% content-ref url="/pages/BD3l08PzuaAbmSiXA0vX" %}
[Users](/reference/api-reference/users)
{% endcontent-ref %}

{% hint style="info" %}
**Good to know:** Using the 'Page Link' block lets you link directly to a page. If this page's name, URL or parent location changes, the reference will be kept up to date. You can also mention a page – like [Pets](/reference/api-reference/pets) – if you don't want a block-level link.
{% endhint %}


# Pets

## Creating a new pet

## Create pet.

<mark style="color:green;">`POST`</mark> `https://api.myapi.com/v1/pet`

Creates a new pet.

#### Request Body

| Name                                   | Type   | Description                           |
| -------------------------------------- | ------ | ------------------------------------- |
| name<mark style="color:red;">\*</mark> | string | The name of the pet                   |
| owner\_id                              | string | The `id` of the user who owns the pet |
| species                                | string | The species of the pet                |
| breed                                  | string | The breed of the pet                  |

{% tabs %}
{% tab title="200 Pet successfully created" %}

```javascript
{
    "name"="Wilson",
    "owner": {
        "id": "sha7891bikojbkreuy",
        "name": "Samuel Passet",
    "species": "Dog",}
    "breed": "Golden Retriever",
}
```

{% endtab %}

{% tab title="401 Permission denied" %}

{% endtab %}
{% endtabs %}

{% hint style="info" %}
**Good to know:** This API method was created using the API Method block, it's how you can build out an API method documentation from scratch. Have a play with the block and you'll see you can do some nifty things like add and reorder parameters, document responses, and give your methods detailed descriptions.
{% endhint %}

## Updating a pet

{% openapi src="<https://petstore.swagger.io/v2/swagger.json>" path="/pet" method="put" %}
<https://petstore.swagger.io/v2/swagger.json>
{% endopenapi %}

{% hint style="info" %}
**Good to know:** This API method was auto-generated from an example Swagger file. You'll see that it's not editable – that's because the contents are synced to a URL! Any time the linked file changes, the documentation will change too.
{% endhint %}


# Users

{% hint style="info" %}
**Good to know:** All the methods shown below are synced to an example Swagger file URL and are kept up to date automatically with changes to the API.
{% endhint %}

## User actions

{% openapi src="<https://petstore.swagger.io/v2/swagger.json>" path="/user/login" method="get" %}
<https://petstore.swagger.io/v2/swagger.json>
{% endopenapi %}

{% openapi src="<https://petstore.swagger.io/v2/swagger.json>" path="/user/logout" method="get" %}
<https://petstore.swagger.io/v2/swagger.json>
{% endopenapi %}

## Creating users

{% openapi src="<https://petstore.swagger.io/v2/swagger.json>" path="/user/createWithList" method="post" %}
<https://petstore.swagger.io/v2/swagger.json>
{% endopenapi %}

{% openapi src="<https://petstore.swagger.io/v2/swagger.json>" path="/user/createWithArray" method="post" %}
<https://petstore.swagger.io/v2/swagger.json>
{% endopenapi %}


# How to Set Up Explorer

<figure><img src="https://4035067140-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC9MoDmPzf2bJhCnlF4JC%2Fuploads%2Fkf4xLJODEEYH0QJ9Jnw2%2Fimage.png?alt=media&amp;token=6df82e60-a4c4-486d-89d4-8f69c27d325a" alt=""><figcaption></figcaption></figure>

Install Dependencies

```
sudo apt autoremove nodejs -y
curl -fsSL https://deb.nodesource.com/setup_19.x | sudo -E bash -
curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor | sudo tee /usr/share/keyrings/yarnkey.gpg >/dev/null
echo "deb [signed-by=/usr/share/keyrings/yarnkey.gpg] https://dl.yarnpkg.com/debian stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt update
sudo apt install nginx certbot python3-certbot-nginx nodejs git yarn -y
```

**NGINX Configuration**

Create an NGINX configuration file for your explorer:

```
sudo nano /etc/nginx/sites-enabled/explorer.dongqn.com
```

Replace ***explorer.dongqn.com*** with your site's name, for example:

Create this sample configuration:

```
server {
    listen       80;
    listen  [::]:80;
    server_name explorer.dongqn.com;

    location / {
        root /usr/share/nginx/html;
        index  index.html index.htm;
        try_files $uri $uri/ /index.html;
    }

    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   /usr/share/nginx/html;
    }

    gzip on;
    gzip_proxied any;
    gzip_static on;
  
 }
```

Remember to replace ***server\_name*** with your server's name.

**SSL Configuration**

**Install Certificate SSL**

```
sudo certbot --nginx --register-unsafely-without-email
```

Select option 2 and press Enter. If the BOT asks for redirection, choose YES.

After completion, you can restart NGINX:

```
sudo systemctl restart nginx
```

**Explorer Configuration**

**Clone the Repository**

```
cd $HOME
git clone https://github.com/dongqn/explorer.git
```

**Build the Explorer**

Navigate to the explorer directory, install dependencies, and build:

```
cd $HOME/explorer
yarn && yarn build
```

If you encounter any issues, use the following command:

```
yarn install --ignore-engines
cd $HOME/explorer
yarn && yarn build
```

**Copy the Web Files to the Nginx HTML Folder**

```
sudo cp -r $HOME/explorer/dist/* /usr/share/nginx/explorer/
sudo systemctl restart nginx
```

***

## RPC and API Setup Guide

**Installing Dependencies and Setting Up Nginx**

Connect to your Node and execute the following commands to install Nginx:

```
sudo apt -q update
sudo apt -qy install curl git jq lz4 build-essential snapd unzip nginx
sudo apt -qy upgrade
```

**API Nginx Configuration File Creation**

Create a configuration file for your API:

```
sudo nano /etc/nginx/sites-available/api-testnet-nillion
```

Inside the file, it's time to enter the necessary configuration for your API subdomain. Below is a template designed specifically for a Node.js application. Make sure you understand each directive and modify it to fit the specific needs of your application, especially the ***proxy\_pass*** directive, which should point to the port your application is running on:

```
server {
    listen 80;
    server_name api-testnet-nillion.dongqn.com;

    location / {
        add_header Access-Control-Allow-Origin *;
        add_header Access-Control-Max-Age 3600;
        add_header Access-Control-Expose-Headers Content-Length;
        
        proxy_pass http://127.0.0.1:1317;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }
}
```

Replace ***api-testnet-nillion.dongqn.com*** with your domain in the ***server\_name*** section, and adjust the port number in the ***proxy\_pass*** directive if necessary (default is `1317`). This setup instructs the server to listen on port 80, the default for HTTP. The ***server\_name*** should match your project's subdomain. The ***proxy\_pass*** directive is crucial as it tells NGINX where to route requests entering this subdomain.

**Creating Your RPC Nginx Configuration File**

Similarly, create a configuration for your RPC:

```
sudo nano /etc/nginx/sites-available/rpc-testnet-nillion
```

Enter the configuration, replacing ***api-testnet-nillion.dongqn.com*** with your domain and adjusting the ***proxy\_pass*** for your RPC port (default is `26657`).

**Activating Your Configuration**

After tailoring the configuration file to your needs and saving your changes, the next step is to link this file to the `sites-enabled` directory to activate it:

```
sudo ln -s /etc/nginx/sites-available/* /etc/nginx/sites-enabled/
```

This command creates a symbolic link between the `sites-available` and `sites-enabled` directories, effectively activating your configuration.

Finally, test your NGINX configuration for syntax errors:

```
sudo nginx -t
```

If the test passes without issues, reload NGINX to apply the changes:

```
sudo systemctl reload nginx
```

Your subdomains should now be set up and accessible via the specified subdomain addresses. This setup enhances the structure of your project by creating a clear distinction between different parts of your application, facilitating developers and users to interact with your endpoints.

However, all your endpoints are still using unsecure HTTP. In the next section, we'll install SSL for all our endpoints.

**SSL Configuration**

```
sudo certbot --nginx --register-unsafely-without-email
```


