Skip to content

Commit de35104

Browse files
authored
Merge pull request #124 from iExecBlockchainComputing/feature/local-metrics
Add metrics infrastructure
2 parents 13efba4 + 9631b6f commit de35104

23 files changed

+6301
-1303
lines changed

.drone.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,33 +8,33 @@ pipeline:
88
- npm run autotest fast
99
- KYC=1 npm run autotest fast
1010

11-
docker_token_openethereum:
11+
docker_token_nethermind:
1212
image: plugins/docker
1313
repo: iexechub/poco-chaintest
1414
secrets: [docker_username, docker_password]
15-
dockerfile: testchains/openethereum.dockerfile
15+
dockerfile: testchains/nethermind.dockerfile
1616
build_args:
1717
- MNEMONIC=actual surround disorder swim upgrade devote digital misery truly verb slide final
1818
- CHAIN_TYPE=token
1919
- CHAIN_BLOCK_TIME=1
2020
- CHAIN_FORCE_SEALING=false
2121
auto_tag: true
22-
auto_tag_suffix: token-openethereum
22+
auto_tag_suffix: token-nethermind
2323
when:
2424
ref: [refs/tags/v*]
2525

26-
docker_native_openethereum:
26+
docker_native_nethermind:
2727
image: plugins/docker
2828
repo: iexechub/poco-chaintest
2929
secrets: [docker_username, docker_password]
30-
dockerfile: testchains/openethereum.dockerfile
30+
dockerfile: testchains/nethermind.dockerfile
3131
build_args:
3232
- MNEMONIC=actual surround disorder swim upgrade devote digital misery truly verb slide final
3333
- CHAIN_TYPE=native
3434
- CHAIN_BLOCK_TIME=1
3535
- CHAIN_FORCE_SEALING=false
3636
auto_tag: true
37-
auto_tag_suffix: native-openethereum
37+
auto_tag_suffix: native-nethermind
3838
when:
3939
ref: [refs/tags/v*]
4040

@@ -60,4 +60,4 @@ pipeline:
6060
auto_tag: true
6161
auto_tag_suffix: native
6262
when:
63-
ref: [refs/tags/v*]
63+
ref: [refs/tags/v*]

Jenkinsfile

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -116,56 +116,6 @@ pipeline {
116116
}
117117
}
118118

119-
stage("Native 1s image") {
120-
when {
121-
expression {
122-
env.TAG_NAME != null && env.TAG_NAME.toString().contains(buildWhenTagContains)
123-
}
124-
}
125-
steps {
126-
script {
127-
nethermindNative1secImage = docker.build(
128-
registry + "/poco-chain:native-${TAG_NAME}",
129-
"--file testchains/nethermind.dockerfile" \
130-
+ " --build-arg \"MNEMONIC=actual surround disorder swim upgrade devote digital misery truly verb slide final\"" \
131-
+ " --build-arg CHAIN_TYPE=native" \
132-
+ " --build-arg CHAIN_BLOCK_TIME=1" \
133-
+ " --build-arg CHAIN_FORCE_SEALING=true" \
134-
+ " --no-cache .")
135-
}
136-
script {
137-
docker.withRegistry("https://" + registry, "nexus") {
138-
nethermindNative1secImage.push()
139-
}
140-
}
141-
}
142-
}
143-
144-
stage("Token 1s image") {
145-
when {
146-
expression {
147-
env.TAG_NAME != null && env.TAG_NAME.toString().contains(buildWhenTagContains)
148-
}
149-
}
150-
steps {
151-
script {
152-
nethermindToken1secImage = docker.build(
153-
registry + "/poco-chain:token-${TAG_NAME}",
154-
"--file testchains/nethermind.dockerfile" \
155-
+ " --build-arg \"MNEMONIC=actual surround disorder swim upgrade devote digital misery truly verb slide final\"" \
156-
+ " --build-arg CHAIN_TYPE=token" \
157-
+ " --build-arg CHAIN_BLOCK_TIME=1" \
158-
+ " --build-arg CHAIN_FORCE_SEALING=true" \
159-
+ " --no-cache .")
160-
}
161-
script {
162-
docker.withRegistry("https://" + registry, "nexus") {
163-
nethermindToken1secImage.push()
164-
}
165-
}
166-
}
167-
}
168-
169119
stage("Native 5s image ") {
170120
when {
171121
expression {

nethermind.drone.yml

Lines changed: 0 additions & 63 deletions
This file was deleted.

testchains/nethermind.dockerfile

Lines changed: 37 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
###
22
## docker image build \
33
## --file testchains/nethermind.dockerfile \
4-
## --tag nexus.iex.ec/poco-chain:native-vX.Y.Z-some-fork.0 \
4+
## --tag nexus.iex.ec/poco-chain:native-vX.Y.Z-alpha.0 \
5+
## --build-arg MNEMONIC="actual surround disorder swim upgrade devote digital misery truly verb slide final" \
56
## --build-arg CHAIN_TYPE=native \
6-
## --build-arg CHAIN_BLOCK_TIME=1 \
7+
## --build-arg CHAIN_BLOCK_TIME=5 \
78
## --build-arg CHAIN_FORCE_SEALING=true \
89
## .
910
###
10-
FROM iexechub/nethermind:1.14.1-patch.0
11-
USER root
11+
12+
FROM iexechub/nethermind:1.14.1-patch.0 AS builder
13+
1214
RUN apt-get update && apt-get install bash jq nodejs npm -y
1315
# Add git required to install ethereumjs-abi from github (https://github.com/MetaMask/web3-provider-engine/issues/345)
1416
#
@@ -25,41 +27,39 @@ RUN echo -e "Node: `node -v` - npm: `npm -v`"
2527
###
2628
# Type of the blockchain to build.
2729
# "native" or "token".
28-
ARG CHAIN_TYPE
29-
# New blocks creating interval in seconds.
30+
ARG CHAIN_TYPE=native
31+
RUN echo "CHAIN_TYPE: ${CHAIN_TYPE}"
32+
# New blocks creation interval in seconds.
3033
# "1", "5", "20", ...
31-
ARG CHAIN_BLOCK_TIME
34+
ARG CHAIN_BLOCK_TIME=5
35+
RUN echo "CHAIN_BLOCK_TIME: ${CHAIN_BLOCK_TIME}"
3236
# Always create new blocks (even without txs).
3337
# "true" or "false"
34-
ARG CHAIN_FORCE_SEALING
38+
ARG CHAIN_FORCE_SEALING=true
39+
RUN echo "CHAIN_FORCE_SEALING: ${CHAIN_FORCE_SEALING}"
3540

3641
###
37-
## Log build configuration.
42+
## Copy chain config.
3843
###
39-
ENV MESSAGE="\n##########\n"
40-
ENV MESSAGE="${MESSAGE}### CHAIN_TYPE: ${CHAIN_TYPE} \n"
41-
ENV MESSAGE="${MESSAGE}### CHAIN_BLOCK_TIME: ${CHAIN_BLOCK_TIME} \n"
42-
ENV MESSAGE="${MESSAGE}### CHAIN_FORCE_SEALING: ${CHAIN_FORCE_SEALING} \n"
43-
ENV MESSAGE="${MESSAGE}########## \n"
44-
RUN echo -e ${MESSAGE}
44+
COPY testchains/nethermind/poco-chain.json /nethermind/chainspec/poco-chain.json
45+
COPY testchains/nethermind/poco-chain.cfg /nethermind/configs/poco-chain.cfg
46+
COPY testchains/nethermind/keystore /nethermind/keystore
47+
RUN sed -i "s/@stepDuration@/${CHAIN_BLOCK_TIME}/" /nethermind/chainspec/poco-chain.json
48+
RUN sed -i "s/@forceSealing@/${CHAIN_FORCE_SEALING}/" /nethermind/configs/poco-chain.cfg
49+
# Remove eip1559 for sidechains
50+
RUN if [ "${CHAIN_TYPE}" = "native" ] ; \
51+
then \
52+
sed -i "/eip1559/d" /nethermind/chainspec/poco-chain.json; \
53+
fi
4554

4655
###
47-
## Copy files and setup the chain config.
56+
## Copy PoCo contracts
4857
###
49-
ENV BASE_DIR="/iexec-poco/testchains/nethermind"
50-
RUN mkdir /iexec-poco
5158
COPY . /iexec-poco
52-
COPY ./testchains/nethermind/keystore/key-c08c3def622af1476f2db0e3cc8ccaead07be3bb /nethermind/keystore/
5359
RUN mv /iexec-poco/config/config_${CHAIN_TYPE}.json /iexec-poco/config/config.json
54-
RUN sed -i "s/@stepDuration@/${CHAIN_BLOCK_TIME}/" ${BASE_DIR}/spec.json
55-
RUN sed -i "s/@force_sealing@/${CHAIN_FORCE_SEALING}/" ${BASE_DIR}/authority.cfg
56-
# remove eip1559 for sidechains
57-
RUN if [ "${CHAIN_TYPE}" = "native" ] ; \
58-
then \
59-
sed -i "/eip1559/d" ${BASE_DIR}/spec.json; \
60-
fi
60+
6161
###
62-
## Run migration
62+
## Deploy contracts
6363
###
6464
ARG DEV_NODE
6565
ARG MNEMONIC
@@ -70,14 +70,19 @@ RUN echo "MNEMONIC: ${MNEMONIC}"
7070
RUN if [ "${CHAIN_TYPE}" = "native" ] ; \
7171
then \
7272
echo "Migration file: ${BASE_DIR}/migrate.sh"; \
73-
bash ${BASE_DIR}/migrate.sh; \
73+
bash /iexec-poco/testchains/nethermind/migrate.sh; \
7474
else \
7575
echo "Migration file: ${BASE_DIR}/migrate-all.sh"; \
76-
bash ${BASE_DIR}/migrate-all.sh; \
76+
bash /iexec-poco/testchains/nethermind/migrate-all.sh; \
7777
fi
7878

79-
# ###
79+
FROM iexechub/nethermind:1.14.1-patch.0
80+
81+
COPY --from=builder /nethermind /nethermind
82+
COPY --from=builder /iexec-poco/build /build
83+
84+
###
8085
## Configure entrypoint
8186
###
82-
ENTRYPOINT [ "../../nethermind/Nethermind.Runner" ]
83-
CMD [ "--config=/iexec-poco/testchains/nethermind/authority.cfg" ]
87+
ENTRYPOINT [ "/nethermind/Nethermind.Runner" ]
88+
CMD [ "--config=/nethermind/configs/poco-chain.cfg" ]

testchains/nethermind/authority.cfg

Lines changed: 0 additions & 53 deletions
This file was deleted.

0 commit comments

Comments
 (0)