Setup Ethereum development node in 5 minutes.

Ethereum nodes

1. Download and setup Geth.

~ tar zxvf <your-file-name>.tar.gz

2. Create new Ethereum etherbase account.

~ mkdir FirstEthBlockchain
./<extracted-geth-folder>/geth --datadir ./FirstEthBlockchain account new
./geth-linux-amd64–1.8.17–8bbe7207/geth --datadir ./FirstEthBlockchain account new INFO [10–23|19:41:25.141] Maximum peer count ETH=25 LES=0 total=25 
Your new account is locked with a password. Please give a password. Do not forget this password.
Passphrase:
Repeat passphrase:
Address: {c7c7d647cf3e4f1b072422c0ab5120fe810ee3b2}

3. Create genesis file. Initialize blockchain.

{
"config": {
"chainId": 1907,
"homesteadBlock": 0,
"eip155Block": 0,
"eip158Block": 0
},
"difficulty": "10",
"gasLimit": "2100000",
"alloc": {},
"coinbase": "c7c7d647cf3e4f1b072422c0ab5120fe810ee3b2"
}
./<extracted-geth-folder>/geth --datadir ./FirstEthBlockchain init ./FirstEthBlockchain/genesis.json
./geth-linux-amd64–1.8.17–8bbe7207/geth --datadir FirstEthBlockchain init FirstEthBlockchain/genesis.jsonINFO [10-23|19:11:48.764] Maximum peer count                       ETH=25 LES=0 total=25 
INFO [10-23|19:11:48.764] Allocated cache and file handles database=/home/w/Downloads/FirstEthBlockchain/geth/chaindata cache=16 handles=16
INFO [10-23|19:11:48.777] Writing custom genesis block
INFO [10-23|19:11:48.777] Persisted trie from memory database nodes=0 size=0.00B time=4.777µs gcnodes=0 gcsize=0.00B gctime=0s livenodes=1 livesize=0.00B
INFO [10-23|19:11:48.777] Successfully wrote genesis state database=chaindata hash=357b5e…1b20b9
INFO [10-23|19:11:48.778] Allocated cache and file handles database=/home/w/Downloads/FirstEthBlockchain/geth/lightchaindata cache=16 handles=16
INFO [10-23|19:11:48.795] Writing custom genesis block
INFO [10-23|19:11:48.795] Persisted trie from memory database nodes=0 size=0.00B time=5.114µs gcnodes=0 gcsize=0.00B gctime=0s livenodes=1 livesize=0.00B
INFO [10-23|19:11:48.796] Successfully wrote genesis state database=lightchaindata hash=357b5e…1b20b9

4. Start Ethereum node.

./<extracted-geth-folder>/geth --rpc --rpcaddr localhost --rpcport 6666 --rpcapi "personal,eth,web3,net" --datadir ./FirstEthBlockchain console
./geth-linux-amd64–1.8.17–8bbe7207/geth --rpc --rpcaddr localhost --rpcport 6666 --rpcapi "personal,eth,web3,net" --datadir ./FirstEthBlockchain console INFO [10-23|19:49:35.997] Maximum peer count                       ETH=25 LES=0 total=25 
INFO [10-23|19:49:35.998] Starting peer-to-peer node instance=Geth/v1.8.17-stable-8bbe7207/linux-amd64/go1.11.1
INFO [10-23|19:49:35.998] Allocated cache and file handles database=/home/w/Downloads/FirstEthBlockchain/geth/chaindata cache=768 handles=1024
INFO [10-23|19:49:36.021] Initialised chain configuration config="{ChainID: 1907 Homestead: 0 DAO: <nil> DAOSupport: false EIP150: <nil> EIP155: 0 EIP158: 0 Byzantium: <nil> Constantinople: <nil> Engine: unknown}"
INFO [10-23|19:49:36.022] Disk storage enabled for ethash caches dir=/home/w/Downloads/FirstEthBlockchain/geth/ethash count=3
INFO [10-23|19:49:36.022] Disk storage enabled for ethash DAGs dir=/home/w/.ethash count=2
INFO [10-23|19:49:36.022] Initialising Ethereum protocol versions="[63 62]" network=1
INFO [10-23|19:49:36.022] Loaded most recent local header number=0 hash=357b5e…1b20b9 td=10 age=49y6mo1w
INFO [10-23|19:49:36.022] Loaded most recent local full block number=0 hash=357b5e…1b20b9 td=10 age=49y6mo1w
INFO [10-23|19:49:36.022] Loaded most recent local fast block number=0 hash=357b5e…1b20b9 td=10 age=49y6mo1w
INFO [10-23|19:49:36.022] Regenerated local transaction journal transactions=0 accounts=0
INFO [10-23|19:49:36.022] Starting P2P networking
INFO [10-23|19:49:38.188] UDP listener up self=enode://b9e92c81cc46c89924e7f46c23dc6f78a088a130cf1dd5806637af8b43c2c5dab6eb770139828c2a7c5fce5e4940772f9b3b1a95367c1cd43e672dc479678f16@62.87.191.226:30303
INFO [10-23|19:49:38.188] RLPx listener up self=enode://b9e92c81cc46c89924e7f46c23dc6f78a088a130cf1dd5806637af8b43c2c5dab6eb770139828c2a7c5fce5e4940772f9b3b1a95367c1cd43e672dc479678f16@62.87.191.226:30303
INFO [10-23|19:49:38.193] IPC endpoint opened url=/home/w/Downloads/FirstEthBlockchain/geth.ipc
INFO [10-23|19:49:38.195] HTTP endpoint opened url=http://localhost:6666 cors= vhosts=localhost
Welcome to the Geth JavaScript console!

instance: Geth/v1.8.17-stable-8bbe7207/linux-amd64/go1.11.1
INFO [10-23|19:49:38.290] Etherbase automatically configured address=0xc7c7D647CF3e4F1b072422c0AB5120fe810Ee3b2
coinbase: 0xc7c7d647cf3e4f1b072422c0ab5120fe810ee3b2
at block: 0 (Thu, 01 Jan 1970 01:00:00 CET)
datadir: /home/w/Downloads/FirstEthBlockchain
modules: admin:1.0 debug:1.0 eth:1.0 ethash:1.0 miner:1.0 net:1.0 personal:1.0 rpc:1.0 txpool:1.0 web3:1.0

>

5. Verify and test the blockchain.

> eth.getBalance(eth.coinbase)
0
> miner.start()INFO [10-23|19:50:14.286] Updated mining threads                   threads=8 
INFO [10-23|19:50:14.286] Transaction pool price threshold updated price=1000000000
null
> INFO [10-23|19:50:14.287] Commit new mining work number=1 sealhash=6a7718…cc09c0 uncles=0 txs=0 gas=0 fees=0 elapsed=422.921µs
INFO [10-23|19:50:18.778] Successfully sealed new block number=1 sealhash=6a7718…cc09c0 hash=3cbd10…192cbd elapsed=4.491s
INFO [10-23|19:50:18.778] 🔨 mined potential block number=1 hash=3cbd10…192cbd
INFO [10-23|19:50:18.778] Commit new mining work number=2 sealhash=c46033…8e3acd uncles=0 txs=0 gas=0 fees=0 elapsed=124.783µs
INFO [10-23|19:50:19.480] Successfully sealed new block number=2 sealhash=c46033…8e3acd hash=2508d3…ef2775 elapsed=702.267ms
INFO [10-23|19:50:19.480] 🔨 mined potential block number=2 hash=2508d3…ef2775
INFO [10-23|19:50:19.480] Commit new mining work number=3 sealhash=32ed88…3efbfb uncles=0 txs=0 gas=0 fees=0 elapsed=106.819µs
INFO [10-23|19:50:19.492] Successfully sealed new block number=3 sealhash=32ed88…3efbfb hash=616d95…ea81ad elapsed=11.744ms
INFO [10-23|19:50:19.492] 🔨 mined potential block number=3 hash=616d95…ea81ad
INFO [10-23|19:50:19.492] Commit new mining work number=4 sealhash=25afba…e45d01 uncles=0 txs=0 gas=0 fees=0 elapsed=142.264µs
INFO [10-23|19:50:20.028] Successfully sealed new block number=4 sealhash=25afba…e45d01 hash=ea8fa1…2ded23 elapsed=535.337ms
INFO [10-23|19:50:20.028] 🔨 mined potential block number=4 hash=ea8fa1…2ded23
INFO [10-23|19:50:20.028] Commit new mining work number=5 sealhash=1b2621…c0e459 uncles=0 txs=0 gas=0 fees=0 elapsed=108.61µs
>
> miner.stop()
> eth.getBalance(eth.coinbase) 
20000000000000000000

6. Test the RPC API.

~ curl --data-binary '{"jsonrpc":"2.0","id":"curltext","method":"eth_getBalance","params":["0xc7c7d647cf3e4f1b072422c0ab5120fe810ee3b2","latest"]}' -H 'content-type:application/json;' http://localhost:6666 -vvvv* Rebuilt URL to: http://localhost:6666/ 
* Trying ::1...
* TCP_NODELAY set
* connect to ::1 port 6666 failed: Connection refused
* Trying 127.0.0.1...
* TCP_NODELAY set
* Connected to localhost (127.0.0.1) port 6666 (#0)
> POST / HTTP/1.1
> Host: localhost:6666
> User-Agent: curl/7.60.0
> Accept: */*
> content-type:application/json;
> Content-Length: 124
>
* upload completely sent off: 124 out of 124 bytes
< HTTP/1.1 200 OK
< Content-Type: application/json
< Date: Wed, 24 Oct 2018 07:11:17 GMT
< Content-Length: 49
<
{"jsonrpc":"2.0","id":"curltext","result":"0x2fb474098f67c0000"}
* Connection #0 to host localhost left intact

Summary

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store