Skip to content

Latest commit

 

History

History
83 lines (53 loc) · 1.27 KB

README.md

File metadata and controls

83 lines (53 loc) · 1.27 KB

Hooks Toolkit CLI

Add .env Variables

Copy the .env.sample to .env.

Update the HOOKS_COMPILE_HOST variable.

Global Usage (For Using as a CLI)

Install:

npm i -g @transia/hooks-toolkit-cli

Use:

You can initialize a new project by running:

hooks-toolkit-cli init

To build the c contracts, run:

hooks-toolkit-cli compile-c contracts build

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

To build the js contracts, run:

hooks-toolkit-cli compile-js 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-toolkit-cli debug "Account 1" rG1QQv2nh2gr7RCZ1P8YYcBUKCCN633jCn

SDK Usage (For Using as an SDK)

Install:

npm install @transia/hooks-toolkit-cli

Usage:

import { buildDir } from "@transia/hooks-toolkit-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