forked from Lorenzo-Protocol/lorenzo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
980f969
commit bb207af
Showing
5 changed files
with
138 additions
and
30 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
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,10 @@ | ||
all: lorenzod-env | ||
|
||
lorenzod-env: lorenzod-rmi | ||
docker build --tag lorenzo/lorenzod -f lorenzod-env/Dockerfile \ | ||
$(shell git rev-parse --show-toplevel) | ||
|
||
lorenzod-rmi: | ||
docker rmi lorenzo/lorenzod 2>/dev/null; true | ||
|
||
.PHONY: all lorenzod-env lorenzod-rmi |
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,23 @@ | ||
FROM golang:1.20-alpine AS build | ||
|
||
RUN apk add build-base git linux-headers | ||
|
||
WORKDIR /work | ||
COPY go.mod go.sum /work/ | ||
RUN go mod download | ||
|
||
COPY ./ /work | ||
RUN LEDGER_ENABLED=false make clean build | ||
|
||
|
||
FROM alpine AS run | ||
RUN apk add bash curl jq | ||
EXPOSE 26656 26657 | ||
ENTRYPOINT ["/usr/bin/wrapper.sh"] | ||
CMD ["start", "--log_format", "plain"] | ||
STOPSIGNAL SIGTERM | ||
VOLUME /lorenzod | ||
WORKDIR /lorenzod | ||
|
||
COPY contrib/images/lorenzod-env/wrapper.sh /usr/bin/wrapper.sh | ||
COPY --from=build /work/build/lorenzod /lorenzod/ |
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 -euo pipefail | ||
set -x | ||
|
||
BINARY=/lorenzod/${BINARY:-lorenzod} | ||
ID=${ID:-0} | ||
LOG=${LOG:-lorenzod.log} | ||
|
||
if ! [ -f "${BINARY}" ]; then | ||
echo "The binary $(basename "${BINARY}") cannot be found. Please add the binary to the shared folder." | ||
exit 1 | ||
fi | ||
|
||
export LORENZODHOME="/data/node${ID}/lorenzod" | ||
|
||
if [ -d "$(dirname "${LORENZODHOME}"/"${LOG}")" ]; then | ||
"${BINARY}" --home "${LORENZODHOME}" "$@" | tee "${LORENZODHOME}/${LOG}" | ||
else | ||
"${BINARY}" --home "${LORENZODHOME}" "$@" | ||
fi |
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,63 +1,98 @@ | ||
version: '3' | ||
version: "3" | ||
|
||
services: | ||
node0: | ||
lorenzonode0: | ||
container_name: lorenzonode0 | ||
image: "lorenzo/node" | ||
image: "lorenzo/lorenzod" | ||
environment: | ||
- DEBUG=1 | ||
- ID=0 | ||
- LOG=${LOG:-lorenzod.log} | ||
cap_add: | ||
- SYS_PTRACE | ||
security_opt: | ||
- seccomp:unconfined | ||
ports: | ||
- "26656-26657:26656-26657" | ||
- "1317:1317" | ||
- "9090:9090" | ||
- "2345:2345" | ||
volumes: | ||
- ./build/node0/lorenzod:/lorenzo:Z | ||
command: > | ||
lorenzod start --home /lorenzo | ||
- ./.testnets:/data:Z | ||
networks: | ||
localnet: | ||
ipv4_address: 192.167.10.1 | ||
ipv4_address: 192.168.10.2 | ||
|
||
node1: | ||
lorenzonode1: | ||
container_name: lorenzonode1 | ||
image: "lorenzo/node" | ||
image: "lorenzo/lorenzod" | ||
environment: | ||
- DEBUG=0 | ||
- ID=1 | ||
- LOG=${LOG:-lorenzod.log} | ||
cap_add: | ||
- SYS_PTRACE | ||
security_opt: | ||
- seccomp:unconfined | ||
ports: | ||
- "26659-26660:26656-26657" | ||
- "26666-26667:26656-26657" | ||
- "1318:1317" | ||
- "9091:9090" | ||
- "2346:2345" | ||
volumes: | ||
- ./build/node1/lorenzod:/lorenzo:Z | ||
command: > | ||
lorenzod start --home /lorenzo | ||
- ./.testnets:/data:Z | ||
networks: | ||
localnet: | ||
ipv4_address: 192.167.10.2 | ||
ipv4_address: 192.168.10.3 | ||
|
||
node2: | ||
lorenzonode2: | ||
container_name: lorenzonode2 | ||
image: "lorenzo/node" | ||
image: "lorenzo/lorenzod" | ||
environment: | ||
- DEBUG=0 | ||
- ID=2 | ||
- LOG=${LOG:-lorenzod.log} | ||
cap_add: | ||
- SYS_PTRACE | ||
security_opt: | ||
- seccomp:unconfined | ||
ports: | ||
- "26661-26662:26656-26657" | ||
- "26676-26677:26656-26657" | ||
- "1319:1317" | ||
- "9092:9090" | ||
- "2347:2345" | ||
volumes: | ||
- ./build/node2/lorenzod:/lorenzo:Z | ||
command: > | ||
lorenzod start --home /lorenzo | ||
- ./.testnets:/data:Z | ||
networks: | ||
localnet: | ||
ipv4_address: 192.167.10.3 | ||
ipv4_address: 192.168.10.4 | ||
|
||
node3: | ||
lorenzonode3: | ||
container_name: lorenzonode3 | ||
image: "lorenzo/node" | ||
image: "lorenzo/lorenzod" | ||
environment: | ||
- DEBUG=0 | ||
- ID=3 | ||
- LOG=${LOG:-lorenzod.log} | ||
cap_add: | ||
- SYS_PTRACE | ||
security_opt: | ||
- seccomp:unconfined | ||
ports: | ||
- "26663-26664:26656-26657" | ||
- "26686-26687:26656-26657" | ||
- "1320:1317" | ||
- "9093:9090" | ||
- "2348:2345" | ||
volumes: | ||
- ./build/node3/lorenzod:/lorenzo:Z | ||
command: > | ||
lorenzod start --home /lorenzo | ||
- ./.testnets:/data:Z | ||
networks: | ||
localnet: | ||
ipv4_address: 192.167.10.4 | ||
ipv4_address: 192.168.10.5 | ||
|
||
networks: | ||
localnet: | ||
driver: bridge | ||
ipam: | ||
driver: default | ||
config: | ||
- | ||
subnet: 192.167.10.0/24 | ||
- subnet: 192.168.10.0/25 |