Skip to content

Xahau/hooks-cli

Repository files navigation

Hooks CLI

Global Usage (For Using as a CLI)

Install:

npm i -g @xahau/hooks-cli

Use:

You can initialize a new project by running:

hooks-cli init

To build the c contracts, run:

hooks-cli compile-c contracts build --headers headers

or (alias)

c2wasm-cli contracts build --headers headers

This will compile the contracts directory and output the .wasm files into the build directory.

To build the js contracts, run:

hooks-cli compile-js contracts/base.ts build

or (alias)

js2wasm-cli contracts/base.ts build

This will compile the base.ts file and output the .bc file into the build directory.

To listen to the debug stream, run:

hooks-cli debug "Account 1" rG1QQv2nh2gr7RCZ1P8YYcBUKCCN633jCn

SDK Usage (For Using as an SDK)

Install:

npm install @xahau/hooks-cli

Usage:

import { buildDir } from "@xahau/hooks-cli";

const dirPath = "my/path/to/hooks/root/dir";
const outDir = "my/build/wasm/directory";
await buildDir(dirPath, outDir);

Development / Deployment

Build Repo

yarn run build

Build Executable Package

pkg .

Publish NPM Package

npm publish --access=public