Open murongg opened 1 year ago
Is your feature request related to a problem? Please describe.
Describe the solution you'd like
Extract API functionality, transform to CLI. I believe that users do not need to pay excessive attention to the code of the API.
Describe alternatives you've considered
# create project using the default template zkgraph create <project name> # create project using the `hello` template zkgraph create <project name> --template hello # create project with TypeScript zkgraph create <project name> --typescript
zkgraph-project ├── src │ ├── mapping.ts │ └── zkgraph.yaml ├── test │ └── ... ├── package.json ├── package-lock.json ├── zkgraph.config.js ├── .gitignore ├── README.md └── ...
We can use zkgraph.config.js expose config.
zkgraph.config.js
import { defineConfig } from '@hyperoracle/zkgraph-cli' export default defineConfig({ // Update your Etherum JSON RPC provider URL here. // It is recommended to use providers that support debug_getRawReceipts RPC method. JsonRpcProviderUrl: { mainnet: "xxx", // Optional sepolia: "xxx", // Optional goerli: "xxx" // Optional }, // Update your private key here to sign zkwasm messages. // Please note that (during testnet phrase) your address balance (in zkwasm server) should > 0; UserPrivateKey: "0x0", ZkwasmProviderUrl: "xxx", CompilerServerEndpoint: "xxx", PinataEndpoint: "xxx", PinataJWT: "xxx.xxx.xxx", WasmBinPath: "build/zkgraph_full.wasm", LocalWasmBinPath: "build/zkgraph_local.wasm", })
Handle operations that we have not provided but users want to handle.
import { defineConfig } from '@hyperoracle/zkgraph-cli' function createExamplePlugin(unknownArgs) { // do someting } export default defineConfig({ plugins: [createExamplePlugin()] })
zkgraph compile zkgraph depoly zkgraph publish <ipfs hash> # more ...
Additional context Add any other context or screenshots about the feature request here.
great proposal! looking forward to it.
btw, we can use zkgraph init instead of zkgraph create
zkgraph init
zkgraph create
Is your feature request related to a problem? Please describe.
Describe the solution you'd like
Extract API functionality, transform to CLI. I believe that users do not need to pay excessive attention to the code of the API.
Describe alternatives you've considered
1. Create initialize template
Project folder
2. Config payload.
We can use
zkgraph.config.js
expose config.3. Plugin
Handle operations that we have not provided but users want to handle.
4. Other command
Additional context Add any other context or screenshots about the feature request here.