Skip to content
This repository has been archived by the owner on Mar 3, 2024. It is now read-only.

zkgraph CLI #76

Open
murongg opened this issue Oct 5, 2023 · 1 comment
Open

zkgraph CLI #76

murongg opened this issue Oct 5, 2023 · 1 comment
Labels

Comments

@murongg
Copy link
Contributor

murongg commented Oct 5, 2023

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.

@murongg murongg changed the title zkgraph cli zkgraph CLI Oct 5, 2023
@murongg murongg added the feature label Oct 7, 2023
@nom4dv3
Copy link
Member

nom4dv3 commented Oct 8, 2023

great proposal! looking forward to it.

btw, we can use zkgraph init instead of zkgraph create

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants