> For the complete documentation index, see [llms.txt](https://docs.validator247.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.validator247.com/testnet/airchains.md).

# Airchains

Public Endpoints

> [ https://airchains-testnet-rpc.validator247.com/](< https://airchains-testnet-rpc.validator247.com/>)
>
> <https://airchains-testnet-api.validator247.com/>

Explorer

> [ https://explorer.validator247.com/airchains-testnet/staking](< https://explorer.validator247.com/airchains-testnet/staking>)

## Installation guide

Make sure you have the latest Go build and system components installed

Download the source files:

```
wget https://github.com/ignite/cli/releases/download/v0.27.1/ignite_0.27.1_linux_amd64.tar.gz
```

Modify file permissions:

```
chmod +x ignite_0.27.1_linux_amd64.tar.gz
```

Extract the TAR file:

```
tar -xvf ignite_0.27.1_linux_amd64.tar.gz
```

Move the binary:

```
sudo mv ignite /usr/local/bin
```

Verify installation:

```
ignite version
```

Set up environment variables:

```
export PATH=$PATH:/usr/local/go/bin
```

## Running a Full Node

Download binary

```
wget https://github.com/airchains-network/junction/releases/download/v0.1.0/junctiond
```

Make the binary executable

```
chmod +x junctiond
```

Move the binary to a system-wide directory

```
sudo mv junctiond /usr/local/bin
```

Initialize the Node with the Moniker

```
junctiond init <moniker>
```

Update Genesis Configuration

```
wget https://github.com/airchains-network/junction/releases/download/v0.1.0/genesis.json
```

Replace the Existing Genesis File

```
cp genesis.json ~/.junction/config/genesis.json
```

Update Configuration:

Run the open configuration command

```
nano ~/.junction/config/config.toml 	
```

Replace peer

```
peers="1f0eada58b83f32ac7ba0ff704e15732ae2a25c4@2a01:43456,62338fe5926b9f83b13c942bf619f37c009c11ea@195.26.246.86:63656,0fc70473e7ee84b77ebcb1c098d457379931bc0a@88.99.61.53:38656,2422f4e279ab6e59e7073f282745a9d0b01ab429@185.148.3.169:13756,246fea8a11c2040662ed327d340cfd0941d03e6d@38.242.243.237:43456,fe51d4777e7ad2b4d93c3a096761a31966c65c64@2a0a:26656,b27ec34e0e9fdfcfc970cec793cb3041e54f9dc6@109.199.101.235:43456,8800f4ec6793a1294c618689ffb0dd87e9af474a@217.76.52.67:26656,ab9b3585f9e9e8c9f661eebed4569d12638baed3@109.199.101.233:43456,e0d3fc3b251344629e51b96e0896a74b0a53c648@178.18.244.156:43456,28b73cacb42620fe1c64c93beaadb34982d52a06@128.140.65.68:26656,de2e7251667dee5de5eed98e54a58749fadd23d8@34.22.237.85:26656”
```

Seeds&#x20;

```
seeds="2d1ea4833843cc1433e3c44e69e297f357d2d8bd@5.78.118.106:26656"
```

Set Mini Gas

```
sed -i 's|^minimum-gas-prices *=.*|minimum-gas-prices = "0.00025amf"|g' $HOME/.junction//config/app.toml
```

create service

```
sudo tee /etc/systemd/system/junctiond.service > /dev/null << EOF
[Unit]
Description=airchains node service
After=network-online.target
[Service]
User=$USER
ExecStart=/usr/local/bin/junctiond start
Restart=on-failure
RestartSec=10
LimitNOFILE=65535
[Install]
WantedBy=multi-user.target
EOF

sudo systemctl daemon-reload
sudo systemctl enable junctiond
```

State Sync

```
sudo systemctl stop junctiond

SNAP_RPC="https://airchains-testnet-rpc.validator247.com:443"

cp $HOME/.junction/data/priv_validator_state.json $HOME/.junction/priv_validator_state.json.backup
junctiond tendermint unsafe-reset-all --home ~/.warden/ --keep-addr-book

LATEST_HEIGHT=$(curl -s $SNAP_RPC/block | jq -r .result.block.header.height); \
BLOCK_HEIGHT=$((LATEST_HEIGHT - 2000)); \
TRUST_HASH=$(curl -s "$SNAP_RPC/block?height=$BLOCK_HEIGHT" | jq -r .result.block_id.hash)
echo $LATEST_HEIGHT $BLOCK_HEIGHT $TRUST_HASH

sed -i.bak -E "s|^(enable[[:space:]]+=[[:space:]]+).*$|\1true| ; \
s|^(rpc_servers[[:space:]]+=[[:space:]]+).*$|\1\"$SNAP_RPC,$SNAP_RPC\"| ; \
s|^(trust_height[[:space:]]+=[[:space:]]+).*$|\1$BLOCK_HEIGHT| ; \
s|^(trust_hash[[:space:]]+=[[:space:]]+).*$|\1\"$TRUST_HASH\"|" ~/.junction/config/config.toml
more ~/.junction/config/config.toml | grep 'rpc_servers'
more ~/.junction/config/config.toml | grep 'trust_height'
more ~/.junction/config/config.toml | grep 'trust_hash'

sudo mv $HOME/.junction/priv_validator_state.json.backup $HOME/.junction/data/priv_validator_state.json

sudo systemctl restart junctiond && journalctl -u junctiond -f -o cat
```

Launch Node

```
sudo systemctl restart junctiond && journalctl -u junctiond -f -o cat		
```

Check sync status

```
junctiond status 2>&1 | jq .sync_info
```

## Command services

```
- Reload
sudo systemctl daemon-reload

- Start
sudo systemctl start junctiond

- Stop
sudo systemctl stop junctiond

- Restart
sudo systemctl restart junctiond

- Check Status
sudo systemctl status junctiond

- Check Logs
sudo journalctl -u junctiond -f -o cat
```

## &#x20;Wallet

Creat Wallet

```
junctiond keys add wallet
```

Recover existing key

```
junctiond keys add wallet --recover
```

List All Keys

```
junctiond keys list
```

Query Wallet Balance

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

To obtain the pubkey:

```
junctiond comet show-validator
```

## Creat file Validator.json ( nano validator.json )

```
    {
"pubkey": <validator-pub-key>,
"amount": "1000000amf",
"moniker": "<validator-name>",
"identity": "optional identity signature (ex. UPort or Keybase)",
"website": "validator's (optional) website",
"security": "validator's (optional) security contact email",
"details": "validator's (optional) details",
"commission-rate": "0.1",
"commission-max-rate": "0.2",
"commission-max-change-rate": "0.01",
"min-self-delegation": "1"
}
```

Finally, create the validator:

```
junctiond tx staking create-validator path/to/validator.json --from wallet --chain-id junction --fees 500amf
```

## Set max peer

```
sed -i -e "s/^indexer *=.*/indexer = \"null\"/" $HOME/.junction/config/config.toml
sed -i -e "s/^max_num_inbound_peers *=.*/max_num_inbound_peers = 300/" $HOME/.junction/config/config.toml
sed -i -e "s/^max_num_outbound_peers *=.*/max_num_outbound_peers = 300/" $HOME/.junction/config/config.toml
```

## 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/.junction/config/app.toml

```

## # Upgrade v0.2.0 at height 2383922

```
cd $HOME
wget -O junctiond https://github.com/airchains-network/junction/releases/download/v0.2.0/junctiond-linux-amd64
chmod +x junctiond
sudo mv $HOME/junctiond $(which junctiond)
sudo systemctl restart junctiond && sudo journalctl -u junctiond -f -o cat
```

## Done !

## # Detailed Guide to Setting Up a New Node on a VPS with an Existing Node

Create a New Directory for the New Node

```
mkdir -p $HOME/.new_node
```

## # Install ignite CLI

Download and install Ignite CLI.

```
wget https://github.com/ignite/cli/releases/download/v0.27.1/ignite_0.27.1_linux_amd64.tar.gz
chmod +x ignite_0.27.1_linux_amd64.tar.gz
tar -xvf ignite_0.27.1_linux_amd64.tar.gz
sudo mv ignite /usr/local/bin
ignite version

```

## # Download the `junctiond` Binary

```
wget https://github.com/airchains-network/junction/releases/download/v0.1.0/junctiond
chmod +x junctiond
sudo mv junctiond /usr/local/bin

```

## # Initialize the New Node

```
junctiond init <new_moniker> --home $HOME/.new_node
```

## # Update the Genesis File

```
wget https://github.com/airchains-network/junction/releases/download/v0.1.0/genesis.json
cp genesis.json $HOME/.new_node/config/genesis.json
```

## # Update the `config.toml` File

Modify `config.toml` to update `persistent_peers` and `minimum-gas-prices`

```
nano $HOME/.new_node/config/config.toml

```

Change the `persistent_peers` section to connect to peer nodes:

```
persistent_peers = "1f0eada58b83f32ac7ba0ff704e15732ae2a25c4@2a01:43456,62338fe5926b9f83b13c942bf619f37c009c11ea@195.26.246.86:63656,0fc70473e7ee84b77ebcb1c098d457379931bc0a@88.99.61.53:38656,2422f4e279ab6e59e7073f282745a9d0b01ab429@185.148.3.169:13756,246fea8a11c2040662ed327d340cfd0941d03e6d@38.242.243.237:43456,fe51d4777e7ad2b4d93c3a096761a31966c65c64@2a0a:26656,b27ec34e0e9fdfcfc970cec793cb3041e54f9dc6@109.199.101.235:43456,8800f4ec6793a1294c618689ffb0dd87e9af474a@217.76.52.67:26656,ab9b3585f9e9e8c9f661eebed4569d12638baed3@109.199.101.233:43456,e0d3fc3b251344629e51b96e0896a74b0a53c648@178.18.244.156:43456,28b73cacb42620fe1c64c93beaadb34982d52a06@128.140.65.68:26656,de2e7251667dee5de5eed98e54a58749fadd23d8@34.22.237.85:26656"
```

Update the minimum gas price:

```
sed -i 's|^minimum-gas-prices *=.*|minimum-gas-prices = "0.00025amf"|g' $HOME/.new_node/config/app.toml

```

## # Update `config.toml` with New Ports

Modify `config.toml` to set new ports for the new node.

```
[p2p]
laddr = "tcp://0.0.0.0:26658"  # Change P2P listen port

[rpc]
laddr = "tcp://0.0.0.0:26659"  # Change RPC listen port

```

## # 8. Configure the `systemd` Service

Create a new `systemd` service file to manage the new node.

```
sudo tee /etc/systemd/system/junctiond-new.service > /dev/null << EOF
[Unit]
Description=airchains node service for new node
After=network-online.target

[Service]
User=$USER
ExecStart=/usr/local/bin/junctiond start --home $HOME/.new_node
Restart=on-failure
RestartSec=10
LimitNOFILE=65535

[Install]
WantedBy=multi-user.target
EOF

sudo systemctl daemon-reload
sudo systemctl enable junctiond-new

```

## # 9 Start the New Node

Start the service for the new node and check the logs.

```
sudo systemctl start junctiond-new
sudo journalctl -u junctiond-new -f -o cat
```

## # 10 Check the New Ports

```
sudo netstat -tuln
```

## # 11 Check the Status of the New Node

Check the status and information of the new node.

```
junctiond status --home $HOME/.new_node
```

## # Summary

* **Create a new directory** for the new node.
* **Install Ignite CLI and `junctiond` binary**.
* **Initialize the new node** with a new moniker.
* **Update the `genesis.json` file** and configure `config.toml` with appropriate settings.
* **Create and configure a `systemd` service** for the new node.
* **Start the new node** and verify its status and ports.

## # Delete New\_node

```
# Dừng dịch vụ của node mới
sudo systemctl stop junctiond-new

# Xóa thư mục dữ liệu và cấu hình của node mới
rm -rf $HOME/.new_node

# Xóa file cấu hình dịch vụ systemd
sudo rm /etc/systemd/system/junctiond-new.service

# Tải lại các cấu hình systemd
sudo systemctl daemon-reload

# Xóa binary junctiond nếu không cần
sudo rm /usr/local/bin/junctiond

# Tắt và xóa dịch vụ khỏi danh sách systemd
sudo systemctl disable junctiond-new
sudo systemctl stop junctiond-new

# Kiểm tra các port để xác nhận rằng các cổng đã được giải phóng
sudo netstat -tuln

```

Snapshot (Option)

Setup aria2c

```
apt install aria2
```

Download snapshot

```
aria2c -x16 -s16 https://snapshots.moonbridge.team/testnet/airchains/snapshot_latest.tar.lz4
```

Extract File tar.lz4

```
lz4 -dc snapshot_latest.tar.lz4 | tar -x -C $HOME/.junction
```

VIỆT NAM

```
# Cài Đặt Các Công Cụ Cần Thiết
sudo apt update && sudo apt install lz4 aria2 -y

# Dừng Dịch Vụ và Xóa Dữ Liệu Cũ
sudo systemctl stop junctiond
cp $HOME/.junction/data/priv_validator_state.json $HOME/.junction/priv_validator_state.json.backup
rm -rf $HOME/.junction/data

# Tải Snapshot Mới Nhất
aria2c -x5 -s4 https://snapshots.moonbridge.team/testnet/airchains/snapshot_latest.tar.lz4

# Giải Nén Tệp Snapshot
lz4 -dc snapshot_latest.tar.lz4 | tar -x -C $HOME/.junction

# Khôi Phục Tệp `priv_validator_state.json`
mv $HOME/.junction/priv_validator_state.json.backup $HOME/.junction/data/priv_validator_state.json

# Xóa Tệp Snapshot Sau Khi Giải Nén
rm -f snapshot_latest.tar.lz4

# Khởi Động Lại Dịch Vụ và Kiểm Tra Nhật Ký
sudo systemctl start junctiond && sudo journalctl -u junctiond -f --no-hostname -o cat

```
