Installation
Dependencies Installation
# Install dependencies for building from source
sudo apt update
sudo apt install -y curl git jq lz4 build-essential
# Install Go
sudo rm -rf /usr/local/go
curl -L https://go.dev/dl/go1.21.6.linux-amd64.tar.gz | sudo tar -xzf - -C /usr/local
echo 'export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin' >> $HOME/.bash_profile
source .bash_profile
Node Installation
# Clone project repository
cd && rm -rf 0g-chain
git clone https://github.com/0glabs/0g-chain
cd 0g-chain
git checkout v0.1.0
# Build binary
make install
# Set node CLI configuration
0gchaind config chain-id zgtendermint_16600-1
0gchaind config keyring-backend test
0gchaind config node tcp://localhost:26657
# Initialize the node
0gchaind init "MONIKER" --chain-id zgtendermint_16600-1
# Download genesis and addrbook files
curl -L https://sync.rawakinode.tech/og/genesis.json > $HOME/.0gchain/config/genesis.json
curl -L https://sync.rawakinode.tech/og/addrbook.json > $HOME/.0gchain/config/addrbook.json
# Set seeds
sed -i -e 's|^seeds *=.*|seeds = "c4d619f6088cb0b24b4ab43a0510bf9251ab5d7f@54.241.167.190:26656,44d11d4ba92a01b520923f51632d2450984d5886@54.176.175.48:26656,f2693dd86766b5bf8fd6ab87e2e970d564d20aff@54.193.250.204:26656"|' $HOME/.0gchain/config/config.toml
# Set minimum gas price
sed -i -e 's|^minimum-gas-prices *=.*|minimum-gas-prices = "0.0025ua0gi"|' $HOME/.0gchain/config/app.toml
# Set pruning
sed -i \
-e 's|^pruning *=.*|pruning = "custom"|' \
-e 's|^pruning-keep-recent *=.*|pruning-keep-recent = "100"|' \
-e 's|^pruning-interval *=.*|pruning-interval = "17"|' \
$HOME/.0gchain/config/app.toml
# Create a service
sudo tee /etc/systemd/system/0gchaind.service > /dev/null << EOF
[Unit]
Description=0G node service
After=network-online.target
[Service]
User=$USER
ExecStart=$(which 0gchaind) start
Restart=on-failure
RestartSec=10
LimitNOFILE=65535
[Install]
WantedBy=multi-user.target
EOF
sudo systemctl daemon-reload
sudo systemctl enable 0gchaind.service
# Start the service and check the logs
sudo systemctl start 0gchaind.service
sudo journalctl -u 0gchaind.service -f --no-hostname -o cat
Last updated