This is the Storage Node Guide for 0G Labs’ Modular AI Chain Recommended specifications are below.
System Requirements
CPU : 4 cores
Memory : 16GB
Storage : 500GB / 1T NVMe SSD
Bandwidth : 500 Mbps for Download / Upload
NOTE
- In the code box that says (at once), copy and paste the entire code by clicking the Copy button in the upper right as shown in the picture below
# 1. System updates, installation of required environments
sudo apt-get update
sudo apt-get install clang cmake build-essential
sudo apt install cargo
sudo apt install pkg-config
# 2. install go (If it is the same node as the validator node, you can PASS)
wget https://go.dev/dl/go1.22.0.linux-amd64.tar.gz
sudo rm -rf /usr/local/go && sudo tar -C /usr/local -xzf go1.22.0.linux-amd64.tar.gz
export PATH=$PATH:/usr/local/go/bin
# 3. install rustup (When the selection for 1, 2, or 3 appears, just press Enter.)
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
# 4. disable your service before upgrade
sudo systemctl stop zgs.service
sudo systemctl disable zgs.service
sudo rm /etc/systemd/system/zgs.service
# 5. git clone & build
# if you first come start from here
git clone https://github.com/0glabs/0g-storage-node.git
# if you are not first come
cd $HOME/0g-storage-node
git stash
git fetch --all --tags
git checkout tags/v0.4.4
git submodule update --init
cargo build --release
if Finished shows on terminal, now you can move next step
# 6. setup variable with 0G-all-in tool
# install 0G-all-in tool
sudo wget -O $HOME/0G_all_in https://0g.service.nodebrand.xyz/0G/0G_all_in
chmod +x $HOME/0G_all_in
# type 7 to set variables
$HOME/0G_all_in
# you must do this step before next
source ~/.bash_profile
# type 8 to edit config.toml
$HOME/0G_all_in
# type 10 to compare config.toml and variable in bash_profile
$HOME/0G_all_in
# finally check all of your config.toml by manually
sudo nano $ZGS_HOME/run/config.toml
Type 7 to set Variables and check your variables (ALSO MANUALLY CHECK)
Type 8 to edit your config.toml file and **MUST CHECK YOUR VAR via MANUALLY**
# 7. Create Service File
sudo tee /etc/systemd/system/zgs.service > /dev/null <<EOF
[Unit]
Description=ZGS Node
After=network.target
[Service]
User=root
WorkingDirectory=$ZGS_HOME/run
ExecStart=$ZGS_HOME/target/release/zgs_node --config $ZGS_HOME/run/config.toml
Restart=on-failure
RestartSec=10
LimitNOFILE=65535
[Install]
WantedBy=multi-user.target
EOF
# 8. service execution
sudo systemctl daemon-reload && \
sudo systemctl enable zgs && \
sudo systemctl start zgs
# 9. check logs
# check your last log
tail -f $ZGS_HOME/run/log/zgs.log.$(TZ=UTC date +%Y-%m-%d)
# 10. You can check Your Validator's json-rpc or storage-node via 0G-all-in tool
$HOME/0G_all_in
# type 4 to check your validator json-rpc status
# type 9 to check your storage node's status
If you have below errors, your validator node doesn't have 595059 block's data
so you should edit "blockchain_rpc_endpoint" in config.toml to default (below list), or ask in storage node channel
http://54.241.167.190:8545
http://54.176.175.48:8545
http://54.193.250.204:8545
http://18.166.164.232:8545
or you should remove your /db/, /network/ directory
# edit your blockchain_rpc_endpoint to sync
sudo nano $ZGS_HOME/run/config.toml
# or remove your db, network directory
sudo rm -rf $ZGS_HOME/run/network/
sudo rm -rf $ZGS_HOME/run/db/
(not updated) make sure that your storage node is running correctly using the storage-client below.
2024.06.08 - [0g_Labs] - How to check your STORAGE NODE via CLI
'0g_Labs' 카테고리의 다른 글
0G-Useful-Command (0) | 2024.07.05 |
---|---|
0G Config & Guide list (0) | 2024.07.03 |
0G Validator Node Guide-with Cosmovisor (0) | 2024.06.28 |
How to check your STORAGE NODE via CLI (0) | 2024.06.08 |