Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated Dockerfiles to working, cleaned up README #42

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 27 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,44 +3,39 @@
Get started creating Ethereum development and test single and multi-node clusters
rapidly using Docker.

We provide full Ethereum test nodes (using the [Ethereum Go client](https://github.com/ethereum/go-ethereum) with all APIs enabled by default as well as a monitoring dashboard (for the cluster version) provided
via [Netstats](https://github.com/cubedro/eth-netstats).
## Motivation

#### Alternative projects

TestRPC - [https://github.com/ethereumjs/testrpc](https://github.com/ethereumjs/testrpc)
Private Ethereum networks aren't terribly difficult to setup. However bootstrapping that network can be a little difficult and there is a nice monitoring addon to ensure everything is working as expected in your network.

# Getting started
1. Setting up initial "users" can be difficult, generating a wallet id, secret, etc.
1. Monitoring is more difficult than expected, test nodes need a "sidecar" type service that pushes their current status to a monitoring platform
1. A visual representation of the network is really cool to see.

## 1. Installing
We provide full Ethereum test nodes (using the [Ethereum Go client](https://github.com/ethereum/go-ethereum) with all APIs enabled by default as well as a monitoring dashboard (for the cluster version) provided
via [Netstats](https://github.com/cubedro/eth-netstats).

### 1.1. Standalone Ethereum node
## Prerequisites

#### Prerequisites
This service uses the very popular docker to run geth in a consistent environment: https://www.docker.com/get-docker

Docker Toolbox installed.
> To download and install Docker Toolbox for your environment please
follow [the Docker Toolbox instructions](https://www.docker.com/products/docker-toolbox).
It also uses docker-compose to create our containers and orchestrate their deployment: https://docs.docker.com/compose/

After Docker Toolbox has been installed, create a ```default``` machine to run Docker against.
## 1. Creating a Private Ethereum Network

#### Lets go
### 1.1. Single-Node Ethereum Network

To run a single test Ethereum node run the following:

```
$ docker-compose -f docker-compose-standalone.yml up -d
```

If using docker-machine you should be able to get to the JSON RPC client by doing:

You should be able to get to the JSON RPC client by browsing to:
```
open http://$(docker-machine ip default):8545
http://localhost:8545 # See below if using Docker for Mac/Windows
```

Assuming you ran docker-compose against the ```default``` machine.

### 1.2. Ethereum Cluster with netstats monitoring
### 1.2. Multi-Node Ethereum Network (with Monitoring)

To run an Ethereum Docker cluster run the following:

Expand All @@ -57,7 +52,7 @@ By default this will create:
To access the Netstats Web UI:

```
open http://$(docker-machine ip default):3000
http://localhost:3000
```

### Scaling the number of nodes/containers in the cluster
Expand Down Expand Up @@ -97,3 +92,14 @@ To speed up the process, you can use a [pre-generated DAG](https://github.com/et
ADD dag/full-R23-0000000000000000 /root/.ethash/full-R23-0000000000000000
```
to the `monitored-geth-client` Dockerfile.

## Docker on Mac/Window

Docker on Mac and Window actually requires a separate Linux kernel running in order run the docker containers. What that ends up being typically is a virtual machine with a different IP address than your `localhost` address. You can fetch the address and open are url by running, for example:
```
open http://$(docker-machine ip default):8545
```

#### Alternative projects

TestRPC - [https://github.com/ethereumjs/testrpc](https://github.com/ethereumjs/testrpc)
6 changes: 6 additions & 0 deletions monitored-geth-client/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
FROM ethereum/client-go
# Switch back to root (ethereum/client-go uses the user "geth")
USER root

RUN apk add --update git bash nodejs nodejs-npm perl

Expand All @@ -11,5 +13,9 @@ RUN cd /root &&\
ADD start.sh /root/start.sh
ADD app.json /root/eth-net-intelligence-api/app.json
RUN chmod +x /root/start.sh
RUN mkdir -p /root/.ethereum/devchain

# Put everything back to geth user
RUN chown -R geth:geth /root
USER geth
ENTRYPOINT /root/start.sh