Skip to content

Commit

Permalink
Merge pull request #20 from bobanetwork/souradeep/zkRand_ops
Browse files Browse the repository at this point in the history
feat: add docker images for services
  • Loading branch information
kitounliu authored Jul 16, 2024
2 parents a68fe7c + 3fff770 commit ed569c6
Show file tree
Hide file tree
Showing 6 changed files with 189 additions and 0 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ halo2_gadgets = { git = "https://github.com/kitounliu/halo2.git", branch = "grum
halo2wrong = { git = "https://github.com/kitounliu/halo2wrong.git", branch = "grumpkin"}
halo2_ecc ={ package = "ecc", git = "https://github.com/kitounliu/halo2wrong.git", branch = "grumpkin"}
halo2_maingate = { package = "maingate", git = "https://github.com/kitounliu/halo2wrong.git", branch = "grumpkin"}
halo2_proofs = { git = "https://github.com/kitounliu/halo2.git", branch = "grumpkin"}

sha3 = "0.10"
rand_core = { version = "0.6", default-features = false }
Expand Down
108 changes: 108 additions & 0 deletions ops/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
version: '3'

services:
admin:
build:
context: .
dockerfile: Dockerfile.admin
container_name: admin_service
environment:
- L2_NODE_WEB3_URL: "https://sepolia.boba.network"
- POLLING_INTERVAL: 12000
- ZK_RAND_ADDRESS: "0xd688cFE3EC08d893E9A3b76f12113e1ef762f53A"
- ADMIN_PRIVATE_KEY: "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80"
- NODE_ONE_ADDRESS: "0x70997970c51812dc3a010c7d01b50e0d17dc79c8"
- NODE_TWO_ADDRESS: "0x3c44cdddb6a900fa2b585dd299e03d12fa4293bc"
- NODE_THREE_ADDRESS: "0x90f79bf6eb2c4f870365e785982e1f101e93b906"
- NODE_FOUR_ADDRESS: "0x15d34aaf54267db7d7c367839aaf71a00a2c6a65"
- NODE_FIVE_ADDRESS: "0x9965507d1a55bcc2695c58ba16fb37d819b0a4dc"

nodeOne:
build:
context: .
dockerfile: Dockerfile.node
container_name: node_service
environment:
- L2_NODE_WEB3_URL: "https://sepolia.boba.network"
- POLLING_INTERVAL: 12000
- ZK_RAND_ADDRESS: "0xd688cFE3EC08d893E9A3b76f12113e1ef762f53A"
- NODE_PRIVATE_KEY: "0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d"
- NODE_ONE_ADDRESS: "0x70997970c51812dc3a010c7d01b50e0d17dc79c8"
- NODE_TWO_ADDRESS: "0x3c44cdddb6a900fa2b585dd299e03d12fa4293bc"
- NODE_THREE_ADDRESS: "0x90f79bf6eb2c4f870365e785982e1f101e93b906"
- NODE_FOUR_ADDRESS: "0x15d34aaf54267db7d7c367839aaf71a00a2c6a65"
- NODE_FIVE_ADDRESS: "0x9965507d1a55bcc2695c58ba16fb37d819b0a4dc"
depends_on:
- admin

nodeTwo:
build:
context: .
dockerfile: Dockerfile.node
container_name: node_service
environment:
- L2_NODE_WEB3_URL: "https://sepolia.boba.network"
- POLLING_INTERVAL: 12000
- ZK_RAND_ADDRESS: "0xd688cFE3EC08d893E9A3b76f12113e1ef762f53A"
- NODE_PRIVATE_KEY: "0x5de4111afa1a4b94908f83103eb1f1706367c2e68ca870fc3fb9a804cdab365a"
- NODE_ONE_ADDRESS: "0x70997970c51812dc3a010c7d01b50e0d17dc79c8"
- NODE_TWO_ADDRESS: "0x3c44cdddb6a900fa2b585dd299e03d12fa4293bc"
- NODE_THREE_ADDRESS: "0x90f79bf6eb2c4f870365e785982e1f101e93b906"
- NODE_FOUR_ADDRESS: "0x15d34aaf54267db7d7c367839aaf71a00a2c6a65"
- NODE_FIVE_ADDRESS: "0x9965507d1a55bcc2695c58ba16fb37d819b0a4dc"
depends_on:
- admin

nodeThree:
build:
context: .
dockerfile: Dockerfile.node
container_name: node_service
environment:
- L2_NODE_WEB3_URL: "https://sepolia.boba.network"
- POLLING_INTERVAL: 12000
- ZK_RAND_ADDRESS: "0xd688cFE3EC08d893E9A3b76f12113e1ef762f53A"
- NODE_PRIVATE_KEY: "0x7c852118294e51e653712a81e05800f419141751be58f605c371e15141b007a6"
- NODE_ONE_ADDRESS: "0x70997970c51812dc3a010c7d01b50e0d17dc79c8"
- NODE_TWO_ADDRESS: "0x3c44cdddb6a900fa2b585dd299e03d12fa4293bc"
- NODE_THREE_ADDRESS: "0x90f79bf6eb2c4f870365e785982e1f101e93b906"
- NODE_FOUR_ADDRESS: "0x15d34aaf54267db7d7c367839aaf71a00a2c6a65"
- NODE_FIVE_ADDRESS: "0x9965507d1a55bcc2695c58ba16fb37d819b0a4dc"
depends_on:
- admin

nodeFour:
build:
context: .
dockerfile: Dockerfile.node
container_name: node_service
environment:
- L2_NODE_WEB3_URL: "https://sepolia.boba.network"
- POLLING_INTERVAL: 12000
- ZK_RAND_ADDRESS: "0xd688cFE3EC08d893E9A3b76f12113e1ef762f53A"
- NODE_PRIVATE_KEY: "0x47e179ec197488593b187f80a00eb0da91f1b9d0b13f8733639f19c30a34926a"
- NODE_ONE_ADDRESS: "0x70997970c51812dc3a010c7d01b50e0d17dc79c8"
- NODE_TWO_ADDRESS: "0x3c44cdddb6a900fa2b585dd299e03d12fa4293bc"
- NODE_THREE_ADDRESS: "0x90f79bf6eb2c4f870365e785982e1f101e93b906"
- NODE_FOUR_ADDRESS: "0x15d34aaf54267db7d7c367839aaf71a00a2c6a65"
- NODE_FIVE_ADDRESS: "0x9965507d1a55bcc2695c58ba16fb37d819b0a4dc"
depends_on:
- admin

nodeFive:
build:
context: .
dockerfile: Dockerfile.node
container_name: node_service
environment:
- L2_NODE_WEB3_URL: "https://sepolia.boba.network"
- POLLING_INTERVAL: 12000
- ZK_RAND_ADDRESS: "0xd688cFE3EC08d893E9A3b76f12113e1ef762f53A"
- NODE_PRIVATE_KEY: "0x8b3a350cf5c34c9194ca85829a2df0ec3153be0318b5e2d3348e872092edffba"
- NODE_ONE_ADDRESS: "0x70997970c51812dc3a010c7d01b50e0d17dc79c8"
- NODE_TWO_ADDRESS: "0x3c44cdddb6a900fa2b585dd299e03d12fa4293bc"
- NODE_THREE_ADDRESS: "0x90f79bf6eb2c4f870365e785982e1f101e93b906"
- NODE_FOUR_ADDRESS: "0x15d34aaf54267db7d7c367839aaf71a00a2c6a65"
- NODE_FIVE_ADDRESS: "0x9965507d1a55bcc2695c58ba16fb37d819b0a4dc"
depends_on:
- admin
39 changes: 39 additions & 0 deletions ops/docker/Dockerfile.admin
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
FROM node:20

RUN apt-get update && apt-get install -y curl \
&& curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y \
&& echo 'export PATH="$HOME/.cargo/bin:$PATH"' >> $HOME/.bashrc

RUN apt-get install -y \
llvm \
clang \
libclang-dev \
axel

ENV LIBCLANG_PATH=/usr/lib/llvm-14/lib

COPY ./package.json .
RUN yarn install

COPY ./contracts ./contracts
COPY ./hardhat.config.ts .
RUN yarn run build

COPY ./Cargo.toml .
COPY ./Cargo.lock .
COPY ./bin ./bin
COPY ./benches ./benches
COPY ./src ./src
ENV PATH="/root/.cargo/bin:${PATH}"
RUN cargo build --release

COPY download_params.sh .
RUN chmod +x download_params.sh
RUN ./download_params.sh

COPY ./data ./data
RUN RUST_LOG=info ./target/release/client setup -s

COPY ./tsconfig.json .
COPY ./services ./services
CMD ["yarn", "run", "services:admin"]
39 changes: 39 additions & 0 deletions ops/docker/Dockerfile.node
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
FROM node:20

RUN apt-get update && apt-get install -y curl \
&& curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y \
&& echo 'export PATH="$HOME/.cargo/bin:$PATH"' >> $HOME/.bashrc

RUN apt-get install -y \
llvm \
clang \
libclang-dev \
axel

ENV LIBCLANG_PATH=/usr/lib/llvm-14/lib

COPY ./package.json .
RUN yarn install

COPY ./contracts ./contracts
COPY ./hardhat.config.ts .
RUN yarn run build

COPY ./Cargo.toml .
COPY ./Cargo.lock .
COPY ./bin ./bin
COPY ./benches ./benches
COPY ./src ./src
ENV PATH="/root/.cargo/bin:${PATH}"
RUN cargo build --release

COPY download_params.sh .
RUN chmod +x download_params.sh
RUN ./download_params.sh

COPY ./data ./data
RUN RUST_LOG=info ./target/release/client setup -s

COPY ./tsconfig.json .
COPY ./services ./services
CMD ["yarn", "run", "services:node"]
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"scripts": {
"test": "npx hardhat test",
"deploy": "npx hardhat run scripts/deploy.ts",
"build": "npx hardhat compile",
"admin": "npx hardhat run scripts/admin.ts",
"admin:restart": "RESTART=true npx hardhat run scripts/admin.ts",
"register": "npx hardhat run scripts/register.ts",
Expand Down

0 comments on commit ed569c6

Please sign in to comment.