forked from evmos/ethermint
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refacotor: image build and docker-compose.yml
- Loading branch information
tony
committed
Oct 31, 2023
1 parent
1073094
commit b96cf1d
Showing
6 changed files
with
83 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,5 @@ | |
localnet-setup | ||
|
||
# build | ||
build | ||
build | ||
tests/solidity/node_modules/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ETHERMINT_IMAGE=ghcr.io/b2network/b2-node:20231031-175311-eb3cc87 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,73 +1,54 @@ | ||
version: "3" | ||
|
||
services: | ||
ethermintdnode0: | ||
container_name: ethermintdnode0 | ||
image: "ethermintd/node" | ||
node0: | ||
image: ${ETHERMINT_IMAGE} | ||
ports: | ||
- "26657:26657" | ||
- "8545:8545" | ||
- "8546:8546" | ||
- "8125:8125" | ||
environment: | ||
- ID=0 | ||
- LOG=${LOG:-ethermintd.log} | ||
volumes: | ||
- ./localnet-setup/node0/ethermintd:/ethermint:Z | ||
- ./client-data/node0/ethermintd:/root/.ethermintd | ||
networks: | ||
- localnet | ||
entrypoint: "bash start-docker.sh" | ||
- ethermint | ||
|
||
ethermintdnode1: | ||
container_name: ethermintdnode1 | ||
image: "ethermintd/node" | ||
node1: | ||
image: ${ETHERMINT_IMAGE} | ||
ports: | ||
- "26658:26657" | ||
- "8555:8545" | ||
- "8556:8546" | ||
- "8126:8125" | ||
environment: | ||
- ID=1 | ||
- LOG=${LOG:-ethermintd.log} | ||
volumes: | ||
- ./localnet-setup/node1/ethermintd:/ethermint:Z | ||
- /root/.ethermintd:/root/.ethermintd | ||
# - ./client-data/node1/ethermintd:/root/.ethermintd | ||
networks: | ||
- localnet | ||
entrypoint: "bash start-docker.sh" | ||
- ethermint | ||
|
||
ethermintdnode2: | ||
container_name: ethermintdnode2 | ||
image: "ethermintd/node" | ||
environment: | ||
- ID=2 | ||
- LOG=${LOG:-ethermintd.log} | ||
node2: | ||
image: ${ETHERMINT_IMAGE} | ||
ports: | ||
- "26659:26657" | ||
- "8565:8545" | ||
- "8566:8546" | ||
- "8127:8125" | ||
volumes: | ||
- ./localnet-setup/node2/ethermintd:/ethermint:Z | ||
- ./client-data/node2/ethermintd:/root/.ethermintd | ||
networks: | ||
- localnet | ||
entrypoint: "bash start-docker.sh" | ||
- ethermint | ||
|
||
ethermintdnode3: | ||
container_name: ethermintdnode3 | ||
image: "ethermintd/node" | ||
environment: | ||
- ID=3 | ||
- LOG=${LOG:-ethermintd.log} | ||
node3: | ||
image: ${ETHERMINT_IMAGE} | ||
ports: | ||
- "26660:26657" | ||
- "8575:8545" | ||
- "8576:8546" | ||
- "8128:8125" | ||
volumes: | ||
- ./localnet-setup/node3/ethermintd:/ethermint:Z | ||
- ./client-data/node3/ethermintd:/root/.ethermintd | ||
networks: | ||
- localnet | ||
entrypoint: "bash start-docker.sh" | ||
- ethermint | ||
|
||
networks: | ||
localnet: | ||
ethermint: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
set -x | ||
|
||
init() { | ||
apt install pipx | ||
pipx install toml-cli | ||
} | ||
|
||
info() { | ||
exec >"$FUNCNAME.log" 2>&1 | ||
# cloc . | ||
find . -not \( -path */node_modules -prune \) -iname '*.md' | ||
find . -not \( -path */node_modules -prune \) -iname '*.sh' | ||
find . -not \( -path */node_modules -prune \) -iname '*make*' | ||
find . -not \( -path */node_modules -prune \) -iname '*docker*' | ||
} | ||
|
||
probe() { | ||
exec >"$FUNCNAME.log" 2>&1 | ||
# ethermintd --help | ||
# ethermintd version | ||
ethermintd keys add --help | ||
ethermintd init --help | ||
} | ||
|
||
probeImage() { | ||
IMAGE=ghcr.io/b2network/b2-node:20231031-162216-eb3cc87 | ||
docker run \ | ||
--rm \ | ||
-v /root/.ethermintd:/root/.ethermintd \ | ||
-v $PWD:/host \ | ||
-it $IMAGE \ | ||
sh | ||
} | ||
|
||
debugImage() { | ||
ethermintd start \ | ||
--metrics \ | ||
--pruning=nothing \ | ||
--rpc.unsafe \ | ||
--keyring-backend test \ | ||
--log_level info \ | ||
--json-rpc.api eth,txpool,personal,net,debug,web3 \ | ||
--api.enable | ||
} | ||
|
||
startOneNode(){ | ||
docker-compose up -d node1 | ||
} | ||
|
||
$@ |