Manual Installation
Official Documentation Recommended Hardware: 8 Cores, 64GB RAM, 1 TB of storage (NVME)
# install dependencies, if needed
sudo apt update && sudo apt upgrade -y
sudo apt install curl git wget htop tmux build-essential jq make lz4 gcc unzip -y
Node Name
# install go, if needed
cd $HOME
VER="1.21.3"
wget "https://golang.org/dl/go$VER.linux-amd64.tar.gz"
sudo rm -rf /usr/local/go
sudo tar -C /usr/local -xzf "go$VER.linux-amd64.tar.gz"
rm "go$VER.linux-amd64.tar.gz"
[ ! -f ~/.bash_profile ] && touch ~/.bash_profile
echo "export PATH=$PATH:/usr/local/go/bin:~/go/bin" >> ~/.bash_profile
source $HOME/.bash_profile
[ ! -d ~/go/bin ] && mkdir -p ~/go/bin
# set vars
echo "export MONIKER="test"" >> $HOME/.bash_profile
echo 'export PATH=$PATH:$HOME/galileo/bin' >> $HOME/.bash_profile
source $HOME/.bash_profile
# set binaries
cd $HOME
wget https://github.com/0glabs/0gchain-ng/releases/download/v1.0.1/galileo-v1.0.1.tar.gz
tar -xzvf galileo-v1.0.1.tar.gz -C $HOME
cd galileo
cp -r 0g-home/* $HOME/galileo/0g-home/
sudo chmod 777 ./bin/geth
sudo chmod 777 ./bin/0gchaind
# initialize Geth
./bin/geth init --datadir $HOME/galileo/0g-home/geth-home ./genesis.json
# Initialize 0gchaind
./bin/0gchaind init "$MONIKER" --home $HOME/galileo/tmp
# Copy node files to 0gchaind home directory
cp $HOME/galileo/tmp/data/priv_validator_state.json $HOME/galileo/0g-home/0gchaind-home/data/
cp $HOME/galileo/tmp/config/node_key.json $HOME/galileo/0g-home/0gchaind-home/config/
cp $HOME/galileo/tmp/config/priv_validator_key.json $HOME/galileo/0g-home/0gchaind-home/config/
# Create 0gchaind systemd file
sudo tee /etc/systemd/system/0gchaind.service > /dev/null <<EOF
[Unit]
Description=0gchaind Node Service
After=network-online.target
[Service]
User=$USER
ExecStart=/bin/bash -c 'cd ~/galileo && CHAIN_SPEC=devnet ./bin/0gchaind start \
--rpc.laddr tcp://0.0.0.0:26657 \
--beacon-kit.kzg.trusted-setup-path=kzg-trusted-setup.json \
--beacon-kit.engine.jwt-secret-path=jwt-secret.hex \
--beacon-kit.kzg.implementation=crate-crypto/go-kzg-4844 \
--beacon-kit.block-store-service.enabled \
--beacon-kit.node-api.enabled \
--beacon-kit.node-api.logging \
--beacon-kit.node-api.address 0.0.0.0:3500 \
--pruning=nothing \
--home $HOME/galileo/0g-home/0gchaind-home \
--p2p.external_address $(wget -qO- eth0.me):26656 \
--p2p.seeds [email protected]:26656'
Restart=always
RestartSec=3
LimitNOFILE=4096
[Install]
WantedBy=multi-user.target
EOF
# Create 0ggeth systemd file
sudo tee /etc/systemd/system/0ggeth.service > /dev/null <<EOF
[Unit]
Description=0g Geth Node Service
After=network-online.target
[Service]
User=$USER
ExecStart=/bin/bash -c 'cd ~/galileo && ./bin/geth --config geth-config.toml --datadir $HOME/galileo/0g-home/geth-home --networkid 80087'
Restart=always
RestartSec=3
LimitNOFILE=4096
[Install]
WantedBy=multi-user.target
EOF
# enable 0gchaind and 0ggeth services
sudo systemctl enable 0gchaind 0ggeth
sudo systemctl start 0gchaind 0ggeth
sudo journalctl -u 0gchaind -u 0ggeth -f --no-hostname -o cat
Firewall rules
Configure firewall rules:
sudo ufw allow 30303/tcp comment geth_p2p_port
sudo ufw allow 30303/udp comment geth_p2p_port
sudo ufw allow 26656/tcp comment 0g_p2p_port
Delete node
sudo systemctl stop 0gchaind 0ggeth
sudo systemctl disable 0gchaind 0ggeth
rm -rf $HOME/.0gchaind
sudo rm /etc/systemd/system/0gchaind.service /etc/systemd/system/0ggeth.service
sudo systemctl daemon-reload