All of the alias commands have been defined as aliases in ~/.bashrc wheninstalling Geth.
geth.service
geth-log# View the geth.service logsgeth-start# Start the geth.servicegeth-stop# Stop the geth.servicegeth-restart# Restart the geth.servicegeth-status# View the status of the geth.servicegeth-version# Check the version of Geth in usegeth-enable# Enable the geth.servicegeth-disable# Disable the geth.servicegeth-delete-data# Delete all Geth chain datageth-config# Open the /etc/systemd/system/geth.service in vimdaemon-reload# Reload any changes made to the geth.service
Geth Direct Queries
To make this easier, these commands can be executed directly from the command line without attaching the JS console.
geth-blockNumbergeth-peerCountgeth-nodeInfo
Geth JavaScript Console
Attach to the Geth JavaScript console.
geth-attach
Console commands.
eth.syncing // Check if Geth is syncingeth.blockNumber // Show the current block numbereth.getTransaction("0x000...."// Get details of a specific transactioneth.syncing.highestBlock -eth.syncing.currentBlock // Distance remaining to syncnet.listening // Report whether the Geth node is listening for inbound requests
net.peerCount // Show number of active peersadmin.peers // Show info about all peersadmin.peers[0] // Show info about specific peeradmin.nodeInfo // Show info about your own nodeadmin.peers.map((el) => el.network.inbound) // You should see both true and false values meaning that your node is discoverable in the P2P network. If youβre seeing only false, you probably did not publicly expose the TCP and UDP port
blockInfo() // Show information about the current blockblockInfo().totalDifficulty // Show the current block total difficulty