Compare commits

..

1 Commits

Author SHA1 Message Date
Micah Zoltu
f0ddbf34b3 Adds esbuild & Dockerfile, skips a failing test.
* Adds esbuild as a bundler.
* Adds Dockerfile for deterministic building of the bundle.

Important Note:
The failing groth16 test fails on upstream, which means it is failing on the version used in Tornado Classic UI.
This is unfortunate, but if it is a critical bug at least it isn't an escalation compared to current state of things.
2024-12-02 16:23:52 +08:00
4 changed files with 10 additions and 7283 deletions

View File

@@ -1,17 +1,17 @@
FROM node:22.11.0-alpine3.20@sha256:b64ced2e7cd0a4816699fe308ce6e8a08ccba463c757c00c14cd372e3d2c763e
WORKDIR /websnark/
WORKDIR /workspace/
# cache dependencies
COPY ./package.json ./package-lock.json /websnark/
RUN npm ci --ignore-scripts
COPY ./package.json ./package-lock.json /workspace/
RUN npm install --ignore-scripts --trace-warnings
COPY index.js main.js /websnark/
COPY ./src/ /websnark/src/
COPY ./tools/ /websnark/tools/
COPY ./test/ /websnark/test/
COPY ./example/ /websnark/example/
RUN mkdir /websnark/build/
COPY index.js main.js /workspace/
COPY ./src/ /workspace/src/
COPY ./tools/ /workspace/tools/
COPY ./test/ /workspace/test/
COPY ./example/ /workspace/example/
RUN mkdir /workspace/build/
RUN npm run build
RUN node --test
RUN npx --no esbuild index.js --bundle --platform=browser --format=esm --outfile=build/bundle.mjs
RUN npx --no esbuild index.js --bundle --platform=browser --format=esm --outfile=bundle.mjs

View File

@@ -1,18 +1,3 @@
# Fork
This is a fork of the version of websnark that is used in the Tornado Classic UI. The changes here only seek to remove as many dependencies as possible, and make the project bundlable with a simple bundler like `esbuild`. A Dockerfile is included to facilitate deterministic builds of the generated `bundle.mjs` file. You can generate and extract the bundle file by doing:
```
docker image build --tag temp_image .
docker container create --name temp_container temp_image
docker container cp temp_container:/websnark/build/bundle.mjs bundle.mjs
docker container rm temp_container
docker image rm temp_image
```
The full set of changes between what Tornado Classic UI usse and this can be seen at https://github.com/tornadocash/websnark/compare/4c0af6a8b65aabea3c09f377f63c44e7a58afa6d...MicahZoltu:websnark:master, and details about each change can be seen in the commit messages.
Everything below in this Readme is from the original repository.
# websnark
A fast zkSnark proof generator written in native Web Assembly.

File diff suppressed because one or more lines are too long

View File

@@ -3,7 +3,6 @@
"version": "0.0.4",
"description": "big integer library to work in Zq",
"main": "index.js",
"module": "build/bundle.mjs",
"scripts": {
"test": "node --test",
"build": "node tools/buildwasm.js"