Skip to content
This repository was archived by the owner on Nov 29, 2022. It is now read-only.

Commit bff4937

Browse files
committed
Moved ethereum monitoring out of main ethermint workers to separate containers
1 parent 387b800 commit bff4937

File tree

6 files changed

+90
-27
lines changed

6 files changed

+90
-27
lines changed

README.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@ Ethereum smart contracts development environment based on Ethermint/Tendermint
33

44
## TODO
55

6-
- [x] Run as a multinode cluster, not a single node
7-
- [x] Enable eth-netstats client/server
86
- [ ] Add sample contracts subproject with truffle and autodeployment
97
- [ ] Add usage docs
10-
- [ ] Include sample data encoding/decoding solidity contract
11-
- [ ] Find out why eth-netstats is causing errors on Ethermint cluster
8+
- [ ] Include sample data encoding/decoding solidity contract

docker-compose.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,4 +94,18 @@ services:
9494
# volumes:
9595
# - /etc/localtime:/etc/localtime:ro
9696
ports:
97-
- "3000:3000"
97+
- "3001:3000"
98+
99+
master_monitor:
100+
image: buythewhale/ethstats_monitor
101+
volumes:
102+
- ${PWD-.}/netstats/master.app.json:/home/ethnetintel/eth-net-intelligence-api/app.json:ro
103+
depends_on:
104+
- ethermaster
105+
106+
slave_monitor:
107+
image: buythewhale/ethstats_monitor
108+
volumes:
109+
- ${PWD-.}/netstats/slave.app.json:/home/ethnetintel/eth-net-intelligence-api/app.json:ro
110+
depends_on:
111+
- ethermaster

ethermint/Dockerfile

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,35 +11,40 @@ RUN mkdir -p $DATA_ROOT && \
1111

1212
RUN apk add --no-cache bash
1313

14-
# Installing eth-net-intelligence-api depencencies and bash
15-
RUN apk add --update git bash nodejs nodejs-npm perl
14+
# TODO: uncomment if we'll use local monitors instead of external ones
15+
# # Installing eth-net-intelligence-api depencencies and bash
16+
# RUN apk add --update git bash nodejs nodejs-npm perl
1617

17-
# Installing eth-net-intelligence client
18-
RUN cd /root &&\
19-
git clone https://github.com/cubedro/eth-net-intelligence-api &&\
20-
cd eth-net-intelligence-api &&\
21-
npm install &&\
22-
npm install -g pm2
18+
# # Installing eth-net-intelligence client
19+
# RUN cd /root &&\
20+
# git clone https://github.com/cubedro/eth-net-intelligence-api &&\
21+
# cd eth-net-intelligence-api &&\
22+
# npm install &&\
23+
# npm install -g pm2
2324

2425
# Setting GOlang paths
2526
ENV GOPATH /go
2627
ENV PATH "$PATH:/go/bin"
28+
# ENV ETHERMINT_VERSION develop
29+
# ENV ETHERMINT_VERSION master
30+
ENV ETHERMINT_VERSION v0.5.4
2731

2832
# Installing Ethermint from source
2933
RUN mkdir -p /go/src/github.com/tendermint/ethermint && \
3034
apk add --no-cache go build-base git linux-headers && \
3135
cd /go/src/github.com/tendermint/ethermint && \
3236
git clone https://github.com/tendermint/ethermint . && \
33-
git checkout develop && \
37+
git checkout ${ETHERMINT_VERSION} && \
3438
make get_vendor_deps && \
3539
make install && \
3640
glide cc && \
3741
cd - && \
3842
rm -rf /go/src/github.com/tendermint/ethermint && \
3943
apk del go build-base git
4044

41-
# Putting eth-net-intelligence client configuration into container
42-
ADD app.json /root/eth-net-intelligence-api/app.json
45+
# TODO: uncomment if we'll use local monitors instead of external ones
46+
# # Putting eth-net-intelligence client configuration into container
47+
# ADD app.json /root/eth-net-intelligence-api/app.json
4348

4449
VOLUME $DATA_ROOT
4550

ethermint/start.sh

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,19 @@
33
# Exit if any command return non-zero exitcode
44
set -e
55

6-
if [ -n "${ALLOW_NETSTATS+set}" ]; then
7-
if [ "$ALLOW_NETSTATS" == "1" ]; then
8-
# Preparing eth-net-intelligence-api
9-
perl -pi -e "s/XXX/$(hostname)/g" /root/eth-net-intelligence-api/app.json
6+
# TODO: uncomment if we'll use local monitors instead of external ones
7+
# if [ -n "${ALLOW_NETSTATS+set}" ]; then
8+
# if [ "$ALLOW_NETSTATS" == "1" ]; then
9+
# # Preparing eth-net-intelligence-api
10+
# perl -pi -e "s/XXX/$(hostname)/g" /root/eth-net-intelligence-api/app.json
1011

11-
# Launching eth-net-intelligence-api
12-
cd /root/eth-net-intelligence-api
13-
/usr/bin/pm2 start ./app.json
14-
cd ${DATA_ROOT}
15-
sleep 3
16-
fi
17-
fi
12+
# # Launching eth-net-intelligence-api
13+
# cd /root/eth-net-intelligence-api
14+
# /usr/bin/pm2 start ./app.json
15+
# cd ${DATA_ROOT}
16+
# sleep 3
17+
# fi
18+
# fi
1819

1920
# Initialize working directory
2021
ethermint --datadir ${DATA_ROOT} init ${DATA_ROOT}/genesis.json

netstats/master.app.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
[
2+
{
3+
"name" : "node-app",
4+
"script" : "app.js",
5+
"log_date_format" : "YYYY-MM-DD HH:mm Z",
6+
"merge_logs" : false,
7+
"watch" : false,
8+
"max_restarts" : 10,
9+
"exec_interpreter" : "node",
10+
"exec_mode" : "fork_mode",
11+
"env":
12+
{
13+
"NODE_ENV" : "production",
14+
"RPC_HOST" : "ethermaster",
15+
"RPC_PORT" : "8545",
16+
"LISTENING_PORT" : "30303",
17+
"INSTANCE_NAME" : "ethermaster",
18+
"WS_SERVER" : "ws://netstats:3000",
19+
"WS_SECRET" : "eth-net-stats-secret",
20+
"VERBOSITY" : 2
21+
}
22+
}
23+
]

netstats/slave.app.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
[
2+
{
3+
"name" : "node-app",
4+
"script" : "app.js",
5+
"log_date_format" : "YYYY-MM-DD HH:mm Z",
6+
"merge_logs" : false,
7+
"watch" : false,
8+
"max_restarts" : 10,
9+
"exec_interpreter" : "node",
10+
"exec_mode" : "fork_mode",
11+
"env":
12+
{
13+
"NODE_ENV" : "production",
14+
"RPC_HOST" : "etherslave",
15+
"RPC_PORT" : "8545",
16+
"LISTENING_PORT" : "30303",
17+
"INSTANCE_NAME" : "etherslave",
18+
"WS_SERVER" : "ws://netstats:3000",
19+
"WS_SECRET" : "eth-net-stats-secret",
20+
"VERBOSITY" : 2
21+
}
22+
}
23+
]

0 commit comments

Comments
 (0)