Storage Node - ZeroGravity
Learn how to run a Storage node on ZeroGravity
Prerequisites
You have completed Getting Started with ZeroGravity
Set environment variables
open .env
file with your editor
nano .env
modify the variables in .env
file under Storage configs section with your desired variables.
Important ones are:
STORAGE_MINER_PRIVATE_KEY
This requires a private key, without leading 0x, funded by testnet tokens from faucet. you have two ways to get this private key- create a fresh wallet on metamask, export private key and REMOVE LEADING 0X
- or use your validator account private key. export it by
0gchaind keys unsafe-export-eth-key $WALLET_NAME
STORAGE_ENR_ADDRESS
Your server public IP addressSTORAGE_BLOCKCHAIN_RPC_ENDPOINT
If you are running a node/validator using this compose file, you can directly connect to it by setting this tohttp://node:8545
, otherwise use a public RPC endpointSTORAGE_NETWORK_ENR_TCP_PORT
andSTORAGE_NETWORK_ENR_UDP_PORT
should both point to a valid, non busy port. they MUST BE SAME e.g.31234
Fund Wallet
you should fund the storage miner wallet with a0gi.
go to Faucet and get some funds. if you used the 0gchaind
binary to create this wallet,
you can get your evm address by running following command inside the node container, as explained here:
echo "0x$(0gchaind debug addr $(0gchaind keys show $WALLET_NAME -a) | grep hex | awk '{print $3}')"
Run Storage Node
docker compose --profile storage up -d storage-node
Check logs
docker compose --profile storage logs -f --since 1m storage-node
Upgrades
From v0.6.0 to v0.7.5
This is a non-breaking change, but there are some changes in default configs. so either manually update your config.toml file inside the container, or remove the config volume and let it be crated with new default configs.
update repository & images
git pull
docker compose --profile storage pull
remove storage container
docker compose --profile storage down
remove the storage node config volume
docker volume rm 0g-docker_storage_config
Follow steps at Run Storage Node