-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: introduce docker localnet again
- Loading branch information
Showing
9 changed files
with
152 additions
and
3 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 |
---|---|---|
@@ -1 +1 @@ | ||
build/ | ||
integration-tests |
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,4 +1,5 @@ | ||
# OS | ||
.testnets | ||
.DS_Store | ||
*.swp | ||
*.swo | ||
|
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 |
---|---|---|
@@ -0,0 +1,76 @@ | ||
version: "3" | ||
|
||
services: | ||
node: | ||
container_name: node | ||
image: "terra-money/localnet-core" | ||
environment: | ||
- DEBUG=1 | ||
- ID=0 | ||
- LOG=${LOG:-core.log} | ||
cap_add: | ||
- SYS_PTRACE | ||
security_opt: | ||
- seccomp:unconfined | ||
ports: | ||
- "26656-26657:26656-26657" | ||
- "1317:1317" | ||
- "9090:9090" | ||
- "2345:2345" | ||
volumes: | ||
- ./.testnets:/terrad/data:Z | ||
networks: | ||
localnet: | ||
ipv4_address: 192.168.15.20 | ||
|
||
node_1: | ||
container_name: node_1 | ||
image: "terra-money/localnet-core" | ||
environment: | ||
- DEBUG=0 | ||
- ID=1 | ||
- LOG=${LOG:-core.log} | ||
cap_add: | ||
- SYS_PTRACE | ||
security_opt: | ||
- seccomp:unconfined | ||
ports: | ||
- "26666-26667:26656-26657" | ||
- "1318:1317" | ||
- "9091:9090" | ||
- "2346:2345" | ||
volumes: | ||
- ./.testnets:/terrad/data:Z | ||
networks: | ||
localnet: | ||
ipv4_address: 192.168.15.21 | ||
|
||
node_2: | ||
container_name: node_2 | ||
image: "terra-money/localnet-core" | ||
environment: | ||
- DEBUG=0 | ||
- ID=2 | ||
- LOG=${LOG:-core.log} | ||
cap_add: | ||
- SYS_PTRACE | ||
security_opt: | ||
- seccomp:unconfined | ||
ports: | ||
- "26676-26677:26656-26657" | ||
- "1319:1317" | ||
- "9092:9090" | ||
- "2347:2345" | ||
volumes: | ||
- ./.testnets:/terrad/data:Z | ||
networks: | ||
localnet: | ||
ipv4_address: 192.168.15.22 | ||
|
||
networks: | ||
localnet: | ||
driver: bridge | ||
ipam: | ||
driver: default | ||
config: | ||
- subnet: 192.168.15.0/25 |
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
FROM golang:1.20-bullseye AS build | ||
|
||
RUN apt update && apt install build-essential -y | ||
|
||
WORKDIR /terrad | ||
COPY . /terrad | ||
|
||
RUN make build | ||
|
||
FROM golang:1.20-bullseye AS run | ||
COPY ./scripts/containers/build-wrapper.sh /terrad/build-wrapper.sh | ||
RUN chmod +x /terrad/build-wrapper.sh | ||
RUN wget https://github.com/CosmWasm/wasmvm/releases/download/v1.5.2/libwasmvm.x86_64.so -P /usr/lib/ | ||
|
||
VOLUME /terrad | ||
COPY --from=build /terrad/ /terrad/ | ||
WORKDIR /terrad | ||
|
||
EXPOSE 26656 26657 | ||
ENTRYPOINT ["/terrad/build-wrapper.sh"] | ||
CMD ["start", "--log_format", "plain"] | ||
STOPSIGNAL SIGTERM |
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,20 @@ | ||
#!/usr/bin/env sh | ||
set -x | ||
|
||
export PATH=$PATH:/terrad/build/terrad | ||
BINARY=/terrad/build/terrad | ||
ID=${ID:-0} | ||
LOG=${LOG:-terrad.log} | ||
|
||
if ! [ -f "${BINARY}" ]; then | ||
echo "The binary $(basename "${BINARY}") cannot be found." | ||
exit 1 | ||
fi | ||
|
||
export TERRAD_HOME="/terrad/data/node${ID}/simd" | ||
|
||
if [ -d "$(dirname "${TERRAD_HOME}"/"${LOG}")" ]; then | ||
"${BINARY}" --home "${TERRAD_HOME}" "$@" | tee "${TERRAD_HOME}/${LOG}" | ||
else | ||
"${BINARY}" --home "${TERRAD_HOME}" "$@" | ||
fi |