diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..93ee6d4 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,5 @@ +.vscode +.dockerignore +.gitignore +.COPYING +README.md \ No newline at end of file diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..a4309c7 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,15 @@ +name: Build Docker Image + +on: + pull_request: + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Build Docker image + run: docker build . \ No newline at end of file diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..3406316 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,27 @@ +name: Build and Publish to Docker Hub + +on: + push: + branches: + - main # Trigger this workflow on push to main branch + +jobs: + build-and-publish: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Log in to Docker Hub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Build and push Docker image + uses: docker/build-push-action@v2 + with: + context: . + push: true + tags: aayushg0/rapidsnark:latest \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..53c5256 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,22 @@ +FROM ubuntu:jammy + +RUN apt-get update && apt-get upgrade -y + +# Update the package list and install necessary dependencies +ENV DEBIAN_FRONTEND=noninteractive +RUN apt-get update && \ + apt install -y nodejs npm cmake build-essential pkg-config libssl-dev libgmp-dev libsodium-dev nasm awscli git tar + +RUN npm install -g yarn npx + +# Clone rapidsnark +COPY . ./rapidsnark +WORKDIR /rapidsnark + +RUN git submodule init +RUN git submodule update +RUN npm install +RUN npx task createFieldSources +RUN npx task buildPistache +RUN npx task buildProver +RUN chmod +x /rapidsnark/build/prover \ No newline at end of file diff --git a/README.md b/README.md index 0700b04..5e20816 100644 --- a/README.md +++ b/README.md @@ -60,7 +60,7 @@ node tools/request.js ```` ## Benchmark -This prover uses intel assembly with ADX extensions and parallelizes as much as it can the proof generation. +This prover uses intel assembly with ADX extensions and parallelizes as much as it can the proof generation. The prover is much faster that snarkjs and faster than bellman. diff --git a/depends/pistache b/depends/pistache index ae073a0..a68ad09 160000 --- a/depends/pistache +++ b/depends/pistache @@ -1 +1 @@ -Subproject commit ae073a0709ed1d6f0c28db90766c64b06f0366e6 +Subproject commit a68ad0902d2cfc23f69fc16e26747ac77bc2f123 diff --git a/tasksfile.js b/tasksfile.js index aaed0c6..246ac38 100644 --- a/tasksfile.js +++ b/tasksfile.js @@ -9,7 +9,7 @@ function createFieldSources() { sh("npm install", {cwd: "depends/ffiasm"}); sh("node ../depends/ffiasm/src/buildzqfield.js -q 21888242871839275222246405745257275088696311157297823662689037894645226208583 -n Fq", {cwd: "build"}); sh("node ../depends/ffiasm/src/buildzqfield.js -q 21888242871839275222246405745257275088548364400416034343698204186575808495617 -n Fr", {cwd: "build"}); - + if (process.platform === "darwin") { sh("nasm -fmacho64 --prefix _ fq.asm", {cwd: "build"}); } else if (process.platform === "linux") {