helper lib to communicate with zkwasm cloud service
npm install zkwasm-service-helperThis lib is to help communicate with zkwasm service
This lib main provide a ZkWasmServiceHelper class to help user to communicate to zkwasm service backend.
It mainly provide API to add tasks and get informations to zkwasm service backend.
like:
- async queryImage(md5: string);
- async loadTasks(query: QueryParams);
- async addNewWasmImage(task: WithSignature
- async addProvingTask(task: WithSignature
There are several examples of how to use this lib in the examples folder.
``bash`
cd examples
`bash`
npm install
User specific config values must be provided in the .env file:
- Change the values of SERVER_URL and PRIVATE_KEY to your own.CHAIN_ID
- Update the to a network chain id which have been deployed on the server, and update PROVIDER_URL to a valid RPC url.SUBMIT_AUTO_SUBMIT_PROOF
- Update the following env variables as per your test:
- : Set to true for submitting an Auto proof, otherwise false for Manual proof.MANUAL_TASK_ID_TO_VERIFY
- : Set to the task id of an existing task in which you want to verify the proof.AUTO_TASK_ID_TO_VERIFY
- : Set to the task id of any tasks within the auto submit batch which you want to verify.TASK_ID_TO_QUERY
- : Set to task id to query, by default this is used to fetch the external host table tar gz file.MD5_TO_QUERY
- : Set image MD5 to query, by default this is used for various task fetches in query script.
- To customize further you may change various variables within each of the scripts.
Running tasks examples:
`bashdata/image.wasmAdd a new image using wasm in
.
npx tsx src/tasks/addNewImage.ts
.Running verify examples:
`bash
Verify proof of task id
MANUAL_TASK_ID_TO_VERIFY
npx tsx src/verify/verifyProof.tsVerify auto submit batch which includes task id
AUTO_TASK_ID_TO_VERIFY
npx tsx src/verify/verifyAutoSubmitProof.ts
`Running query examples:
`bash
Run task related queries
npx tsx src/queries/task.tsRun auto submit task related queries
npx tsx src/queries/autosubmit.ts
``