Zero Gravity

Services

A curated list of different services provided by EmberStake for 0G - ZeroGravity

Public Endpoints

Peer

EmberStake Peer

bf8f850598d3d52ee176296f07c10212e0d334ca@testnet-v2-0g-rpc.emberstake.xyz:34140

Address book

You can also download our nodes Address book. updates in realtime

This guide is intended for users who are setting up and running their nodes using our 0G-Dockerized repository

Stop the container and Run an ephemeral container

terminal
docker compose --profile node stop node
docker compose --profile node run --rm --entrypoint /bin/bash node

now you are inside the container, you can enter required commands to use snapshot

terminal
wget -O $HOME/.0gchain/config/addrbook.json https://testnet-v2-0g-snapshot.emberstake.xyz/addrbook.json

exit from the container with ctrl + D
Run the node container in the background

terminal
docker compose --profile node up -d node

Check logs

terminal
docker compose --profile node logs -f node

Use this guide if you are using systemd

terminal
wget -O $HOME/.0gchain/config/addrbook.json https://testnet-v2-0g-snapshot.emberstake.xyz/addrbook.json

Restart & Check logs

terminal
sudo systemctl restart 0gchaind && sudo journalctl -u 0gchaind -f --no-hostname -o cat

State Sync

To quickly sync your node with rest of network, you can our State Sync Snapshots.

This guide is intended for users who are setting up and running their nodes using our 0G-Dockerized repository

Stop the container and Run an ephemeral container

terminal
docker compose --profile node stop node
docker compose --profile node run --rm --entrypoint /bin/bash node

now you are inside the container, you can enter required commands to enable state sync

terminal
cp $HOME/.0gchain/data/priv_validator_state.json $HOME/.0gchain/priv_validator_state.json.backup
0gchaind tendermint unsafe-reset-all --home $HOME/.0gchain --keep-addr-book

STATE_SYNC_RPC=https://testnet-v2-0g-rpc.emberstake.xyz:443
STATE_SYNC_PEER=bf8f850598d3d52ee176296f07c10212e0d334ca@testnet-v2-0g-rpc.emberstake.xyz:34140
LATEST_HEIGHT=$(curl -s $STATE_SYNC_RPC/block | jq -r .result.block.header.height)
SYNC_BLOCK_HEIGHT=$(($LATEST_HEIGHT - 2000))
TRUST_HASH=$(curl -s "$STATE_SYNC_RPC/block?height=$SYNC_BLOCK_HEIGHT" | jq -r .result.block_id.hash)

echo -e "RPC:          $STATE_SYNC_RPC"
echo -e "Latest Block Height:  $LATEST_HEIGHT"
echo -e "Sync Block Height:    $SYNC_BLOCK_HEIGHT"
echo -e "Trust Hash:           $TRUST_HASH"

sed -i \
    -e "s|^enable *=.*|enable = true|" \
    -e "s|^rpc_servers *=.*|rpc_servers = \"$STATE_SYNC_RPC,$STATE_SYNC_RPC\"|" \
    -e "s|^trust_height *=.*|trust_height = $SYNC_BLOCK_HEIGHT|" \
    -e "s|^trust_hash *=.*|trust_hash = \"$TRUST_HASH\"|" \
    -e "s|^persistent_peers *=.*|persistent_peers = \"$STATE_SYNC_PEER\"|" \
    $HOME/.0gchain/config/config.toml

mkdir -p $HOME/.0gchain/data && mv $HOME/.0gchain/priv_validator_state.json.backup $HOME/.0gchain/data/priv_validator_state.json

exit from the container with ctrl + D
Run the node container in the background

terminal
docker compose --profile node up -d node

Check logs

terminal
docker compose --profile node logs -f node

Use this guide if you are using systemd

terminal
sudo systemctl stop 0gchain
cp $HOME/.0gchain/data/priv_validator_state.json $HOME/.0gchain/priv_validator_state.json.backup
0gchaind tendermint unsafe-reset-all --home $HOME/.0gchain --keep-addr-book

STATE_SYNC_RPC=https://testnet-v2-0g-rpc.emberstake.xyz:443
STATE_SYNC_PEER=bf8f850598d3d52ee176296f07c10212e0d334ca@testnet-v2-0g-rpc.emberstake.xyz:34140
LATEST_HEIGHT=$(curl -s $STATE_SYNC_RPC/block | jq -r .result.block.header.height)
SYNC_BLOCK_HEIGHT=$(($LATEST_HEIGHT - 2000))
TRUST_HASH=$(curl -s "$STATE_SYNC_RPC/block?height=$SYNC_BLOCK_HEIGHT" | jq -r .result.block_id.hash)

echo -e "RPC:          $STATE_SYNC_RPC"
echo -e "Latest Block Height:  $LATEST_HEIGHT"
echo -e "Sync Block Height:    $SYNC_BLOCK_HEIGHT"
echo -e "Trust Hash:           $TRUST_HASH"

sed -i \
    -e "s|^enable *=.*|enable = true|" \
    -e "s|^rpc_servers *=.*|rpc_servers = \"$STATE_SYNC_RPC,$STATE_SYNC_RPC\"|" \
    -e "s|^trust_height *=.*|trust_height = $SYNC_BLOCK_HEIGHT|" \
    -e "s|^trust_hash *=.*|trust_hash = \"$TRUST_HASH\"|" \
    -e "s|^persistent_peers *=.*|persistent_peers = \"$STATE_SYNC_PEER\"|" \
    $HOME/.0gchain/config/config.toml

mkdir -p $HOME/.0gchain/data && mv $HOME/.0gchain/priv_validator_state.json.backup $HOME/.0gchain/data/priv_validator_state.json

Check logs

terminal
sudo systemctl restart 0gchaind && sudo journalctl -u 0gchaind -f --no-hostname -o cat

Snapshot

Use our snapshot to bootstrap your node, updated every 6 hours

This guide is intended for users who are setting up and running their nodes using our 0G-Dockerized repository

Stop the container and Run an ephemeral container

terminal
docker compose --profile node stop node
docker compose --profile node run --rm --entrypoint /bin/bash node

now you are inside the container, you can enter required commands to use snapshot

terminal
cp $HOME/.0gchain/data/priv_validator_state.json $HOME/.0gchain/config/priv_validator_state.json.backup
rm -rf $HOME/.0gchain/data/*

curl https://testnet-v2-0g-snapshot.emberstake.xyz/latest.tar.lz4 | lz4 -dc - | tar -xf - -C $HOME/.0gchain

mv $HOME/.0gchain/config/priv_validator_state.json.backup $HOME/.0gchain/data/priv_validator_state.json

exit from the container with ctrl + D
Run the node container in the background

terminal
docker compose --profile node up -d node

Check logs

terminal
docker compose --profile node logs -f node

Use this guide if you are using systemd

terminal
sudo systemctl stop 0gchain
cp $HOME/.0gchain/data/priv_validator_state.json $HOME/.0gchain/priv_validator_state.json.backup
rm -rf $HOME/.0gchain/data

curl https://testnet-v2-0g-snapshot.emberstake.xyz/latest.tar.lz4 | lz4 -dc - | tar -xf - -C $HOME/.0gchain

mv $HOME/.0gchain/priv_validator_state.json.backup $HOME/.0gchain/data/priv_validator_state.json

Check logs

terminal
sudo systemctl restart 0gchaind && sudo journalctl -u 0gchaind -f --no-hostname -o cat