zkcloudworker-cli

0.4.0 • Public • Published

zkcloudworker-cli

zkCloudWorker CLI tool

Installation

npm install -g zkcloudworker-cli

To confirm successful installation:

zkcw --version

or

zkcloudworker --version

Updating the zkCloudWorker CLI

npm update -g zkcloudworker-cli

Deploying the repo

zkcw deploy

or, to see the logs:

zkcw deploy -v

The package should have at the root directory index.ts file that exports the zkcloudworker function:

// index.ts at the package root directory
import { Cloud, zkCloudWorker, initBlockchain } from "zkcloudworker";
import { initializeBindings } from "o1js";
import { MyWorker } from "./src/worker";

export async function zkcloudworker(cloud: Cloud): Promise<zkCloudWorker> {
  await initializeBindings();
  await initBlockchain(cloud.chain);
  return new MyWorker(cloud);
}

and the directory in tsconfig.json for tsc compilation result should be dist:

"compilerOptions": {
    "outDir": "./dist"
}

Getting help

zkcw --help
Usage: zkCloudWorker [options] [command]

zkCloudWorker CLI tool

Options:
  -V, --version                output the version number
  -v, --verbose                verbose mode, print all logs
  -f, --folder <folder>        folder with repo
  -r, --repo <repo>            repo name
  -d, --developer <developer>  developer name
  -m, --manager <pm>           package manager: yarn | npm
  -j, --jwt <jwt>              JWT token
  -h, --help                   display help for command

Commands:
  deploy [options]             deploy the repo to the cloud
  config                       save default configuration
  help [command]               display help for command
Usage: zkCloudWorker deploy [options]

deploy the repo to the cloud

Options:
  -p, --protect               protect the deployment from changes
  -e, --exclude [folders...]  exclude files and folders from deployment
  -h, --help                  display help for command

Development

You need to install node and git and clone this repo

git clone https://github.com/zkcloudworker/zkcloudworker-cli
cd zkcloudworker-cli
touch yarn.lock
yarn

Running locally:

yarn cli

Package Sidebar

Install

npm i zkcloudworker-cli

Weekly Downloads

90

Version

0.4.0

License

Apache-2.0

Unpacked Size

97.3 kB

Total Files

42

Last publish

Collaborators

  • minanft