- Install Docker;
- Install Node.js;
- Install Python2.7;
- npm configuration:
npm config set python path/to/python2.7
- npm configuration:
- Install Truffle;
npm install -g truffle
- Install Ganache.
Under the root directory of project:
npm install
then
cd zkp
npm run setup -- -i gm17/parent-dir-of-pcode/
-i
Specify the directory where the ZoKrates code is stored (.code file)
Alternatively you can process all of the folders under /gm17
in one go by using:
npm run setup
Note that this will take about 1hr to complete.
npm run setup
will:
- compile:
out
out.code
- setup:
proof.json
proving.key
- export-verifier:
verification.key
verifier.sol
These files are generated inside the docker container and then moved to the project path corresponding to each operation zkp/code/gm17/parent-dir-of-pcode
- Start the Ganache node in the local environment and ensure that the parameters after the running node are consistent with truffle-config.js;
- Run
truffle migrate --reset
ornpm run deploy
under the root directory, This will compile and deploy all smart contracts used by the project. - Register the vkId:
npm run setVk
- All processes for verifying the protocol:
npm run daap
Note:After changing the ZoKrates or solidity code, you need to delete the file zkp/src/vkIds.json
, and then redeploy the contract and register the vkId.