-
Notifications
You must be signed in to change notification settings - Fork 160
fix errors and make testnet work #403
Changes from all commits
ff244e8
dc2a24d
2195678
a40139d
84bd101
5123cc3
acb6f6c
90f9ecc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,17 +15,18 @@ COPY . . | |
RUN make build-ethermint-linux | ||
|
||
# Final image | ||
FROM alpine:edge | ||
FROM golang:1.14 as final | ||
|
||
# Install ca-certificates | ||
RUN apk add --update ca-certificates | ||
WORKDIR /root | ||
WORKDIR / | ||
|
||
RUN apt-get update | ||
|
||
# Copy over binaries from the build-env | ||
COPY --from=build-env /go/src/github.com/ChainSafe/ethermint/build/emintd /usr/bin/emintd | ||
COPY --from=build-env /go/src/github.com/ChainSafe/ethermint/build/emintcli /usr/bin/emintcli | ||
COPY --from=build-env /go/src/github.com/ChainSafe/ethermint/scripts/start.sh / | ||
|
||
EXPOSE 26656 26657 1317 | ||
EXPOSE 26656 26657 1317 8545 | ||
|
||
# Run emintd by default, omit entrypoint to ease using container with emintcli | ||
CMD ["emintd"] | ||
ENTRYPOINT ["/bin/bash", "-c"] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't understand the diff here with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. CMD is used when there are no args passed the the docker run command (i.e. this might be a better explanation |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -268,9 +268,9 @@ localnet-start: localnet-stop | |
docker rmi -f ethermint-build-linux | ||
docker build --rm -t ethermint-build-linux . ; \ | ||
container_id=$$(docker create ethermint-build-linux) ; \ | ||
docker cp $${container_id}:/usr/bin/emintd ./build/ ; \ | ||
docker cp $${container_id}:/usr/bin/emintcli ./build/ | ||
Comment on lines
-271
to
-272
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. so this copyies the binaries to the build folder, which allows the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is it necessary for the binary to be copied over to the directory? Why don't we have the binary just be built into the image directly? This is how i do that: |
||
if ! [ -f build/node0/$(ETHERMINT_DAEMON_BINARY)/config/genesis.json ]; then docker run --rm -v $(CURDIR)/build:/$(ETHERMINT_DAEMON_BINARY):Z emintd/node testnet --v 4 -o . --starting-ip-address 192.168.10.2 --keyring-backend=test ; fi | ||
docker container start $${container_id} ; | ||
|
||
if ! [ -f build/node0/$(ETHERMINT_DAEMON_BINARY)/config/genesis.json ]; then docker run --rm -v $(CURDIR)/build:/ethermint:Z ethermint-build-linux "emintd testnet --v 4 -o /ethermint --starting-ip-address 192.168.10.2 --keyring-backend=test"; fi | ||
docker-compose up -d | ||
|
||
localnet-stop: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,63 +3,71 @@ version: "3" | |
services: | ||
emintdnode0: | ||
container_name: emintdnode0 | ||
image: "emintd/node" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd suggest keeping the image names as they are now to isolate the changes There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. sure, but we would need to change it everywhere on the makefile as well, that can be an easy change |
||
image: "ethermint-build-linux" | ||
ports: | ||
- "26656-26657:26656-26657" | ||
- "1317:1317" | ||
- "8545:8545" | ||
environment: | ||
- ID=0 | ||
- LOG=${LOG:-emintd.log} | ||
volumes: | ||
- ./build:/emintd:Z | ||
- ./build:/ethermint:Z | ||
networks: | ||
localnet: | ||
ipv4_address: 192.168.10.2 | ||
entrypoint: "emintd --home ethermint/node0/emintd/ start" | ||
|
||
emintdnode1: | ||
container_name: emintdnode1 | ||
image: "emintd/node" | ||
image: "ethermint-build-linux" | ||
ports: | ||
- "26659-26660:26656-26657" | ||
- "1318:1317" | ||
- "8546:8545" | ||
environment: | ||
- ID=1 | ||
- LOG=${LOG:-emintd.log} | ||
volumes: | ||
- ./build:/emintd:Z | ||
- ./build:/ethermint:Z | ||
networks: | ||
localnet: | ||
ipv4_address: 192.168.10.3 | ||
entrypoint: "emintd --home ethermint/node1/emintd/ start" | ||
|
||
emintdnode2: | ||
container_name: emintdnode2 | ||
image: "emintd/node" | ||
image: "ethermint-build-linux" | ||
environment: | ||
- ID=2 | ||
- LOG=${LOG:-emintd.log} | ||
ports: | ||
- "26661-26662:26656-26657" | ||
- "1319:1317" | ||
- "8547:8545" | ||
volumes: | ||
- ./build:/emintd:Z | ||
- ./build:/ethermint:Z | ||
networks: | ||
localnet: | ||
ipv4_address: 192.168.10.4 | ||
entrypoint: "emintd --home ethermint/node2/emintd/ start" | ||
|
||
emintdnode3: | ||
container_name: emintdnode3 | ||
image: "emintd/node" | ||
image: "ethermint-build-linux" | ||
environment: | ||
- ID=3 | ||
- LOG=${LOG:-emintd.log} | ||
ports: | ||
- "26663-26664:26656-26657" | ||
- "1320:1317" | ||
- "8548:8545" | ||
volumes: | ||
- ./build:/emintd:Z | ||
- ./build:/ethermint:Z | ||
networks: | ||
localnet: | ||
ipv4_address: 192.168.10.5 | ||
entrypoint: "emintd --home ethermint/node3/emintd/ start" | ||
|
||
networks: | ||
localnet: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/sh | ||
emintd --home /ethermint/node$ID/emintd/ start > emintd.log & | ||
sleep 5 | ||
emintcli rest-server --laddr "tcp://localhost:8545" --chain-id 7305661614933169792 --trace > emintcli.log & | ||
tail -f /dev/null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
correct me if I'm wrong but this change should be the only one made in order to make this work for all the OS?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well all this does is allow the binaries created from the previous build step (build-env) to be executable on the final image