zkgraph CLI
murongg opened this issue · comments
MuRong commented
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
# 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
Project folder
zkgraph-project
├── src
│ ├── mapping.ts
│ └── zkgraph.yaml
├── test
│ └── ...
├── package.json
├── package-lock.json
├── zkgraph.config.js
├── .gitignore
├── README.md
└── ...
2. Config payload.
We can use zkgraph.config.js
expose config.
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",
})
3. Plugin
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()]
})
4. Other command
zkgraph compile
zkgraph depoly
zkgraph publish <ipfs hash>
# more ...
Additional context
Add any other context or screenshots about the feature request here.
Norman commented
great proposal! looking forward to it.
btw, we can use zkgraph init
instead of zkgraph create