> 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/0chain-validator-vietnamese.md).

# 0chain validator ( vietnamese )

### 1. Tải và giải nén galileo-v1.2.1

```bash
bashSao chépChỉnh sửacd $HOME
rm -rf galileo
wget "https://0g.j-node.net/testnet/galileo-v1.2.1.zip"
unzip galileo-v1.2.1.zip
mv galileo-v1.2.1 galileo
```

***

### 2. Phân quyền chạy cho các file nhị phân

```bash
bashSao chépChỉnh sửasudo chmod 777 $HOME/galileo/bin/geth
sudo chmod 777 $HOME/galileo/bin/0gchaind
```

***

### 3. Chỉ copy binary `0gchaind` vào thư mục Go bin để tiện gọi

```bash
bashSao chépChỉnh sửamkdir -p $HOME/go/bin
cp $HOME/galileo/bin/0gchaind $HOME/go/bin/0gchaind
```

*Lưu ý: **Không copy**\*\* ****`geth`**** \*\***để tránh ghi đè node Story**.*

***

### 4. Nạp lại cấu hình shell và kiểm tra phiên bản

```bash
bashSao chépChỉnh sửasource $HOME/.bash_profile
geth version         # kiểm tra geth hiện tại đang dùng (Story)
0gchaind version     # kiểm tra 0gchaind đã copy
```

***

### 5. Khai báo biến môi trường cho node galileo

```bash
bashSao chépChỉnh sửaecho "export WALLET='YOUR_WALLET_NAME'" >> $HOME/.bash_profile
echo "export MONIKER='YOUR_NODE_NAME'" >> $HOME/.bash_profile
echo "export OG_PORT='11'" >> $HOME/.bash_profile
source $HOME/.bash_profile
```

*Thay `YOUR_WALLET_NAME` và `YOUR_NODE_NAME` bằng giá trị thực.*

***

### 6. Chuẩn bị thư mục dữ liệu cho node

```bash
bashSao chépChỉnh sửamkdir -p $HOME/.0gchaind
cp -r $HOME/galileo/0g-home $HOME/.0gchaind
```

***

### 7. Khởi tạo Geth cho galileo node (lưu ý chạy geth bằng đường dẫn tuyệt đối)

```bash
bashSao chépChỉnh sửa$HOME/galileo/bin/geth init --datadir $HOME/.0gchaind/0g-home/geth-home $HOME/galileo/genesis.json
```

***

### 8. Khởi tạo 0gchaind, copy file config và validator key

```bash
bashSao chépChỉnh sửa0gchaind init "$MONIKER" --home $HOME/.0gchaind/tmp
cp $HOME/.0gchaind/tmp/data/priv_validator_state.json $HOME/.0gchaind/0g-home/0gchaind-home/data/
cp $HOME/.0gchaind/tmp/config/node_key.json $HOME/.0gchaind/0g-home/0gchaind-home/config/
cp $HOME/.0gchaind/tmp/config/priv_validator_key.json $HOME/.0gchaind/0g-home/0gchaind-home/config/
rm -rf $HOME/.0gchaind/tmp
```

***

### 9. Cấu hình node (moniker, chain-id, keyring-backend, app, pruning, indexer)

```bash
bashSao chépChỉnh sửased -i -e "s/^moniker *=.*/moniker = \"$MONIKER\"/" $HOME/.0gchaind/0g-home/0gchaind-home/config/config.toml

sed -i -e "s|^chain-id *=.*|chain-id = \"0gchain-16601\"|" $HOME/.0gchaind/0g-home/0gchaind-home/config/client.toml

sed -i -e "s|^keyring-backend *=.*|keyring-backend = \"os\"|" $HOME/.0gchaind/0g-home/0gchaind-home/config/client.toml

sed -i 's/beacon-kit/chaincfg/g' $HOME/.0gchaind/0g-home/0gchaind-home/config/app.toml

sed -i 's/minimum-gas-prices = ".*"/minimum-gas-prices = "0.00252ua0gi"/' $HOME/.0gchaind/0g-home/0gchaind-home/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 = "50"|' \
  $HOME/.0gchaind/0g-home/0gchaind-home/config/app.toml

sed -i -e "s/^indexer *=.*/indexer = \"null\"/" $HOME/.0gchaind/0g-home/0gchaind-home/config/config.toml
```

***

### 10. Cấu hình port geth (theo biến OG\_PORT) — chỉnh config geth trong galileo

```bash
bashSao chépChỉnh sửased -i "s/HTTPPort = .*/HTTPPort = ${OG_PORT}545/" $HOME/galileo/geth-config.toml
sed -i "s/WSPort = .*/WSPort = ${OG_PORT}546/" $HOME/galileo/geth-config.toml
sed -i "s/AuthPort = .*/AuthPort = ${OG_PORT}551/" $HOME/galileo/geth-config.toml
sed -i "s/ListenAddr = .*/ListenAddr = \":${OG_PORT}303\"/" $HOME/galileo/geth-config.toml
sed -i "s/^# *Port = .*/# Port = ${OG_PORT}901/" $HOME/galileo/geth-config.toml
sed -i "s/^# *InfluxDBEndpoint = .*/# InfluxDBEndpoint = \"http:\/\/localhost:${OG_PORT}086\"/" $HOME/galileo/geth-config.toml
```

***

### 11. Cấu hình port cho 0gchain

```bash
bashSao chépChỉnh sửased -i.bak -e "s%:26658%:${OG_PORT}658%g;
s%:26657%:${OG_PORT}657%g;
s%:6060%:${OG_PORT}060%g;
s%:26656%:${OG_PORT}656%g;
s%:26660%:${OG_PORT}660%g" $HOME/.0gchaind/0g-home/0gchaind-home/config/config.toml

sed -i.bak -e "s%:26657%:${OG_PORT}657%g" $HOME/.0gchaind/0g-home/0gchaind-home/config/client.toml
```

***

### 12. Thiết lập peers cho node

```bash
bashSao chépChỉnh sửaPEERS="77ba5d2343c2e90ca5b6e67e5b717ea2f0393118@149.5.246.183:47656,2555483dd53741deaab216ade559e079a345d6e2@89.58.12.214:26656,21512ea2410024fdb4d6523d59daec9b03d59170@195.7.4.42:26656,44a4607f780e4496d3761865faf8dd31723b5d8c@149.50.116.116:14656,f6e411f0cae200ea7f1838ad3901b7725c56b524@67.213.220.97:26656,3135590a798edc3a4e5910657ea29db6c52a02ef@62.171.176.82:26656,a4f2aaf24dbd5786852bcf6a2d5c7159c44e6381@8.218.241.139:26656,4c54827abea7b88b8fa1e97deedddc34a9da5caa@34.32.107.14:47656,2200635c5b2b5c5e744447bcd5d4d36aeceee598@84.247.180.28:12656,2728a1ffac61d19619d4f0f132dbdfb43f6eec8a@38.242.157.26:26656,15d7ae20e597205a18ddd67e79dfed940c42a180@158.220.107.39:26656,b6a9c1934f172d2b88b5585b828712a0a26ced7f@152.53.121.15:26656,930df7a3409452dc001007c6f4fed2981bdaf184@173.212.200.173:26656,4aec1ac9916bc914ea18ae6e65cd7471c7db8f09@35.240.231.223:26656,29811975689830c7053711560d3c27c994fa86c7@65.108.236.99:26656,c442324089
```


---

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

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.validator247.com/0chain-validator-vietnamese.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
