From 6ed28a9a3ce0a0bc0174eea77d092326212352f6 Mon Sep 17 00:00:00 2001 From: Alexey Date: Sat, 13 Jul 2019 00:56:17 +0300 Subject: [PATCH] update readme --- README.md | 11 +++++++++-- package.json | 6 +++--- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 405a251..a67a04a 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,21 @@ -## Testing +## Testing truffle 1. `npm i` -2. `npm run build:circuit` (or `cp Verifier.sol.temp build/circuits/Verifier.sol`) +2. `npm run build:circuit` 2. `npx truffle compile` 3. `npx truffle test` - it may fail for the first time, just run one more time. +## Testing js +1. `npm i` +2. `npm run build:circuit` +3. `cd scripts` +4. `node test_snark.js` + ## Deploy 1. `npx truffle migrate --network kovan --reset` ## Requirements 1. `node v11.15.0` +2. `npm install -g npx` diff --git a/package.json b/package.json index 70e052a..dc4ce51 100644 --- a/package.json +++ b/package.json @@ -4,10 +4,10 @@ "description": "", "main": "index.js", "scripts": { - "build:circuit:compile": "circom circuits/withdraw.circom -o build/circuits/withdraw.json && snarkjs info -c build/circuits/withdraw.json", - "build:circuit:setup": "snarkjs setup --protocol groth -c build/circuits/withdraw.json --pk build/circuits/withdraw_proving_key.json --vk build/circuits/withdraw_verification_key.json", + "build:circuit:compile": "npx circom circuits/withdraw.circom -o build/circuits/withdraw.json && npx snarkjs info -c build/circuits/withdraw.json", + "build:circuit:setup": "npx snarkjs setup --protocol groth -c build/circuits/withdraw.json --pk build/circuits/withdraw_proving_key.json --vk build/circuits/withdraw_verification_key.json", "build:circuit:bin": "node node_modules/websnark/tools/buildpkey.js -i build/circuits/withdraw_proving_key.json -o build/circuits/withdraw_proving_key.bin", - "build:circuit:contract": "snarkjs generateverifier -v build/circuits/Verifier.sol --vk build/circuits/withdraw_verification_key.json", + "build:circuit:contract": "npx snarkjs generateverifier -v build/circuits/Verifier.sol --vk build/circuits/withdraw_verification_key.json", "build:circuit": "mkdir -p build/circuits && npm run build:circuit:compile && npm run build:circuit:setup && npm run build:circuit:bin && npm run build:circuit:contract", "build:contract": "npx truffle compile", "test": "npx truffle test",