"geth console" - Ethereum Node Console

This section describes 'geth console' - Ethereum node console

Ethereum node console is a JavaScript console provided by Go Ethereum (Geth). It allows us to interact with the node with JavaScript commands.

Here is the help information on the "geth console" command:

C:\>\local\bin\geth help console
console [command options] [arguments...]

The Geth console is an interactive shell for the JavaScript runtime 
environment which exposes a node admin interface as well as the Dapp 
JavaScript API. See 
https://github.com/ethereum/go-ethereum/wiki/Javascipt-Console.

ETHEREUM OPTIONS:
  --identity value       Custom node name
  ... 
  
API AND CONSOLE OPTIONS:
  --rpccorsdomain value  Comma separated list of domains from which to 
       accept cross origin requests (browser enforced)
  --rpcvhosts value      Comma separated list of virtual hostnames from 
       which to accept requests (server enforced). Accepts '*' wildcard. 
       (default: "localhost")

  --rpc                  Enable the HTTP-RPC server
  --rpcaddr value        HTTP-RPC server listening interface (default: 
       "localhost")
  --rpcport value        HTTP-RPC server listening port (default: 8545)
  --rpcapi value         API's offered over the HTTP-RPC interface
  --ws                   Enable the WS-RPC server
  --wsaddr value         WS-RPC server listening interface (default: 
       "localhost")
  --wsport value         WS-RPC server listening port (default: 8546)
  --wsapi value          API's offered over the WS-RPC interface
  --wsorigins value      Origins from which to accept websockets requests
  --ipcdisable           Disable the IPC-RPC server
  --ipcpath              Filename for IPC socket/pipe within the datadir 
       (explicit paths escape it)
  --jspath loadScript    JavaScript root path for loadScript (default: ".")
  --exec value           Execute JavaScript statement
  --preload value        Comma separated list of JavaScript files to 
       preload into the console

...

When running "geth console" command, it's better to redirect errors to a log file to make the console easier to use:

C:\>\local\bin\geth console 2> ethereum.log

Welcome to the Geth JavaScript console!

instance: Geth/v1.8.1-stable-1e67410e/windows-386/go1.9.2
coinbase: 0x7b414a5a08f235f7d4e8e6eaa1484298c755b40f
at block: 0 (Wed, 31 Dec 1969 19:00:00 EST)
 datadir: C:\Users\herong\AppData\Roaming\Ethereum
 modules: admin:1.0 debug:1.0 eth:1.0 miner:1.0 net:1.0 personal:1.0 
 rpc:1.0 txpool:1.0 web3:1.0

> eth.syncing
{
  currentBlock: 3165668,
  highestBlock: 5157070,
  knownStates: 3180,
  pulledStates: 214,
  startingBlock: 3165125
}

> eth.syncing
{
  currentBlock: 3168287,
  highestBlock: 5157443,
  knownStates: 3180,
  pulledStates: 214,
  startingBlock: 3165125
}

Cool. I am able to interact with "eth" object of my Ethereum node. The "eth.syncing" child objet tells me that my node has downloaded 3168287 blocks so far. The total blocks to download is 5157443 at this moment.

Last update: 2018.

Table of Contents

 About This Book

 Introduction of Ethereum

 Ethereum Blockchain

 Ethereum Mist Wallet

geth - Go Ethereum

 What Is Go Ethererum (Geth)

 Go Ethererum (Geth) Commands

 "geth" - Start Ethereum Node

"geth console" - Ethereum Node Console

 "geth --light" - Ethereum Node Light Mode

 "geth attach" - Geth Client Console

 Run "geth" and "Ethereum Wallet" Separately

 Stop "geth" Ethereum Node

 Testnet - Ropsten network

 Private Ethereum Network

 64-Bit "geth" for Private Ethereum Network

 Private Network with Custom Genesis Block

 Transferring Funds between Ether Accounts

 MetaMask - Browser Based Ethereum Wallet

 Managing Ethereum Account

 ethereumfaucet.info - Mining Ether with Browser

 References

 PDF Printing Version