"geth attach" - Geth Client Console

This section describes 'geth attach' command to attach as a client JavaScript console to a running Ethereum node.

To avoid data corruptions, on a single Ethereum database, we are not allowed to run two instances of Ethereum node server.

If you have one "geth" command running on the Ethereum database of C:\Users\herong\AppData\Roaming\Ethereum\geth as an Ethereum node server, and you try to start another Ethereum node server on the same database, you will get the following error:

C:\>c:\local\bin\geth --light
Maximum peer count                       ETH=0 LES=100 total=25
Fatal: Error starting protocol stack: datadir already used by another process

But you can run Geth in client mode to attach to the running Ethereum node server and provide a JavaScript console:

C:\herong>c:\local\bin\geth attach
Welcome to the Geth JavaScript console!

instance: Geth/v1.8.1-stable-1e67410e/windows-386/go1.9.2
 modules: admin:1.0 debug:1.0 eth:1.0 net:1.0 personal:1.0 rpc:1.0 
 txpool:1.0 web3:1.0

> eth.syncing
false
> eth.blockNumber
5160607
>

In your computer process list, you should see 2 "geth" running: one is the Ethereum node server, the other is the client console.

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

 Full Version in PDF/EPUB