Auto installer without snapshot
source <(curl -s <https://raw.githubusercontent.com/zstake-xyz/test/refs/heads/main/0g_storage_installer.sh>)
Manual installer without snapshot
- Install
sudo apt-get update
sudo apt-get install clang cmake build-essential
curl --proto '=https' --tlsv1.2 -sSf <https://sh.rustup.rs> | sh
rm -r $HOME/0g-storage-node
git clone -b v0.8.2 <https://github.com/0glabs/0g-storage-node.git>
- Update
cd $HOME/0g-storage-node
git stash
git fetch --all --tags
git checkout 910b5af
git submodule update --init
cargo build --release
- Setup config.toml
rm -rf $HOME/0g-storage-node/run/config.toml
curl -o $HOME/0g-storage-node/run/config.toml <https://raw.githubusercontent.com/zstake-xyz/test/refs/heads/main/0g_storage_config.toml>
nano $HOME/0g-storage-node/run/config.toml
- ZGS Service create
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
- ZGS Service Restart
sudo systemctl daemon-reload && sudo systemctl enable zgs && sudo systemctl start zgs
- Log Check
tail -f ~/0g-storage-node/run/log/zgs.log.$(TZ=UTC date +%Y-%m-%d)
- Block Sync Check
source <(curl -s <https://raw.githubusercontent.com/zstake-xyz/test/refs/heads/main/zgs_test.sh>)