"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:\> \herong\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\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 Ethereum (Geth)

 Go Ethereum (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

 Deprecated: 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

 Using MetaMask Wallet

 Getting Free Ether on Test Networks

 Managing Ethereum Account

 Mining Ether with Your Computer

 Archived Tutorials

 References

 Full Version in PDF/EPUB