Example of private ethereum cluster running on Cloud Foundry
The up.sh
script will stand up 3 apps:
bootnodes
- one instance of the service discovery node for the networkminers
- one instance of a geth miner node for block creationnodes
- one instance of a geth node to execute transactions
You can access any of these nodes with cf ssh
and use the geth
binary at app/geth
and the data dir at app/data
. The genesis file and accounts used are provided with the repo and should not be reused in any production environment.
The miner comes up in a stopped state to prevent run-away CPU usage.
The test.sh
script will:
- Stop the miner if running
- Mine 1 block to create ETH for account 0
- Initiate a transfer of ETH from account 0 to account 1
- Mine 1 block to complete the transfer
- Show the balances of each account to confirm the transfer has occured
- Cloud Foundry CLI
- Docker
- Account on Cloud Foundry environment with Container-to-Container networking and SSH enabled
- Recommended: Pivotal Web Services
- Supported on Pivotal Cloud Foundry 1.10 and higher
-
Install the cf cli network policy plugin
cf install-plugin network-policy
-
Log in to Cloud Foundry and target an org and space
cf login -a https://api.your-cf.com -u [email protected] -o your-org -s your-space
-
Run
up.sh
and wait for it to finish -
Run
test.sh
. Read the prompts and compare it to the output to confirm the cluster is working
- Verbosity is turned up on
geth
andbootnodes
so the logs show lots of false positive errors. Examples:<log stamp> Dial error task="dyndial 8ba26367c9651a53 10.253.245.133:33445" err="dial tcp 10.253.245.133:33445: getsockopt: connection refused" ... <log stamp> Bumping findnode failure counter id=8ba26367c9651a53 failcount=2