Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: dockerize for portability #7

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Build the prover
FROM node as builder

WORKDIR /rapidsnark

# install deps
RUN apt update && apt install build-essential libgmp-dev libsodium-dev nasm

COPY ./*.json tasksfile.js tools .
COPY ./.git ./.git
COPY ./depends ./depends
COPY ./src ./src

# install the node deps
RUN npm install && git submodule init && git submodule update

# build the fields
RUN npx task createFieldSources

# build the provder
RUN npx task buildProver

FROM ubuntu

WORKDIR /rapidsnark

RUN apt update -y && apt install -y build-essential libgmp-dev libsodium-dev nasm

COPY --from=builder /rapidsnark/build/prover /usr/local/bin/rapidsnark

CMD ["rapidsnark"]
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ npx task createFieldSources
npx task buildProver
````

## compile with docker
```sh
docker build . --tag=rapidsnark
```

## Building proof

You have a full prover compiled in the build directory.
Expand All @@ -40,6 +45,11 @@ by this one
./build/prove <circuit.zkey> <witness.wtns> <proof.json> <public.json>
````

or this one if using Docker
````sh
docker run rapidsnark <circuit.zkey> <witness.wtns> <proof.json> <public.json>
````

## Benchmark

This prover uses intel assembly with ADX extensions and parallelizes as much as it can the proof generation.
Expand Down