Update setup for external go-nitro node

This commit is contained in:
Prathamesh Musale 2023-10-17 17:55:42 +05:30
parent 6936c07e4f
commit 5c4945cafb
7 changed files with 40 additions and 23 deletions

View File

@ -11,10 +11,13 @@ services:
condition: service_completed_successfully
environment:
CERC_NITRO_CHAIN_URL: ${CERC_NITRO_CHAIN_URL:-ws://fixturenet-eth-geth-1:8546}
CERC_NITRO_PK: ${CERC_NITRO_PK:-2d999770f7b5d49b694080f987b82bbc9fc9ac2b4dcc10b0f8aba7d700f69c6d}
CERC_NITRO_CHAIN_PK: ${CERC_NITRO_CHAIN_PK:-570b909da9669b2f35a0b1ac70b8358516d55ae1b5b3710e95e9a94395090597}
CERC_NITRO_PK: ${CERC_NITRO_PK:-febb3b74b0b52d0976f6571d555f4ac8b91c308dfa25c7b58d1e6a7c3f50c781}
CERC_NITRO_CHAIN_PK: ${CERC_NITRO_CHAIN_PK:-be4aa664815ea3bc3d63118649a733f6c96b243744310806ecb6d96359ab62cf}
CERC_NITRO_USE_DURABLE_STORE: ${CERC_NITRO_USE_DURABLE_STORE:-true}
CERC_NITRO_DURABLE_STORE_FOLDER: ${CERC_NITRO_DURABLE_STORE_FOLDER:-/app/data/nitro-store}
CERC_NITRO_MSG_PORT: ${CERC_NITRO_MSG_PORT:-3006}
CERC_NITRO_WS_MSG_PORT: ${CERC_NITRO_WS_MSG_PORT:-5006}
CERC_NITRO_RPC_PORT: ${CERC_NITRO_RPC_PORT:-4006}
CERC_NA_ADDRESS: ${CERC_NA_ADDRESS}
CERC_VPA_ADDRESS: ${CERC_VPA_ADDRESS}
CERC_CA_ADDRESS: ${CERC_CA_ADDRESS}
@ -23,26 +26,17 @@ services:
- go_nitro_data:/app/data
- nitro_deployment:/app/deployment
- ../config/go-nitro/run-nitro-node.sh:/app/run-nitro-node.sh
- ../config/go-nitro/tls:/app/tls
healthcheck:
test: ["CMD", "nc", "-vz", "localhost", "4005"]
test: ["CMD", "nc", "-vz", "localhost", "4006"]
interval: 10s
timeout: 5s
retries: 10
start_period: 10s
ports:
- "3005"
- "4005:4005"
- "5005:5005"
nitro-rpc-client:
image: cerc/nitro-rpc-client:local
hostname: nitro-rpc-client
restart: on-failure
depends_on:
# Wait for the go-nitro node to start
go-nitro:
condition: service_healthy
command: ["bash", "-c", "tail -f /dev/null"]
- "3006:3006"
- "4006:4006"
- "5006:5006"
volumes:
go_nitro_data:

View File

@ -44,12 +44,13 @@ services:
- eth_server_nitro_data:/app/nitro-data
- nitro_deployment:/app/deployment
- ../config/ipld-eth-server/entrypoint.sh:/app/entrypoint.sh
- ../config/go-nitro/tls:/app/nitroTLS
ports:
- "8081"
- "8082"
- "8090"
- "40000"
- "3005"
- "3005:3005"
- "4005:4005"
- "5005:5005"
healthcheck:

View File

@ -47,4 +47,4 @@ while true; do
sleep $retry_interval
done
./nitro -chainurl ${CERC_NITRO_CHAIN_URL} -msgport 3005 -rpcport 4005 -wsmsgport 5005 -pk ${CERC_NITRO_PK} -chainpk ${CERC_NITRO_CHAIN_PK} -naaddress ${NA_ADDRESS} -vpaaddress ${VPA_ADDRESS} -caaddress ${CA_ADDRESS} -usedurablestore ${CERC_NITRO_USE_DURABLE_STORE} -durablestorefolder ${CERC_NITRO_DURABLE_STORE_FOLDER}
./nitro -chainurl ${CERC_NITRO_CHAIN_URL} -msgport ${CERC_NITRO_MSG_PORT} -rpcport ${CERC_NITRO_RPC_PORT} -wsmsgport ${CERC_NITRO_WS_MSG_PORT} -pk ${CERC_NITRO_PK} -chainpk ${CERC_NITRO_CHAIN_PK} -naaddress ${NA_ADDRESS} -vpaaddress ${VPA_ADDRESS} -caaddress ${CA_ADDRESS} -usedurablestore ${CERC_NITRO_USE_DURABLE_STORE} -durablestorefolder ${CERC_NITRO_DURABLE_STORE_FOLDER} -publicip "0.0.0.0"

View File

@ -31,6 +31,8 @@ else
done
fi
# TODO: Wait for chain endpoint
echo "Beginning the ipld-eth-server process"
START_CMD="./ipld-eth-server"

View File

@ -0,0 +1,16 @@
FROM golang:1.21-bullseye AS builder
# Copy files into image
WORKDIR /app
COPY . .
# Build the binary
RUN go build -v -o nitro .
# Reduce image size
FROM debian:bullseye-slim
RUN apt-get update
RUN apt-get install -y ca-certificates jq netcat
RUN rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY --from=builder /app/nitro .

View File

@ -3,4 +3,6 @@
source ${CERC_CONTAINER_BASE_DIR}/build-base.sh
docker build -t cerc/go-nitro:local -f ${CERC_REPO_BASE_DIR}/go-nitro/docker/local/Dockerfile ${build_command_args} ${CERC_REPO_BASE_DIR}/go-nitro
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
docker build -t cerc/go-nitro:local -f ${SCRIPT_DIR}/Dockerfile ${build_command_args} ${CERC_REPO_BASE_DIR}/go-nitro

View File

@ -7,10 +7,12 @@ repos:
- git.vdb.to/cerc-io/lighthouse
- git.vdb.to/cerc-io/ipld-eth-db@v5
# ipld-eth-server with payments -- to be used by ipld-eth-server-payments pod
- git.vdb.to/cerc-io/ipld-eth-server@payments
# - git.vdb.to/cerc-io/ipld-eth-server@payments
- git.vdb.to/deep-stack/ipld-eth-server@pm-external-nitro-node # TODO: Use payments branch after merging
# nitro repo
- github.com/cerc-io/ts-nitro@v0.1.13
- github.com/cerc-io/go-nitro@v0.1.1-ts-port-0.1.7
# - github.com/cerc-io/go-nitro@v0.1.1-ts-port-0.1.7
- github.com/deep-stack/go-nitro@nv-validate-voucher # TODO: Use release
# mobymask watcher repos
- github.com/cerc-io/watcher-ts@v0.2.65
- github.com/cerc-io/mobymask-v2-watcher-ts@v0.2.3
@ -31,7 +33,7 @@ containers:
- cerc/ipld-eth-db
- cerc/ipld-eth-server
- cerc/nitro-contracts
# - cerc/go-nitro
- cerc/go-nitro
- cerc/nitro-rpc-client
# mobymask watcher images
- cerc/watcher-ts
@ -47,7 +49,7 @@ pods:
- ipld-eth-server-payments
- ipld-eth-db
- nitro-contracts
# - go-nitro
- go-nitro
- nitro-rpc-client
- watcher-mobymask-v3
- mobymask-snap