-----Storage Nodes: Unlike Validator Nodes that focus on securing the blockchain itself, Storage Nodes focus on managing and serving data. They are the backbone of the network's data storage capabilities, ensuring persistence and availability for long-term data storage (e.g., training datasets, large AI models). By running a storage node, you'll contribute to the decentralized storage of 0G data, making it accessible and resilient.
-
Add 0G-Galileo-Testnet chain from here: https://docs.0g.ai/run-a-node/testnet-information
-
Take faucet: https://faucet.0g.ai/
sudo apt-get update && sudo apt-get upgrade -y
sudo apt install curl iptables build-essential git wget lz4 jq make cmake gcc nano automake autoconf tmux htop nvme-cli libgbm1 pkg-config libssl-dev libleveldb-dev tar clang bsdmainutils ncdu unzip libleveldb-dev screen ufw -y
- Install rustup
curl https://sh.rustup.rs -sSf | sh
source $HOME/.cargo/env
Check version
rustc --version
- Install go
wget https://go.dev/dl/go1.24.3.linux-amd64.tar.gz && \
sudo rm -rf /usr/local/go && \
sudo tar -C /usr/local -xzf go1.24.3.linux-amd64.tar.gz && \
rm go1.24.3.linux-amd64.tar.gz && \
echo 'export PATH=$PATH:/usr/local/go/bin' >> ~/.bashrc && \
source ~/.bashrc
check version
go version
git clone https://github.com/0glabs/0g-storage-node.git
cd 0g-storage-node && git checkout v1.0.0 && git submodule update --init
- Build in release mode
cargo build --release
rm -rf $HOME/0g-storage-node/run/config.toml
curl -o $HOME/0g-storage-node/run/config.toml https://raw.githubusercontent.com/Mayankgg01/0G-Storage-Node-Guide/main/config.toml
- Add Your Wallet's Private KEY in
config.toml
, ββDont Add 0X before the key:
-open and go to miner_key
and add your pvt key:
nano $HOME/0g-storage-node/run/config.toml
-
get rpc from here - https://www.astrostake.xyz/0g-status
-
Chooose any rpc and edit in the
config.toml
file
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
- Reload
sudo systemctl daemon-reload
- Enable
sudo systemctl enable zgs
- Start service
sudo systemctl start zgs
sudo systemctl status zgs
- check Full Logs
tail -f ~/0g-storage-node/run/log/zgs.log.$(TZ=UTC date +%Y-%m-%d)
- Check block & Sync process - Match to the latest block on explorer
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
sudo systemctl stop zgs
sudo systemctl disable zgs
sudo rm /etc/systemd/system/zgs.service
rm -rf $HOME/0g-storage-node
-
Explorer- (View your txs - Paste Your Address): https://chainscan-galileo.bangcode.id/ OR https://chainscan-galileo.0g.ai/
-
View Miner Details- (Add your wallet address at the end of the link): https://storagescan-galileo.0g.ai/miner/
DONE!!
-
So, For local PC All the process is same as VPS: You have to start from Pre-Requirements π
-
πNext Day process:
- Just Open your wsl/terminal and run
sudo systemctl restart zgs
The service/node will be start after that:
- βοΈ This Snapshot will help u to sync Faster & it will start from Block --
294440
π οΈ Installation Instructions
- Stop The Node & Delete flow db
sudo systemctl stop zgs
rm -rf $HOME/0g-storage-node/run/db/flow_db
- Download and extract the Flow db:
wget https://github.com/Mayankgg01/0G-Storage-Node-Guide/releases/download/v1.0/flow_db.tar.gz \
-O $HOME/0g-storage-node/run/db/flow_db.tar.gz && \
tar -xzvf $HOME/0g-storage-node/run/db/flow_db.tar.gz -C $HOME/0g-storage-node/run/db/
- Restart Your Service/Node
sudo systemctl restart zgs
βοΈDone: Your Node Will start Syncing From Block 294440
π
- If Your Vps storage got full, then u can follow these commands and instruction to Clear it & Do Again:
sudo systemctl stop zgs
sudo systemctl disable zgs
sudo rm /etc/systemd/system/zgs.service
rm -rf $HOME/0g-storage-node
-
After that Start From Clone the Repository
-
Dont Forget to Download Snapshot for faster sync: Snapshot
Doneβ βοΈ
π Join TG for more Updates: https://telegram.me/cryptogg
If U have any issue then open a issue on this repo or Dm me on TG~
Thank You! Happy Coding!π