For the complete documentation index, see llms.txt. This page is also available as Markdown.

Installation

Geth client installation guide.

Create Aliases

These aliases make interacting with Geth on the command line easier.

echo "alias geth-log='journalctl -f -u geth.service -o cat | ccze -A'" >> ~/.bashrc
echo "alias geth-start='sudo systemctl start geth.service'" >> ~/.bashrc
echo "alias geth-stop='sudo systemctl stop geth.service'" >> ~/.bashrc
echo "alias geth-restart='sudo systemctl restart geth.service'" >> ~/.bashrc
echo "alias geth-status='sudo systemctl status geth.service'" >> ~/.bashrc
echo "alias geth-version='sudo /usr/local/bin/geth --version'" >> ~/.bashrc
echo "alias geth-config='sudo vim /etc/systemd/system/geth.service'" >> ~/.bashrc
echo "alias geth-enable='sudo systemctl enable geth.service'" >> ~/.bashrc
echo "alias geth-disable='sudo systemctl disable geth.service'" >> ~/.bashrc
echo "alias geth-delete-data='sudo rm -rf /var/lib/goethereum/geth'" >> ~/.bashrc
echo "alias geth-update='~/geth-update.sh'" >> ~/.bashrc

echo "alias geth-attach='sudo geth attach --preload ~/geth-console-script.js /var/lib/goethereum/geth.ipc'" >> ~/.bashrc
echo "alias geth-blockNumber='sudo geth --exec \"eth.blockNumber\" attach /var/lib/goethereum/geth.ipc'" >> ~/.bashrc
echo "alias geth-peerCount='sudo geth --exec \"net.peerCount\" attach /var/lib/goethereum/geth.ipc'" >> ~/.bashrc
echo "alias geth-nodeInfo='sudo geth --exec \"admin.nodeInfo\" attach /var/lib/goethereum/geth.ipc'" >> ~/.bashrc

source ~/.bashrc

Firewall Configuration

Configure the firewall using generic Execution client UFW settings:Execution Clients

Go - Install

Find the latest version of Go here: https://go.dev/doc/install

Geth - Install

Build the latest version of Geth.

Move the compiled Geth build to a new directory.

Create Geth user and directory.

JWT Secret is now shared between all clients on the same machine:Create JWT Secret

Geth - Configure Service

Set permissions.

Configure Execution Service Environment Variables.

Configure Geth service using the command line flags.

/usr/local/bin/geth

Starts Geth.

--mainnet

Specifies mainnet as the target network.

--syncmode

  • full very/impossibly slow on Mainnet due to Shanghai DDOS attacks.

  • fast used to be the best option, but is now slower than snap.

  • snap the current fastest way to sync.

--port

Network listening port (TCP).

--discovery.port

UDP port for P2P discovery.

--http

Enable the HTTP-RPC server.

--datadir

Data directory for the databases and keystore.

--metrics

Enable metrics collection and reporting.

--metrics.expensive

Enable expensive metrics collection and reporting.

--pprof

Enable the pprof HTTP server.

Required for metrics to work properly.

--http.api

API's offered over the HTTP-RPC interface.

--authrpc.jwtsecret

--maxpeers

Maximum number of network peers.

  • Network disabled if set to 0.

  • Default: 50.

--cache

Megabytes of memory allocated to internal caching.

  • Default = 4096 mainnet full node and 128 light mode.

--bootnodes

Comma separated enode URLs for P2P discovery bootstrap.

Start the service and check it's working as expected.

Geth - Command Aliases

Geth - Update Scripts

Create Geth update script.

Make the script executable.

Geth - Configure JavaScript Console

Use --preload to load pre-written commands and functions stored in a script file.

Check Geth details by attaching to the JavaScript console

Geth JavaScript console commands.

Last updated