Installation and configuration of the Ethereum client Geth
You can download
Geth latest stable version from Github
Geth installation is as simple as extracting geth.exe from your chosen OS.
The download page provides an installer as well as a zip file.
The installer puts geth into your PATH automatically. The zip file contains the command .exe files and can be used without installing.
- Download zip file
- Extract geth.exe from zip
- Open a command prompt
- Excute geth.exe
Brew is recommended to install
Geth on Mac OS:
$ brew update $ brew upgrade $ brew tap ethereum/ethereum $ brew install ethereum
On Linux, installing
Geth can be done using
$ sudo apt-get install software-properties-common $ sudo add-apt-repository -y ppa:ethereum/ethereum $ sudo apt-get update $ sudo apt-get install ethereum
RPC / IPC options
There are several command line options to run geth which can be found in their documentation.
But most importantly, RPC or IPC need to be enabled.
HTTP JSON-RPC can be started with the
$ geth --rpc
The default port (
8545) can be change as well as the listing address (
$ geth --rpc --rpcaddr <ip> --rpcport <portnumber>
If accessing the RPC from a browser,
$ geth --rpc --rpccorsdomain "http://localhost:3000"
The JSON RPC can also be started from the geth console using the
admin.startRPC(addr, port) command.
You might consider using our Creating a new Account using Geth Personal Api workbook to get a first feel of interacting with Geth using Nethereum.
Setting up your own testnet
There is already a preconfigured tesnet in Nethereum, which can be downloaded from github
The preconfigured testnet will start producing blocks inmediately so there is no need to start this manually, for more information check the Proof of Authority section below.
The chain keystore in the "devChain" folder contains the keys for the preconfigured account, which is also present in the genesis file "genesis_dev.json".
- Account :
- Private Key:
Proof of Authority
The consensus mechanism used in this testchain is Proof of Authority (PoA).
PoA consensus is reached by referring to a list of validators (referred to as authorities when they are linked to physical entities).
It does not depend on nodes solving arbitrarily difficult mathematical problems, but instead uses a set of "authorities" - nodes that are explicitly allowed to create new blocks and secure the blockchain. The chain has to be signed off by the majority of authorities, in which case it becomes a part of the permanent record. This makes it easier to maintain a private chain and keep the block issuers accountable.
For consortium setting there are no disadvantages of PoA network as compared to PoW. It is more secure (since an attacker with unwanted connection or hacked authority can not overwhelm a network potentially reverting all transactions), less computationally intensive (mining with difficulty which provides security requires lots of computation), more performant (Aura consensus provides lower transaction acceptance latency) and more predictable (blocks are issued at steady time intervals). PoA deployments are used by the enterprise and by the public (e.g. popular Kovan test network).
The current testchain it has been configured to produce blocks immediately, it has only one node with one validator account which it is unlocked when launching geth.
--unlock 0x12890d2cce102216644c59daE5baed380d84830c --password "pass.txt"
To start the chain you can use batch files or shell scripts, both of them will reset all the data when launched.
RD /S /Q %~dp0\devChain\geth\chainData RD /S /Q %~dp0\devChain\geth\dapp RD /S /Q %~dp0\devChain\geth\nodes del %~dp0\devchain\geth\nodekey geth --datadir=devChain init genesis_clique.json geth --nodiscover --rpc --datadir=devChain --rpccorsdomain "*" --mine --rpcapi "eth,web3,personal,net,miner,admin,debug" --unlock 0x12890d2cce102216644c59daE5baed380d84830c --password "pass.txt" --verbosity 0 console
Ensure to make your script executable:
chmod +x startgeth.sh
You can start the script from the directory where it sits:
rm -rf devChain/chainData rm -rf devChain/dapp rm -rf devChain/nodes rm -rf devchain/nodekey geth --datadir=devChain init genesis_clique.json geth --nodiscover --rpc --datadir=devChain --rpccorsdomain "*" --mine --rpcapi "eth,web3,personal,net,miner,admin,debug" --unlock 0x12890d2cce102216644c59daE5baed380d84830c --password "pass.txt" --verbosity 0 console
If you need more information on how to setup your chain you can use this blog post http://juan.blanco.ws/setup-your-own-tesnet-ethereum/