"geth --light" - Ethereum Node Light Mode

This section describes 'geth --light' - Ethereum node in light mode

If you can not wait for your Ethereum Node to be fully in sync with the Ethereum network or it consumes too much disk space to sync the entire Ethereum blockchain data, you can run Ethereum Node in light mode using the "geth --light" command option.

Running an Ethereum Node in light mode, it will download only block headers without actual transactions. To verify any transactions, it needs to talk to other Ethereum nodes on the network.

Here is how to start the Ethereum Node in light mode with the JavaScript console:

C:\>\local\bin\geth --light console 2>> ethereum.log
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
5160558

...

> eth.blockNumber
5160564

The output confirms that there is no full synchronization. But my "light" Ethereum node is able to catch up with the latest block headers!

If you check the log file, you should see:

Maximum peer count                       ETH=0 LES=100 total=25
Starting peer-to-peer node               
   instance=Geth/v1.8.1-stable-1e67410e/windows-386/go1.9.2
Allocated cache and file handles         database=
   C:\\Users\\herong\\AppData\\Roaming\\Ethereum\\geth\\lightchaindata 
Initialised chain configuration          
   config="{ChainID: 1 Homestead: 1150000 DAO: 1920000 DAOSupport: ...
Disk storage enabled for ethash caches   
   dir=C:\\Users\\herong\\AppData\\Roaming\\Ethereum\\geth\\ethash count=3
Disk storage enabled for ethash DAGs     
   dir=C:\\Users\\herong\\AppData\\Ethash                          count=2
Added trusted checkpoint                 
   chain=mainnet block=5046271 hash=04c211…ca1d63
Loaded most recent local header          
   number=0 hash=d4e567…cb8fa3 td=17179869184
Starting P2P networking 
UDP listener up                          
   net=enode://e305515af6c67f9808731d17827de54fc9f0d0614fedade88a022eb7...

Light client mode is an experimental feature 

RLPx listener up                         
   self="enode://e305515af6c67f9808731d17827de54fc9f0d0614fedade88a022e...
IPC endpoint opened                   url=\\\\.\\pipe\\geth.ipc
Block synchronisation started 
Generating ethash verification cache  epoch=168 percentage=36 
Generating ethash verification cache  epoch=168 percentage=73 
Generated ethash verification cache   epoch=168 elapsed=8.207s
Imported new block headers            count=192 number=5046463 hash=...
Imported new block headers            count=192 number=5046655 hash=...
Generating ethash verification cache  epoch=169 percentage=24 
Imported new block headers            count=2048 number=5048703 hash=...
Generating ethash verification cache  epoch=169 percentage=45 
Generating ethash verification cache  epoch=169 percentage=64 
Imported new block headers            count=2048 number=5050751 hash=...
Generating ethash verification cache  epoch=169 percentage=86 
Generated ethash verification cache   epoch=169 elapsed=14.71s
Imported new block headers            count=2048 number=5052799 hash=...
Imported new block headers            count=2048 number=5054847 hash=...
Imported new block headers            count=2048 number=5056895 hash=...
...

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