Skip to content

Commit

Permalink
[Optimisation, n/a] update geth (#34)
Browse files Browse the repository at this point in the history
* updated docs

* updated to node 8-alpine and simplified dockerfile

* use most recent version of geth
  • Loading branch information
davesag authored and tayzlor committed Oct 24, 2017
1 parent 90e8a7f commit dca99d3
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 15 deletions.
20 changes: 12 additions & 8 deletions README.md
Expand Up @@ -60,13 +60,15 @@ To access the Netstats Web UI:
open http://$(docker-machine ip default):3000
```

#### Scaling the number of nodes/containers in the cluster
### Scaling the number of nodes/containers in the cluster

You can scale the number of Ethereum nodes by running:

```
docker-compose scale eth=3
```

Will scale the number of Ethereum nodes upwards (replace 3 with however many nodes
This will scale the number of Ethereum nodes **upwards** (replace 3 with however many nodes
you prefer). These nodes will connect to the P2P network (via the bootstrap node)
by default.

Expand All @@ -76,20 +78,22 @@ As part of the bootstrapping process we bootstrap 10 Ethereum accounts for use
pre-filled with 20 Ether for use in transactions by default.

If you want to change the amount of Ether for those accounts
See ```files/genesis.json```.
See `files/genesis.json`.

## 2. Interact with geth

If you want to start mining or stop mining you need to connect to the node via:
To get attached to the `geth` JavaScript console on the node you can run the following
```
docker exec -it ethereumdocker_eth_1 geth attach ipc://root/.ethereum/devchain/geth.ipc
```
Replace ethereumdocker_geth_1 with the container name you wish to connect to.
Then you can `miner.start()`, and then check to see if it's mining by inspecting `web3.eth.mining`.

See the [Javascript Runtime](https://github.com/ethereum/go-ethereum/wiki/JavaScript-Console) docs for more.

### 2.1 Use existing DAG
### 2.1 Use an existing DAG

To speed up the process, you can use a pre-generated DAG. All you need to do is add something like this
To speed up the process, you can use a [pre-generated DAG](https://github.com/ethereum/wiki/wiki/Ethash-DAG). All you need to do is add something like this
```
ADD dag/full-R23-0000000000000000 /root/.ethash/full-R23-0000000000000000
```
to the monitored-geth-client Dockerfile.
to the `monitored-geth-client` Dockerfile.
11 changes: 7 additions & 4 deletions eth-netstats/Dockerfile
@@ -1,12 +1,15 @@
FROM node:7
FROM node:8-alpine

RUN apk add --update git

RUN git clone https://github.com/cubedro/eth-netstats
RUN cd /eth-netstats && npm install
RUN cd /eth-netstats && npm install -g grunt-cli
RUN cd /eth-netstats && grunt

WORKDIR /eth-netstats

RUN npm install
RUN npm install -g grunt-cli
RUN grunt

EXPOSE 3000

CMD ["npm", "start"]
5 changes: 2 additions & 3 deletions monitored-geth-client/Dockerfile
@@ -1,7 +1,6 @@
FROM ethereum/client-go:v1.6.5
FROM ethereum/client-go

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

RUN cd /root &&\
git clone https://github.com/cubedro/eth-net-intelligence-api &&\
Expand Down

0 comments on commit dca99d3

Please sign in to comment.