This code is not owned by EY and EY provides no warranty and disclaims any and all liability for use of this code. Users must conduct their own diligence with respect to use for their purposes and any and all usage is on an as-is basis and at your own risk.
This is a Node.js wrapper around zokrates-zexe.
To use install package, you must be logged in to the github npm package repository. To do that you need a personal access token (it's easy to generate if you don't have one - the same token can be used for docker too). Log in like this (when you are asked for a username, paste your access token):
$ npm login --registry=https://npm.pkg.github.com
After that, you can install it with:
$ npm install --save npm install @eyblockchain/zokrates-zexe.js
or add it to your package.json file. If you push code changes, you will (for now) need to manually bump the package.json version or the npm package won't publish. We'll automate that soon
This library is meant to be used through Docker containers running a Linux OS. In the Dockerfile that will be running this library, you need to include the ZoKrates library as a builder, as such:
FROM docker.pkg.github.com/eyblockchain/zokrates-zexe/zokrates_zexe:latest as builder
In the same Dockerfile, you then need to copy over the ZoKrates executable as well.
COPY --from=builder /home/zokrates/zokrates /app/zokrates
COPY --from=builder /home/zokrates/.zokrates* /app/stdlib
From then, you can import and use ZoKrates as any other standard Node library.