Introduction to Pantheon — The Java Ethereum Client

Pantheon is the new Java Ethereum client which has recently been open sourced and is now production ready (v1.1 at the time of writing). The code was written in Java and aims to provide enterprises with an Ethereum client that has features such as stability, permissions and access control, privacy, ease of deployment and scalability. These are common requirements for business looking to use Ethereum in their technology stack. Pantheon is also mainnet-compatible, and includes features like consensus algorithms that are applicable to enterprise use. Using Pantheon you can send transactions, deploy smart contracts, and interact with the JSON-RPC API. Here is the link to the Pantheon website if you are interested in reading more about it: https://pegasys.tech . This image shows the Pantheon roadmap. Pantheon v1.1 has been released and v1.2 is currently in active development. It appears that (at the time of writing) there is no set release date for v2.0.

Installation

Let’s get started by downloading and installing Pantheon. On mac you can install using homebrew:

brew tap pegasyseng/pantheon
brew install pantheon

Or on windows using chocolatey:

choco install pantheon

To confirm that the installation was successful, run the Pantheon command line help:

pantheon --help

You can also run Pantheon from a docker image. This will first download the docker image and then run it:

docker run pegasyseng/pantheon:latest

Starting Pantheon

To run a Pantheon node on the Ethereum mainnet, you can simply run:

pantheon

Or you can run on the mainnet with the HTTP JSON-RPC service enabled on localhost:

pantheon --rpc-http-enabled

We can see the node boot up and start connecting to mainnet:

$ pantheon
 2019-05-28 12:23:26.350+08:00 | main | INFO  | StaticNodesParser | StaticNodes file /usr/local/Cellar/pantheon/1.1.0/static-nodes.json does not exist, no static connections will be created.
 2019-05-28 12:23:26.352+08:00 | main | INFO  | Pantheon | Connecting to 0 static nodes.
 2019-05-28 12:23:26.824+08:00 | main | INFO  | KeyPairUtil | Loaded key 0xcad384ba9cd24761c10c852d18a4d2b1d562f89a3dbcffed2b307aae168d5abe3cd5d688d2471b2ef41d5e25b20ba578d273c606763c1a4f1eaf40da8cc7ede9 from /usr/local/Cellar/pantheon/1.1.0/key
 2019-05-28 12:23:27.140+08:00 | main | INFO  | ProtocolScheduleBuilder | Protocol schedule created with milestones: [Frontier: 0, Homestead: 1150000, DaoRecoveryInit: 1920000, DaoRecoveryTransition: 1920001, Homestead: 1920010, TangerineWhistle: 2463000, SpuriousDragon: 2675000, Byzantium: 4370000, ConstantinopleFix: 7280000]
 2019-05-28 12:23:27.963+08:00 | nioEventLoopGroup-2-1 | INFO  | NettyP2PNetwork | P2PNetwork started and listening on /0:0:0:0:0:0:0:0:30303
 2019-05-28 12:23:27.974+08:00 | main | INFO  | Runner | Starting Ethereum main loop …
 2019-05-28 12:23:27.974+08:00 | main | INFO  | NetworkRunner | Starting Network.
 2019-05-28 12:23:27.976+08:00 | main | INFO  | PeerDiscoveryAgent | Starting peer discovery agent on host=0.0.0.0, port=30303
 2019-05-28 12:23:28.021+08:00 | vert.x-eventloop-thread-1 | INFO  | VertxPeerDiscoveryAgent | Started peer discovery agent successfully, on effective host=0:0:0:0:0:0:0:0 and port=30303
 2019-05-28 12:23:28.061+08:00 | main | INFO  | NettyP2PNetwork | Enode URL enode://cad384ba9cd24761c10c852d18a4d2b1d562f89a3dbcffed2b307aae168d5abe3cd5d688d2471b2ef41d5e25b20ba578d273c606763c1a4f1eaf40da8cc7ede9@127.0.0.1:30303
 2019-05-28 12:23:28.065+08:00 | main | INFO  | DefaultSynchronizer | Starting synchronizer.
 2019-05-28 12:23:28.069+08:00 | main | INFO  | WaitForPeersTask | Waiting for 1 peers to connect.
 2019-05-28 12:23:28.076+08:00 | main | INFO  | Runner | Ethereum main loop is up.
 2019-05-28 12:23:34.823+08:00 | nioEventLoopGroup-3-1 | INFO  | WaitForPeersTask | Finished waiting for peers to connect.
 2019-05-28 12:23:35.034+08:00 | nioEventLoopGroup-3-1 | INFO  | SyncTargetManager | Found common ancestor with peer 0x968164e756b96ed562… at block 0
 2019-05-28 12:23:40.037+08:00 | EthScheduler-Timer-0 | INFO  | WaitForPeersTask | Waiting for 1 peers to connect.

To run a node on the Ropsten test network, set the network flag:

pantheon --network=ropsten

To run on the Ropsten network with the HTTP JSON-RPC service enabled on localhost:

pantheon  --network=ropsten --rpc-http-enabled

To run a dev node for testing:

pantheon --network=dev --miner-enabled --miner-coinbase=0xfe3b557e8fb62b89f4916b721be55ceb828dbd73 --rpc-http-cors-origins="all" --host-whitelist=* --rpc-ws-enabled --rpc-http-enabled --data-path=/tmp/tmpDatdir

When — network=dev is specified, Pantheon uses the development mode genesis configuration with a fixed low difficulty. Setting the network to mainnet, goerli, rinkeby, ropsten or dev will tell Pantheon to use the default preconfigured genesis file for that respective network so you don’t need to manual create your own genesis file.

Test that Pantheon is Running

You can confirm that Pantheon is running and connected to the correct network by running these commands against the JSON RPC API:

$ curl -X POST --data '{"jsonrpc":"2.","method":"eth_chainId","params":[],"id":1}' localhost:8545
{
   "jsonrpc" : "2.0",
   "id" : 1,
   "result" : "0x1"
}

$ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_syncing","params":[],"id":1}' localhost:8545
{
   "jsonrpc" : "2.0",
   "id" : 1,
   "result" : {
     "startingBlock" : "0x2a490",
     "currentBlock" : "0x2a4e5",
     "highestBlock" : "0x77b8b4"
   }
}

The eth_chainId method returns the network id of the running Pantheon node. The eth_syncing method returns the starting, current and highest blocks that have been synced.

High Level Architecture

Here is a diagram of the Pantheon high level architecture from the official Pantheon documentation.

Here are some other useful Pantheon links and resources for your reference if you want to learn more. Downloads: https://pegasys.tech/solutions

Github repo: https://github.com/PegaSysEng/pantheon

Official Documentation: https://docs.pantheon.pegasys.tech/en/latest

Gitter: https://gitter.im/PegaSysEng/pantheon

Twitter: https://twitter.com/pegasyseng