Fiber-pay: an ai-friendly CLI for fiber-network

Happy to share that I’ve released v0.1.0 of fiber-pay! It targets FNN version 0.7.1 and includes basic functionality for the testnet.

I’ve been using it a lot lately while building a fun demo: fiber-audio-player (I’ll write another post to share that project soon!). It’s been tested on Mac and Linux, but unfortunately not on Windows yet. If anyone is interested in testing it out there, I’d really appreciate it.

My typical workflow using the fiber-pay CLI goes like this:

  1. Install:
npm install -g @fiber-pay/cli
  1. Start a default testnet node:
fiber-pay node start --daemon

# Node daemon starting (PID: 17122)
# Use `fiber-pay node status --json` to verify readiness.
  1. Get your node’s funding address as a QR code:
fiber-pay wallet address --qrcode

✅ Funding address retrieved

 ▄▄▄▄▄▄▄     ▄▄  ▄▄▄▄▄▄▄▄  ▄ ▄▄ ▄  ▄▄▄▄▄▄▄
 █ ▄▄▄ █ ▄ ▀▀ ▄ ▄██▄▄ █▄ ▄▀▄██ █ █ █ ▄▄▄ █
 █ ███ █ █▀█▄▀ ▀▀▄ ▄█▄▀▄█ █▀ █▀ ▄█ █ ███ █
 █▄▄▄▄▄█ █▀▄ ▄ ▄▀▄ █ █▀▄ █ █▀█ █ █ █▄▄▄▄▄█
 ▄ ▄▄▄▄▄ ▀▄▀▀ ▀▀  ▄█▀█▀▄ ▀▄▀  ▄▀▄▄ ▄▄▄▄▄
  ▀█▄█▀▄█  ▄█▀▄▄▀█ ▄▀▀▀▄▀▀ █▄▀▄▀▀▄▀▀██▄▄ ▀
  █▀ █▀▄ ▀ ▀█▄▄██ ▄ ▀█▀▄▀█▄ ▀ ▄   ▄▀ ▀▀▄▄▀
 ▀▀ ██▀▄█▄██ ▀▀▄▀▀██ ▄ ▀▄▄▄▀▄▀  ▀▀▄▀██ ▄ ▀
 ▄██ ██▄█▄▀▀█ █▀▄▀▄▀ ▄▀▄█ ▄ ▀ ▄█ ▀  █▀▄▄█
    ▄█▀▄█▄ ▄▄▀█▀▄  ▄▀▀ ▄▀▀▀█▄█▄ ▀▀ ███ ▀ ▀
 █▀  █▀▄▄▀▄█ ▄▀▄ ▄ ▄ █▄▄▀ ▄ ▄▀▄  █▀ ▄▀█▄
 █▀ ▀ ▀▄▄▀ █▀▄▄▄▀█▄▄▀█  ▀█▀▀▄█▄█▀▀▀▀ ▀▄ ▀▀
 ▀ █▄██▄▄ ▄█▀▀▄▀ ▀▄ ▄ ▀▄▀█▄ ▀▄▄ █  ▀▄ █▄▄
 ▀▄▄▄▀▄▄██▀▀██▀█▄█ ▄▀▀█▄▀▄▄▀▄   ▀▀ ▀█▀▄█▄▀
 █▄▀▄  ▄▄█▀ ▄████▄▄▄█▀▀▄▄█▄▄█▄▄█ █▀▀▄▀█▄██
 █▀▀▀ ▄▄  ▀▀█▄▄▄ ▄▄ ▄▀▀▄ ▀▄▀▄█▄▄▀█▄█▀██▄▄▀
 █   ▀█▄▄▀▄▀██▀▄ ▄▄▀██▀█▀█▄██▄▄  ▄██▄▄█▄
 ▄▄▄▄▄▄▄ ▀  ▀▄█  ▀█▀▀▄█ ▀ ▄▀▄▄▄█▄█ ▄ ██▄▀▀
 █ ▄▄▄ █ █▄▄ █▄ ▀ ▀▀ ██▀▀▀▄▄██▄ ▀█▄▄▄██▄██
 █ ███ █ ██▀ ▀▀█ ▀█▀▀▀▄█▀▄ ▄▄ ▄█ ▀▄▄▀▄█ ▀▀
 █▄▄▄▄▄█ ▄ █▄ █▀▀█▄▀▄ ▀▄▀█▄███▄█▄▀  ▄██▄▀
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀

  ckt1qzda...axcl2c

(Scan the address with your CKB wallet and deposit some funds)

  1. Check the funding address balance after depositing:
fiber-pay wallet balance

# ✅ CKB balance retrieved
#  Balance: 7999.99898862 CKB
#  Balance (shannons): 799999898862
  1. Check the network:
fiber-pay node network
Node Network Overview
=====================

Connected Peers: 6
Active Channels: 1
Total Channel Capacity: 1.0 CKB

Peers:
  PEER_ID                ALIAS                ADDRESS                    VERSION
  --------------------------------------------------------------------------------
  QmfNUEDq9Z...fZU1kGjR  (unnamed)            /ip4/16.162.99....fZU1kGjR 0.7.1
  Qmes1EBD4y...JMsoYFKy  bootnodesgp          /ip4/54.179.226...JMsoYFKy 0.7.1
  Qmd2LiBRNL...rfpm5gE2  (unnamed)            /ip4/3.212.70.7...rfpm5gE2 0.6.0-rc
  Qmc9tdvFCh...YMZ1T7uj  (unnamed)            /ip4/82.29.173....YMZ1T7uj 0.7.1
  QmdyQWjPtb...NDrTNaeV  bootnodehk           /ip4/16.163.7.1...NDrTNaeV 0.7.1
  QmXen3eUHh...X69XJ1Eo  CryptapeNode-1       /ip4/18.162.235...X69XJ1Eo 0.7.1

Channels:
  CHANNEL_ID             PEER_ALIAS           STATE          LOCAL_BAL     REMOTE_BAL   CAPACITY
  -----------------------------------------------------------------------------------------------
  0x4fdf9278...a95733cf  CryptapeNode-1     CHANNEL_READY       900.9       151.1      1.0

Listing channels and connected peers is easy too: just use fiber-pay channel list and fiber-pay peer list.

  1. Run multiple nodes with --profile:
    Another feature I use often is setting up multiple nodes for testing and managing them with different profiles:

Node 1:

fiber-pay --profile testnode1 config init --rpc-port 28227 --p2p-port 28228 --proxy-port 28229

Node 2:

fiber-pay --profile testnode2 config init --rpc-port 38227 --p2p-port 38228 --proxy-port 38229

Node 3:

fiber-pay --profile testnode3 config init --rpc-port 48227 --p2p-port 48228 --proxy-port 48229

(Note: I updated the profile names to testnode2 and testnode3 so they don’t overwrite each other!)

To manage any of these nodes, just pass the corresponding --profile <name> flag in your command—everything else remains the same. eg:

fiber-pay --profile testnode3 node start --daemon

There’s so much more to share, like the log command to monitor your nodes, AI-friendly flags on each command, and more. If you try it out, let me know what you think! I’ll be posting a future work plan for this little tool soon.

3 Likes