Skip to content

Commit

Permalink
Add Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
csdtowards committed Aug 8, 2024
1 parent d357a32 commit 8dcad94
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ inabox/anvil.pid
test/testdata/*
inabox/resources/kzg/SRSTables/*

run/
run/*
!run/start.sh
!run/run.sh

**/bin/*
coverage.*
Expand Down
8 changes: 8 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM ubuntu

RUN apt-get update

VOLUME ["/runtime"]
COPY ./disperser/bin/combined /bin/combined
WORKDIR /runtime
CMD /runtime/run.sh
32 changes: 32 additions & 0 deletions run/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/bin/combined \
--chain.rpc \
--chain.private-key \
--chain.receipt-wait-rounds 180 \
--chain.receipt-wait-interval 1s \
--chain.gas-limit 2000000 \
--combined-server.use-memory-db \
--combined-server.storage.kv-db-path /runtime/ \
--combined-server.storage.time-to-expire 2592000 \
--disperser-server.grpc-port 51001 \
--batcher.da-entrance-contract \
--batcher.da-signers-contract 0x0000000000000000000000000000000000001000 \
--batcher.finalizer-interval 20s \
--batcher.confirmer-num 3 \
--batcher.max-num-retries-for-sign 3 \
--batcher.finalized-block-count 50 \
--batcher.batch-size-limit 500 \
--batcher.encoding-interval 3s \
--batcher.encoding-request-queue-size 1 \
--batcher.pull-interval 10s \
--batcher.signing-interval 3s \
--batcher.signed-pull-interval 20s \
--batcher.expiration-poll-interval 3600 \
--encoder-socket \
--encoding-timeout 600s \
--signing-timeout 600s \
--chain-read-timeout 12s \
--chain-write-timeout 13s \
--combined-server.log.level-file trace \
--combined-server.log.level-std trace \
--disperser-server.retriever-address \
--combined-server.log.path /runtime/run.log
13 changes: 13 additions & 0 deletions run/start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash
set -e

IMAGE_NAME="0gclient:latest"
CONTAINER_NAME="daclient"

HOST_PORT=51001
CONTAINER_PORT=51001

docker run -d -v .:/runtime --name=$CONTAINER_NAME -p $HOST_PORT:$CONTAINER_PORT --restart=always $IMAGE_NAME

echo "Checking if container is running..."
docker ps --filter "name=$CONTAINER_NAME"

0 comments on commit 8dcad94

Please sign in to comment.