Ubuntu
22.04
CPU:
RAM:
8 cores
32GB
Storage:
500GB
Start a codespace from a template and get to developing with the power of a virtual machine in the cloud.
Official Documentation
Ubuntu
22.04
CPU:
RAM:
8 cores
32GB
Storage:
500GB
Version
v0.8.9+commit.e5eed63a
Binary:
v2.0.2Peers:
10
Node name
Port
Pruning
Pruning keep recent
Pruning interval
### Install dependenciessudo apt update && sudo apt upgrade -ysudo apt install git gcc make jq curl lz4 -y### Install gocd $HOMEVER=1.21.3wget -qO go.tar.gz https://golang.org/dl/go$VER.linux-amd64.tar.gzsudo rm -rf /usr/local/gosudo tar -C /usr/local -xzf go.tar.gzrm go.tar.gzecho "export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin" >> ~/.bashrcsource ~/.bashrcmkdir -p ~/go/bin### Download and set up 0gchain binariescd $HOMErm -rf galileo-usedwget -qO galileo.tar.gz https://github.com/0glabs/0gchain-NG/releases/download/v2.0.2/galileo-v2.0.2.tar.gztar -xzf galileo.tar.gzrm galileo.tar.gzmv galileo-v2.0.2 galileo-usedchmod +x galileo-used/bin/geth galileo-used/bin/0gchaindcp galileo-used/bin/geth ~/go/bin/cp galileo-used/bin/0gchaind ~/go/bin/### Config and init appmkdir -p ~/.0gchaind/0g-home/0gchaind-home/configmkdir -p ~/.0gchaind/0g-home/0gchaind-home/datacp -r galileo-used/0g-home ~/.0gchaind/geth init --datadir ~/.0gchaind/0g-home/geth-home galileo-used/genesis.json0gchaind init test --home ~/.0gchaind/tmpmv ~/.0gchaind/tmp/config/{node_key.json,priv_validator_key.json} ~/.0gchaind/0g-home/0gchaind-home/config/mv ~/.0gchaind/tmp/data/priv_validator_state.json ~/.0gchaind/0g-home/0gchaind-home/data/rm -rf ~/.0gchaind/tmp### Set seeds and peersSEEDS=ae64aa1ce5cdab5e63d12d0d1831e7091be192ae@0g-testnet-pruned-seed.stakeme.pro:47656PEERS=[email protected]:26656,[email protected]:46656,[email protected]:55656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:55656,[email protected]:26656,[email protected]:29656,[email protected]:47656sed -i -e "/^\[p2p\]/,/^\[/{s/^[[:space:]]*seeds *=.*/seeds = \"$SEEDS\"/}" -e "/^\[p2p\]/,/^\[/{s/^[[:space:]]*persistent_peers *=.*/persistent_peers = \"$PEERS\"/}" ~/.0gchaind/0g-home/0gchaind-home/config/config.toml### Set custom portssed -i "s/HTTPPort = .*/HTTPPort = 545/" galileo-used/geth-config.tomlsed -i "s/WSPort = .*/WSPort = 546/" galileo-used/geth-config.tomlsed -i "s/AuthPort = .*/AuthPort = 551/" galileo-used/geth-config.tomlsed -i "s/ListenAddr = .*/ListenAddr = \":303\"/" galileo-used/geth-config.tomlsed -i.bak -e "s%:26658%:658%;s%:26657%:657%;s%:6060%:060%;s%:26656%:656%;s%:26660%:660%" ~/.0gchaind/0g-home/0gchaind-home/config/config.tomlsed -i "s/address = \".*:3500\"/address = \"127.0.0.1:500\"/" ~/.0gchaind/0g-home/0gchaind-home/config/app.tomlsed -i "s/^rpc-dial-url *=.*/rpc-dial-url = \"http:\/\/localhost:551\"/" ~/.0gchaind/0g-home/0gchaind-home/config/app.toml### Disable indexingsed -i "s/^indexer *=.*/indexer = \"null\"/" ~/.0gchaind/0g-home/0gchaind-home/config/config.toml### Configure pruningsed -i "s/^pruning *=.*/pruning = \"custom\"/" ~/.0gchaind/0g-home/0gchaind-home/config/app.tomlsed -i "s/^pruning-keep-recent *=.*/pruning-keep-recent = \"\"/" ~/.0gchaind/0g-home/0gchaind-home/config/app.tomlsed -i "s/^pruning-interval *=.*/pruning-interval = \"\"/" ~/.0gchaind/0g-home/0gchaind-home/config/app.toml### Create symlinkln -sf ~/.0gchaind/0g-home/0gchaind-home/config/client.toml ~/.0gchaind/config/client.toml### Create 0ggeth servicesudo tee /etc/systemd/system/0ggeth.service > /dev/null <<EOF[Unit]Description=0gchain Geth Node ServiceAfter=network-online.target[Service]User=$USERWorkingDirectory=$HOME/galileo-usedExecStart=$HOME/go/bin/geth \--config $HOME/galileo-used/geth-config.toml \--datadir $HOME/.0gchaind/0g-home/geth-home \--networkid 16601 --http.port 545 \--ws.port 546 \--authrpc.port 551 \--bootnodes enode://de7b86d8ac452b1413983049c20eafa2ea0851a3219c2cc12649b971c1677bd83fe24c5331e078471e52a94d95e8cde84cb9d866574fec957124e57ac6056699@8.218.88.60:30303 \--port 303Restart=on-failureRestartSec=3LimitNOFILE=65535[Install]WantedBy=multi-user.targetEOF### Create 0gchaind servicesudo tee /etc/systemd/system/0gchaind.service > /dev/null <<EOF[Unit]Description=0gchaind Node ServiceAfter=network-online.target[Service]User=$USERWorkingDirectory=$HOME/galileo-usedExecStart=$(which 0gchaind) start \--rpc.laddr tcp://0.0.0.0:657 \--chaincfg.chain-spec devnet \--chaincfg.kzg.trusted-setup-path $HOME/galileo-used/kzg-trusted-setup.json \--chaincfg.engine.jwt-secret-path $HOME/galileo-used/jwt-secret.hex \--chaincfg.kzg.implementation=crate-crypto/go-kzg-4844 \--chaincfg.block-store-service.enabled \--chaincfg.node-api.enabled \--chaincfg.node-api.logging \--chaincfg.node-api.address 0.0.0.0:500 \--chaincfg.engine.rpc-dial-url http://localhost:551 \--pruning=nothing \--p2p.seeds [email protected]:26656 \--p2p.external_address $(wget -qO- eth0.me):656 \--home $HOME/.0gchaind/0g-home/0gchaind-homeRestart=on-failureRestartSec=3LimitNOFILE=65535[Install]WantedBy=multi-user.targetEOF### Reset and download snapshot# backup priv_validator_state.jsoncp $HOME/.0gchaind/0g-home/0gchaind-home/data/priv_validator_state.json $HOME/priv_validator_state.json.backup# remove old data and unpack 0g snapshotrm -rf $HOME/.0gchaind/0g-home/0gchaind-home/datacurl https://st-snap-1.stakeme.pro/og/testnet/pruned/cosmos_data_og_20250823_030001.tar.lz4 | lz4 -dc - | tar -xf - -C $HOME/.0gchaind/0g-home/0gchaind-home# restore priv_validator_state.jsonmv $HOME/priv_validator_state.json.backup $HOME/.0gchaind/0g-home/0gchaind-home/data/priv_validator_state.json# delete geth data and unpack Geth snapshotrm -rf $HOME/.0gchaind/0g-home/geth-home/geth/chaindatacurl https://st-snap-1.stakeme.pro/og/testnet/pruned/evm_chaindata_og_20250823_030001.tar.lz4 | lz4 -dc - | tar -xf - -C $HOME/.0gchaind/0g-home/geth-home/geth### Enable and start servicesudo systemctl restart 0ggethsleep 5mv ~/jwt-secret.hex ~/galileo-usedsudo systemctl restart 0gchaindsudo journalctl -u 0ggeth -u 0gchaind -f -o cat