Ethereum: EthExplorer block explorer

In this article I’ll walk through installing EthExplorer, a block explorer for Ethereum, in Ubuntu. For these steps, I’m running my Ubuntu instance in VirtualBox on a Windows 10 host. We’ll be following on from where we left off in the last article, Ethereum: Deploying to a Private Blockchain.

There’s a few different open-source block explorer options available for Ethereum, including etherparty EthExplorer and it’s cousin, carsenk:

Previously…

Check out these previous articles which describe setting up the dev environment and other tools I’ll be using:

1. Install etherparty

Make sure you have git installed, as well as nodejs and npm. Open a terminal and type the following:

git clone https://github.com/etherparty/explorer

This will create a new directory called explorer. Change into this directory:

cd explorer

Now start EthExplorer by typing

npm start

This will also install any missing dependencies. When it’s finished the server will start and you should see something like:

Output:

> EthereumExplorer@0.1.0 start /home/someone/explorer
> http-server ./app -a localhost -p 8000 -c-1

Starting up http-server, serving ./app on port: 8000
Hit CTRL-C to stop the server

In your browser navigate to http://localhost:8000. You may see this error:

etherparty error

Restart geth (or start it, if you hadn’t started it in the first place) with the specified rpccorsdomain value. Alternatively (and less securely), you can use a wildcard value *.

geth --port 3000 --networkid 58342 --nodiscover --datadir="privchain" --maxpeers=0 --autodag \
 --rpc --rpcport 8545 --rpcaddr 127.0.0.1 --rpccorsdomain "*" --rpcapi "eth,net,web3" \
 --ipcapi "eth,net,web3"

Refresh the browser at http://localhost:8000.

etherparty genesis block

2. Mine some transactions

To see some transactions start flowing, we can attach to the geth console and start mining. Open a new terminal and type:

geth attach ipc://home/someone/privchain/gath.ipc

You may need to create a default account and unlock it as well. From the geth console, type:

> personal.newAccount('password')
> personal.unlockAccount(web3.eth.coinbase, 'password', 16000)

Now start mining:

> miner.start()

After a few minutes the mining should start. While we wait, we can have a look at the genesis block by clicking on the *Block # link 0.

Stop the mining:

> miner.stop()

Once the mining starts, refresh the block explorer in your browser to see the transactions.

Taking this a step further, we could use truffle to deploy a smart contract, and see it in EthExplorer.

etherparty few blocks