| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
To create your zkGraph project based on this template, click Use this template, and Creating a new repository.
After clone your project, you need to create config.js file at root folder based on config-example.js
// ./config.js
export const config = {
// Etherum JSON RPC provider URL:
// (Please note the provider must support debug_getRawReceipts RPC method.)
JsonRpcProviderUrl: "https://{URL}",
};Then run:
npm installTo test the whole flow of the library, run this after you have done the configuration:
sh test.shThe workflow of local zkGraph development is: Develop (code in /src) -> Compile (to get compiled wasm image) -> Execute (to get expected output) -> Prove (to generate input and pre-test for actual proving) -> Deploy.
If you encounter any problem, please refer to the test.sh for the example usage of the commands.
npm run compile-localnpm run exec-local -- {block_id}npm run prove-local -- --inputgen {block_id} {expected_state}
npm run prove-local -- --pretest {block_id} {expected_state}The configuration (such as blockchain json rpc provider url) for the local development API.
The configuration for the zkGraph.
It specifies information including:
The logic of the event handler in AssemblyScript.
It specifies how to handle the event data and generate the output state.
export function handleEvents(events: Event[]): Bytes {
let state = new Bytes(0);
if (events.length > 0) {
state = events[0].address;
}
require(state.length == 20 ? 1 : 0);
return state;
}More info and API reference can be found in Hyper Oracle zkGraph docs.
References: WebAssembly Opcodes.
This repo has the following folders relevant to zkGraph development:
| Back | FazBrowse Home | New Git URL |