1
0
Fork 0
mirror of synced 2025-09-23 12:18:44 +00:00

remove dockerfile, update book

This commit is contained in:
dark64 2020-01-07 17:30:10 +01:00
parent 35bfac785e
commit dd10a7a015
2 changed files with 4 additions and 19 deletions

View file

@ -10,7 +10,7 @@ npm install zokrates-js
| Function | Description |
| ------ | ------ |
| initialize | Loads binding wasm module and sets necessary callbacks |
| initialize | Loads binding wasm module and returns a promise with ZoKrates provider |
| compile | Compiles source code into ZoKrates internal representation of arithmetic circuits |
| computeWitness | Computes a valid assignment of the variables, which include the results of the computation |
| setup | Generates a trusted setup for the compiled program |
@ -20,7 +20,7 @@ npm install zokrates-js
## Usage
```js
import * as zokrates from 'zokrates-js'
import { initialize } from 'zokrates-js';
function importResolver(location, path) {
// implement your resolving logic here
@ -30,8 +30,8 @@ function importResolver(location, path) {
};
}
zokrates.initialize(importResolver).then(() => {
initialize().then((zokratesProvider) => {
// we have to initialize the wasm module before calling api functions
zokrates.compile("def main(private field a) -> (field): return a", "main")
zokratesProvider.compile("def main(private field a) -> (field): return a", "main", importResolver)
});
```

View file

@ -1,15 +0,0 @@
FROM rustlang/rust:nightly as build
RUN curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh -s -- -y
COPY . src
RUN cd src/zokrates_js && wasm-pack build --out-name index --release --target bundler
FROM node:10-alpine
COPY --from=build src/zokrates_js src/zokrates_js
COPY --from=build src/zokrates_stdlib src/zokrates_stdlib
RUN cd src/zokrates_js && npm run setup \
&& cd / && mkdir build && mv src/zokrates_js/* /build \
&& rm -rf src