Auto install

source <(curl -s <https://raw.githubusercontent.com/zstake-xyz/test/refs/heads/main/0g_kv_install.sh>) # kv install

Manual install

  1. Install
sudo apt update && sudo apt upgrade -y
git clone -b v1.4.0 <https://github.com/0glabs/0g-storage-kv.git>
  1. Update
cd $HOME/0g-storage-kv
git stash
git fetch --all --tags
git checkout 1e7c207 
git submodule update --init
cargo build --release
  1. Setup config.toml
rm -rf $HOME/0g-storage-kv/run/config.toml
curl -o $HOME/0g-storage-kv/run/config.toml <https://raw.githubusercontent.com/zstake-xyz/test/main/0g_kv_config.toml>
  1. ZGS KV Service create
sudo tee /etc/systemd/system/0gkv.service > /dev/null <<EOF
[Unit]
Description=0G-KV Node
After=network.target

[Service]
User=root
WorkingDirectory=/root/0g-storage-kv/run
ExecStart=/root/0g-storage-kv/target/release/zgs_kv --config /root/0g-storage-kv/run/config.toml
Restart=always
RestartSec=10
LimitNOFILE=65535
StandardOutput=journal
StandardError=journal
SyslogIdentifier=zgs_kv

[Install]
WantedBy=multi-user.target
EOF
  1. ZGS KV Service Restart
sudo systemctl daemon-reload && sudo systemctl enable 0gkv && sudo systemctl start 0gkv
  1. Log Check
sudo journalctl -u 0gkv -f -o cat