Skip to content

Commit 73dac6f

Browse files
authored
build: fix docker compose (#46)
1 parent 956b18f commit 73dac6f

3 files changed

Lines changed: 50 additions & 21 deletions

File tree

docker-compose.yml

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ services:
55
container_name: ethermintdnode0
66
image: "ethermintd/node"
77
ports:
8-
- "26656-26657:26656-26657"
8+
- "26657:26657"
99
- "1317:1317"
10-
- "8545:8545"
11-
- "8546:8546"
10+
- "1318:1318"
11+
- "8125:8125"
1212
environment:
1313
- ID=0
1414
- LOG=${LOG:-ethermintd.log}
@@ -17,16 +17,16 @@ services:
1717
networks:
1818
localnet:
1919
ipv4_address: 192.168.10.2
20-
entrypoint: "bash start.sh"
20+
entrypoint: "bash start-docker.sh"
2121

2222
ethermintdnode1:
2323
container_name: ethermintdnode1
2424
image: "ethermintd/node"
2525
ports:
26-
- "26659-26660:26656-26657"
27-
- "1318:1317"
28-
- "8547:8545"
29-
- "8548:8546"
26+
- "26658:26657"
27+
- "1327:1317"
28+
- "1328:1318"
29+
- "8126:8125"
3030
environment:
3131
- ID=1
3232
- LOG=${LOG:-ethermintd.log}
@@ -35,7 +35,7 @@ services:
3535
networks:
3636
localnet:
3737
ipv4_address: 192.168.10.3
38-
entrypoint: "bash start.sh"
38+
entrypoint: "bash start-docker.sh"
3939

4040
ethermintdnode2:
4141
container_name: ethermintdnode2
@@ -44,16 +44,16 @@ services:
4444
- ID=2
4545
- LOG=${LOG:-ethermintd.log}
4646
ports:
47-
- "26661-26662:26656-26657"
48-
- "1319:1317"
49-
- "8549:8545"
50-
- "8550:8546"
47+
- "26659:26657"
48+
- "1337:1317"
49+
- "1338:1318"
50+
- "8127:8125"
5151
volumes:
5252
- ./build:/ethermint:Z
5353
networks:
5454
localnet:
5555
ipv4_address: 192.168.10.4
56-
entrypoint: "bash start.sh"
56+
entrypoint: "bash start-docker.sh"
5757

5858
ethermintdnode3:
5959
container_name: ethermintdnode3
@@ -62,16 +62,16 @@ services:
6262
- ID=3
6363
- LOG=${LOG:-ethermintd.log}
6464
ports:
65-
- "26663-26664:26656-26657"
66-
- "1320:1317"
67-
- "8551:8545"
68-
- "8552:8546"
65+
- "26660:26657"
66+
- "1347:1317"
67+
- "1348:1318"
68+
- "8128:8125"
6969
volumes:
7070
- ./build:/ethermint:Z
7171
networks:
7272
localnet:
7373
ipv4_address: 192.168.10.5
74-
entrypoint: "bash start.sh"
74+
entrypoint: "bash start-docker.sh"
7575

7676
networks:
7777
localnet:

networks/local/ethermintnode/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ WORKDIR /
2222
RUN apt-get update
2323

2424
# Copy over binaries from the build-env
25-
COPY --from=build-env /go/src/github.com/cosmos/ethermint/build/ethermintd /usr/bin/ethermintd
26-
COPY --from=build-env /go/src/github.com/cosmos/ethermint/scripts/start.sh /
25+
COPY --from=build-env /go/src/github.com/cosmos/ethermint/build/ethermintd /
26+
COPY --from=build-env /go/src/github.com/cosmos/ethermint/scripts/start-docker.sh /
2727

2828
EXPOSE 26656 26657 1317 8545 8546
2929

scripts/start-docker.sh

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/bin/bash
2+
3+
KEY="mykey"
4+
CHAINID="ethermint-123"
5+
MONIKER="mymoniker"
6+
DATA_DIR=$(mktemp -d -t ethermint-datadir.XXXXX)
7+
8+
echo "create and add new keys"
9+
./ethermintd keys add $KEY --home $DATA_DIR --no-backup --chain-id $CHAINID --algo "eth_secp256k1" --keyring-backend test
10+
echo "init Ethermint with moniker=$MONIKER and chain-id=$CHAINID"
11+
./ethermintd init $MONIKER --chain-id $CHAINID --home $DATA_DIR
12+
echo "prepare genesis: Allocate genesis accounts"
13+
./ethermintd add-genesis-account \
14+
"$(./ethermintd keys show $KEY -a --home $DATA_DIR --keyring-backend test)" 1000000000000000000aphoton,1000000000000000000stake \
15+
--home $DATA_DIR --keyring-backend test
16+
echo "prepare genesis: Sign genesis transaction"
17+
./ethermintd gentx $KEY 1000000000000000000stake --keyring-backend test --home $DATA_DIR --keyring-backend test --chain-id $CHAINID
18+
echo "prepare genesis: Collect genesis tx"
19+
./ethermintd collect-gentxs --home $DATA_DIR
20+
echo "prepare genesis: Run validate-genesis to ensure everything worked and that the genesis file is setup correctly"
21+
./ethermintd validate-genesis --home $DATA_DIR
22+
23+
echo "starting ethermint node $i in background ..."
24+
./ethermintd start --pruning=nothing --rpc.unsafe \
25+
--keyring-backend test --home $DATA_DIR \
26+
>$DATA_DIR/node.log 2>&1 & disown
27+
28+
echo "started ethermint node"
29+
tail -f /dev/null

0 commit comments

Comments
 (0)