This howto is made to show you how to run an Ethereum node. To run an Ethereum node we need the
geth
program to start and wait for the network synchronization – our Ethereum node will receive all the blockchains of the network!
After a successful Ethereum network synchronization we can send and receive coins securely ourselves! No other online service offers us secure sending and receiving of transcations and creation of wallet, the only way a crypto user could be absolutely sure the private key is seen only from him and is generated on his server is to become part of the Ethereum network and create your wallet with “geth” manually by the user himself.
And also be warned DO NOT use insecure sources when:
- installing Ubuntu, install it from a cd/dvd/usb downloaded from the official Ubuntu site here.
- installing all the needed dependencies from official sources only, not recommended the PPA reposigories, neither!
- install yourself the “geth” program, which will create an Ethereum node and after network synchronization could be used to create an Ethereum node.
Three simple rules could almost eliminate leaking your private key to hackers, which in blockchain world means losing your money…
And before start the installation a performance advice do not attempt to run an Ethereum node in a hard disk –
USE SSD
If you use a hard disk even in RAID configuration it could take several days for network synchronization and probably your machine will be useless during the synchronization.
So here are the steps to create from a scratch an Ethereum node:
STEP 1) Install Ubuntu 16 – our howto will be available soon here.
STEP 2) Building from source an Ethereum node
Check out our howto“Building from source an Ethereum node under Ubuntu 16 LTS”.
STEP 3) Start the Ethereum node
if you have followed the howto in STEP 2) you probably have “geth” installed in “~/go-ethereum/build/bin”, so first running it with:
ubuntu@srv.local:~/go-ethereum/build/bin$ ./geth --rpc --fast --cache=8144 &> ./geth.log
STEP 3) Wait for the blockchain network synchronization
When you run “geth” it will check the current state of the network and the current state of your Ethereum node, so no matter it is started for the first time or not a network synchronization is needed, your node need to be synchronized with the Ethereum network to be used for all kind of actions in the network (create a wallet, transfer funds and more).
Here is the output of just started Ethereum node:
INFO [02-27|19:14:02] Maximum peer count ETH=25 LES=0 total=25 INFO [02-27|19:14:02] Starting peer-to-peer node instance=Geth/v1.8.2-unstable-b574b577/linux-amd64/go1.9.4 INFO [02-27|19:14:02] Allocated cache and file handles database=/home/ubuntu/.ethereum/geth/chaindata cache=6108 handles=512 INFO [02-27|19:14:02] Writing default main-net genesis block INFO [02-27|19:14:03] Persisted trie from memory database nodes=12356 size=2.34mB time=49.406185ms gcnodes=0 gcsize=0.00B gctime=0s livenodes=1 livesize=0.00B INFO [02-27|19:14:03] Initialised chain configuration config="{ChainID: 1 Homestead: 1150000 DAO: 1920000 DAOSupport: true EIP150: 2463000 EIP155: 2675000 EIP158: 2675000 Byzantium: 4370000 Constantinople: <nil> Engine: ethash}" INFO [02-27|19:14:03] Disk storage enabled for ethash caches dir=/home/ubuntu/.ethereum/geth/ethash count=3 INFO [02-27|19:14:03] Disk storage enabled for ethash DAGs dir=/home/ubuntu/.ethash count=2 INFO [02-27|19:14:03] Initialising Ethereum protocol versions="[63 62]" network=1 INFO [02-27|19:14:03] Loaded most recent local header number=0 hash=d4e567…cb8fa3 td=17179869184 INFO [02-27|19:14:03] Loaded most recent local full block number=0 hash=d4e567…cb8fa3 td=17179869184 INFO [02-27|19:14:03] Loaded most recent local fast block number=0 hash=d4e567…cb8fa3 td=17179869184 INFO [02-27|19:14:03] Regenerated local transaction journal transactions=0 accounts=0 INFO [02-27|19:14:03] Starting P2P networking INFO [02-27|19:14:05] UDP listener up self=enode://4ee1f43cc597fa829a04ec97dee38ad4f2c61f39f0f0e5ebd46e095c660cc95aab71eef55b0db9fd64d0afaeb589a8d9cb3eb86fdc07e32183648bc89dbd4aca@[::]:30303 INFO [02-27|19:14:05] RLPx listener up self=enode://4ee1f43cc597fa829a04ec97dee38ad4f2c61f39f0f0e5ebd46e095c660cc95aab71eef55b0db9fd64d0afaeb589a8d9cb3eb86fdc07e32183648bc89dbd4aca@[::]:30303 INFO [02-27|19:14:05] HTTP endpoint opened url=http://127.0.0.1:8545 cors= vhosts=localhost INFO [02-27|19:14:05] IPC endpoint opened url=/home/ubuntu/.ethereum/geth.ipc INFO [02-27|19:14:45] Block synchronisation started WARN [02-27|19:14:53] Synchronisation failed, retrying err="block download canceled (requested)" WARN [02-27|19:14:56] Node data write error err="state node 6aa064…378280 failed with all peers (1 tries, 1 peers)" WARN [02-27|19:14:56] Synchronisation failed, retrying err="state node 6aa064…378280 failed with all peers (1 tries, 1 peers)" WARN [02-27|19:15:07] Node data write error err="state node 6aa064…378280 failed with all peers (3 tries, 3 peers)" WARN [02-27|19:15:07] Synchronisation failed, retrying err="state node 6aa064…378280 failed with all peers (3 tries, 3 peers)" INFO [02-27|19:15:20] Imported new block headers count=192 elapsed=1.115s number=192 hash=723899…123390 ignored=0 INFO [02-27|19:15:20] Imported new block receipts count=2 elapsed=80.248µs number=2 hash=b495a1…4698c9 size=8.00B ignored=0 INFO [02-27|19:15:20] Imported new block headers count=192 elapsed=19.822ms number=384 hash=d3d5d5…c79cf3 ignored=0 INFO [02-27|19:15:21] Imported new block receipts count=4 elapsed=117.07µs number=6 hash=1f1aed…6b326e size=1.10kB ignored=0 INFO [02-27|19:15:22] Imported new block headers count=2048 elapsed=146.493ms number=2432 hash=78a9e6…079de3 ignored=0
As you can see the node connects to another nodes and receives blockchains and saves them to its local database. At present (late February 2017) a fully synchronized Ethereum node takes 59 Gigabytes of space, but this number will changed when you run your node.
STEP 3) Check the progress of the Ethereum network synchronization
The progress of Ethereum node synchronization could be checked with the “geth” program. Execute in the console:
ubuntu@srv.local:~/go-ethereum/build/bin$ ./geth --exec "web3.eth.syncing" attach { currentBlock: 388, highestBlock: 5159514, knownStates: 0, pulledStates: 0, startingBlock: 0 } ubuntu@srv.local:~/go-ethereum/build/bin$ ./geth --exec "web3.eth.syncing" attach { currentBlock: 401, highestBlock: 5159514, knownStates: 0, pulledStates: 0, startingBlock: 0 }
As you can see we are at the very beginning here, we’ve received 401 of total 5159514 in the network.
After around 2 hours we are at 4882892 of total 5166333 in the network.
ubuntu@srv.local:~/go-ethereum/build/bin$ ./geth --exec "web3.eth.syncing" attach { currentBlock: 4882892, highestBlock: 5166333, knownStates: 4806466, pulledStates: 4800942, startingBlock: 0 }
It is normal the highest block to increment, because the network is used intensively.
STEP 4) Successful full synchronization – how to check and to be sure
When you are almost then like in the last section of the STEP 3) you’ll begin to see lines in the geth output like:
INFO [02-28|01:46:28] Imported new block headers count=0 elapsed=1.281ms number=5168639 hash=433308…1a710e ignored=71
and when you execute geth with “web3.eth.syncing”:
ubuntu@srv.local:~/go-ethereum/build/bin$ ./geth --exec "web3.eth.syncing" attach false
The node will keep on receiving new blocks, so synchronization is triggered again, syncing the received blocks and stops again. So when transferring funds or creating a wallet or any other action there will be triggered a synchronization and then execution of the action. There is a callback for when sync starts and stops. If you cannot see multiple times “false” after the last synchronization check with geth, but your are almost at the highest block, no need to worry everything is OK, you node is almost fully synchronized and can be used.
At present with SSD and 32G RAM on a intel i7 processor and a fast Internet connection 100Mbps the full synchronization took about 8 hours.
One thought on “Running an Ethereum node from source under Ubuntu 16 LTS”