Skip to content

Latest commit

 

History

History
47 lines (34 loc) · 2.18 KB

File metadata and controls

47 lines (34 loc) · 2.18 KB

Building @fabric/core

JavaScript library (default)

npm ci
npm test

No native compile is required for the core JS unit/integration tests in this repo.

fabric CLI binary

The fabric npm binary is the Node harness (scripts/fabric.js) for the Blessed TUI (chat default). Optional fabric.node accelerates a tiny API surface (e.g. doubleSha256); see docs/CLI-BINARY.md and functions/fabricNativeAccel.js.

Bundled executable: npm run make:binary (pkg).

Native addon (fabric.node)

The Node N-API addon implements peer/message helpers and Bitcoin-related bindings (binding.gyp). Build when you need C parity features or JS access to binding.cc exports.

npm ci
npm run build:c

Outputs under build/Release/fabric.node (ignored by git — see .gitignore).

Dependencies

Component Linux (typical) macOS (Homebrew)
Node 22.x (see .nvmrc / package.json engines) same
Build build-essential, Python 3.x (for node-gyp) Xcode CLT
secp256k1 libsecp256k1-dev where available, or install to /usr/local brew install secp256k1
libwally-core Build from libwally-core or distro packages if present brew install libwally-core
noise Static or shared libnoiseprotocol / libnoisekeys on linker path Install to /usr/local/lib (e.g. from source)

Headers and library search paths are defined in binding.gyp under conditions for OS=='linux' and OS=='mac'. On Apple Silicon, Homebrew often uses /opt/homebrew/opt/...; on Intel macOS or custom installs, /usr/local may be used instead — adjust binding.gyp or use symlinks if the linker reports missing -lwallycore or -lsecp256k1.

Verify

node -e "console.log(require('fs').existsSync('build/Release/fabric.node') ? 'ok' : 'run npm run build:c')"

Cross-stack messaging

Wire-format and body-hash alignment between C and JS are summarized in docs/C-JS-PARITY.md.

Release hygiene

See docs/PRODUCTION-CHECKLIST.md.