@fiber-dev-kit/cli
v0.1.1-rc.0
Published
Fiber Dev Kit CLI for running Fiber nodes quickly from npm
Readme
@fiber-dev-kit/cli
Fiber Dev Kit CLI for running Fiber nodes quickly from npm.
This first package is a Linux x64 MVP. It vendors the current fnn and
fnn-cli release binaries so users do not need to download the Fiber source
tree or wait for a Rust build.
Install
npm install -g @fiber-dev-kit/cliUse
Run diagnostics:
fiber doctorStart a two-node dev kit and try to open a channel:
fiber start --nodes 2 --channel 200Start only one managed node, then connect it to an external Fiber node:
fiber start --nodes 1
fiber connect --node a --address /ip4/1.2.3.4/tcp/8228/p2p/QmPeer...
fiber channel open --node a --peer 03abc... --amount 200 --wait 180Watch node and channel status:
fiber status --watchSend a test payment:
fiber pay --from a --to b --amount 1Show generated node accounts and funding addresses:
fiber accounts
fiber accounts --node aExport local dev keys only when you explicitly need them:
fiber keys export --node a --yesOpen the terminal inspector:
fiber inspectYou can still run a single Fiber node:
fiber startIn another terminal:
fiber cli infofiber start forwards original fnn options after --, so the npm wrapper
does not lock users into the bundled defaults:
fiber start -- --rpc-biscuit-public-key <public-key>
fiber start -- --ckb-node-rpc-url http://127.0.0.1:8114
fiber start -- --fiber-announced-node-name my-node
fiber start -- --fiber-listening-addr /ip4/0.0.0.0/tcp/8228Environment variables supported by fnn also work:
RPC_BISCUIT_PUBLIC_KEY=<public-key> fiber start
CKB_NODE_RPC_URL=http://127.0.0.1:8114 fiber startFor exact passthrough to the original node binary, use:
fiber node --help
fiber node -c ./config.yml -d ./data --rpc-biscuit-public-key <public-key>The runtime directory defaults to ~/.fiber-node. Override it with:
FIBER_HOME=/tmp/my-fiber-node fiber startThe node identity public key is derived from the Fiber private key stored under
the Fiber base directory. To use an existing node identity, reuse that base
directory or provide your own with --fiber-base-dir / FIBER_BASE_DIR.
The default config template is testnet.yml. For an offline RPC-only smoke
test, run:
FIBER_CONFIG_TEMPLATE=rpc-only.yml fiber startThe bundled testnet template listens on a random P2P port by default so local development nodes do not collide with each other.
The wrapper also picks a free local RPC port starting at 8227 when the default
port is busy, then remembers it so fiber cli ... connects to the same node.
Set FIBER_RPC_URL, RPC_LISTENING_ADDR, or pass --rpc-listening-addr if you
need a specific RPC address.
The launcher creates a random dev CKB key on first start and uses
FIBER_SECRET_KEY_PASSWORD=password unless you set your own environment value.
Do not use the generated key for production funds.
CLI output uses Chalk colors for status, warnings, and errors. Set NO_COLOR=1
if you need plain output in logs or scripts.
Commands
Full command docs live in docs/commands.md.
fiber version
fiber doctor
fiber start --nodes 2 --channel 200 [--wait 180]
fiber start [--background|-b] [--dry-run] [-- FNN_ARGS...]
fiber connect --node a --address <multiaddr>
fiber connect --node a --pubkey <peer-pubkey>
fiber channel open --node a --peer <peer-pubkey> --amount 200
fiber channel list --node a
fiber pay --from a --to b --amount 1
fiber accounts [--node a] [--json]
fiber keys export --node a --yes
fiber status [--watch]
fiber inspect
fiber node [FNN_ARGS...]
fiber cli [FNN_CLI_ARGS...]
fiber stop [--all]