Skip to content

CLI: hivec

Every SDK ships a hivec with the same four jobs: build a .hbc, inspect it, list its functions, and run a function on ndsr. ndsr is found through --ndsr/-ndsr (where supported), $NDSR_BIN, then ndsr on PATH.

How you get it depends on the language (Install the tools):

SDK hivec Installed by
Rust hivec-rs, run as hivec curl -fsSL https://necter.network/install.sh | sh -s -- rust
Go hivec-go, run as hivec curl -fsSL https://necter.network/install.sh | sh -s -- go
TypeScript, JavaScript npx hivec from the project’s @necter/hivekit dev dependency npm install in a necter-init project
Python hivec in the project’s virtual environment, from the necter-hivekit wheel pip install -r requirements.txt in a necter-init project

With Rust and Go, hivec is a small dispatcher in ~/.necter/bin: it runs hivec-rs in a project with a Cargo.toml and hivec-go in one with a go.mod. hivec --version prints hivec 1.0.0 (Rust) or hivec-go/1.0.0 (Go).

hivec build [PATH] [OPTIONS]
--example <EXAMPLE> Build this example of the crate instead of its library
--name <NAME> Module name in the manifest [default: the cargo target / file name]
-o, --out <OUT> Output directory [default: dist]
--functions <FUNCTIONS> For a .wasm without a hivekit.functions section
--language <LANGUAGE> manifest.language for a .wasm input [default: rust]
--module-version <VERSION> Optional manifest.version
--description <DESCRIPTION> Optional manifest.description
--debug Build with the dev profile instead of --release
--target-dir <TARGET_DIR> Cargo target directory
hivec inspect FILE.hbc [--json]
hivec functions FILE # .hbc, .wasm or .rs source
hivec run <HBC> <FUNCTION> [INPUT]
--input-file <INPUT_FILE>
--gas <GAS>
--data-dir <DATA_DIR> Persist state/ledger here
--module <MODULES> Make another module callable via hive.call (repeatable)
--ndsr <NDSR> Path to the ndsr binary