npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@ora-io/cle-cli

v0.1.6

Published

## Getting Started

Downloads

2

Readme

CLE CLI

Getting Started

Creating Your First CLE Project

With NPM:

npm create cle@latest

With Yarn:

yarn create cle@latest

With PNPM:

pnpm create cle@latest

Then follow the prompts!

To create a uniswapprice template, you can directly specify the project name and the desired template using additional command line options. For instance, you can run the following command:

# npm 6.x
npm create cle@latest my-cle-uniswapprice --template uniswapprice

# npm 7+, extra double-dash is needed:
npm create cle@latest my-cle-uniswapprice -- --template uniswapprice

# yarn
yarn create cle@latest my-cle-uniswapprice --template uniswapprice

# pnpm
pnpm create cle@latest my-cle-uniswapprice --template uniswapprice

CLI

Note: unsafe (define unsafe: true in the cle.yaml) means the CLE is compiled locally and only contains partial computation (so that proving and executing will be faster).

The workflow of local CLE development must follow: Develop (code in /src) -> Compile (get compiled wasm image) -> Execute (get expected output) -> Prove (generate input and pre-test for actual proving in zkOracle) -> Verify (verify proof on-chain).

To upload and publish your CLE, you should Upload (upload code to IPFS), and then Publish (register CLE on onchain CLE Registry).

Compile

Compile for Full Image (Link Compiled with Compiler Server).

Usage

cle compile [root]

Options

| Options | Description | | -------------------- | ------------------------------------- | | --yaml-path <path> | Path to yaml file | | --dir <path> | Path to directory containing cle.yaml |

Execute

Execute Full Image.

Please save the CLE_STATE_OUTPUT string for following prove steps.

Usage

cle exec [...params] [root]

Usage cases

cle exec <blockId> [root]
cle exec <blockId> <offchainData> [root]

Arguments

| Arguments | Description | | ---------------- | ----------------------------------------------- | | <block id> | Block number (or block hash) as runtime context | | <offchainData> | offchain data |

Set Up

Set Up Full Image

  • circuit-size: Specify the circuit size of image instead of the default recommended. eg. cle setup -- --circuit-size <size> (eg. 22).

Usage

cle setup [root]

Options

| Options | Description | | --------------------------- | -------------------------------- | | -k, --circuit-size <size> | Circuit size (k in 2^k) of image |

Prove

Prove Full Image

Usage

cle prove [...params] [root]

Usage cases

cle prove <blockId> <expectedStateStr> [root]
cle prove <blockId> <offchainData> <expectedStateStr> [root]

Arguments

| Arguments | Description | | ------------------ | ----------------------------------------------- | | <block id> | Block number (or block hash) as runtime context | | <expected state> | State output of the CLE execution | | <offchainData> | offchain data |

Options

| Options | Description | | ---------------- | ---------------------------- | | -i, --inputgen | Run in input generation Mode | | -t, --test | Run in test Mode | | -p, --prove | Run in prove Mode |

Upload

Upload CLE (Code and Full Image).

Please save the ipfs_hash from the output dialog for following publish steps.

Usage

cle upload [root]

Verify

Verify Proof Onchain.

Usage

cle verify <prove task id>

Arguments

| Arguments | Description | | ----------------- | --------------------- | | <prove task id> | Task id of prove task |

Publish

Publish and Register CLE Onchain.

See also: Verifier Contract Interface.

Usage

cle publish <ipfs_hash> [bounty_reward_per_trigger]

Arguments

| Arguments | Description | | ----------------------------- | -------------------------------- | | <ipfs hash> | IPFS hash of uploaded CLE | | [bounty reward per trigger] | Bounty reward per trigger in ETH |

Deposit

Publish and register CLE Onchain.

Usage

cle deposit <deployed contract address> <deposit amount>

Arguments

| Arguments | Description | | ----------------------------- | ---------------------------------------------------------- | | <deployed contract address> | Contract address of deployed verification contract address | | <deposit amount> | Deposit amount in ETH |

Config

Configuring CLE

When running CLE from the command line, the tool will automatically attempt to locate a configuration file named cle.config.js in the project’s root directory. It also supports other file extensions such as JS and TS.

The most basic config file looks like this:

// cle.config.js
export default {
  // config options
}

You can also explicitly specify a config file to use with the --config CLI option (resolved relative to cwd):

cle --config my-config.js

Config Intellisense

Since CLE ships with TypeScript typings, you can leverage your IDE's intellisense with jsdoc type hints:

/** @type {import('@ora-io/cle-cli').UserConfig} */
export default {
  // ...
}

Alternatively, you can use the defineConfig helper which should provide intellisense without the need for jsdoc annotations:

import { defineConfig } from '@ora-io/cle-cli'

export default defineConfig({
  // ...
})

CLE also directly supports TS config files. You can use cle.config.ts with the defineConfig helper as well.

Config Options

JsonRpcProviderUrl

  • Type: object
  • Default: { mainet: "", sepolia: "", goerli: ""}

Update your Etherum JSON RPC provider URL here. It is recommended to use providers that support debug_getRawReceipts RPC method.

UserPrivateKey

  • Type: string

Update your private key here to sign messages & send txs. The CLI will inform you before sending out any tx. The cle.config.ts is in .gitignore by default. CLI will never upload / disclose your private key by default.

ProverProviderUrl

  • Type: string
  • Default: https://rpc.zkwasmhub.com:8090

CompilerServerEndpoint

  • Type: string
  • Default: https://compiler.ora.io/compile/

PinataEndpoint

  • Type: string
  • Default: https://api.pinata.cloud/pinning/pinFileToIPFS

PinataJWT

  • Type: string

WasmBinPath

  • Type: string
  • Default: [root]/build/cle.wasm

CLE CLI Build-In a tag name is root.
The root is user project root path.
Of course, you can also place this tag at any position within the string.