CLI tool for interacting with the ckLightning canister. Supports LP operations, swap requests, admin configuration, and balance queries.
| Component | Repo | Role |
|---|---|---|
| ckLightning-canister | perun-network/ckLightning-canister | IC canister — LP management, swap state, channel signing |
| ic-lightning-relay | perun-network/ic-lightning-relay | LDK Lightning node — swap execution, invoice creation, channel management |
See ARCHITECTURE.md for detailed component design.
cargo build --release --bin main./target/release/main [--identity <user|node|default|dfx_identity_name>]Swaps:
request-onramp <amount_sats>— Request onramp (Lightning → ckBTC)get-invoice <request_id>— Poll invoice statusofframp <invoice> [fallback_addr]— Request offramp (ckBTC → Lightning)offramp-status <request_id>— Check offramp status
Liquidity Pool (ckBTC):
lp-approve <amount>— Approve canister to spend ckBTClp-deposit <amount>— Deposit ckBTC to LPlp-withdraw <amount>— Withdraw ckBTC from LPlp-balance/lp-total— Show LP balances
Liquidity Pool (BTC):
lp-btc-address— Get shared LP BTC deposit addresslp-btc-deposit [txid]— Claim BTC depositlp-btc-withdraw <amount> <address>— Withdraw BTC from LP
User BTC (threshold ECDSA):
btc-address— Get your BTC address (derived from principal)btc-balance— Check BTC balance at your depositor addressbtc-send <amount> <destination>— Send BTC from your personal address
Lightning:
ln-address— Get Lightning addressln-invoice <amount_msat> <btc_address>— Create Lightning invoice
Balances:
icp-balance/ckbtc-balance— Check ICP/ckBTC balancesicp-approve <amount>— Approve ICP for anti-DDoS feefetch-key— Check ckBTC balance (alias)
Admin (requires admin/controller identity):
set-admin <principal>— Set admin principalupdate-config [--amp N] [--fee N] [--protocol-fee N] [--slippage N] [--imbalance-fee N] [--rebate N] [--max-swap-pct N]— Update StableSwap parameterswithdraw-fees <principal>— Withdraw protocol feesregister-relay <pubkey_hex> [webhook_url] [webhook_token]— Register relay noderelay-info— Show registered relay information
Diagnostics:
whoami— Show current principalrate-limit— Show rate limit statuspending-onramps— List pending onramp requestspending-offramps— List pending offramp requests
Testing:
set-test-timeouts <onramp_ns> <offramp_ns>— Set swap timeouts (testing)check-expired-swaps— Manually trigger expired swap checkexpired-counts— Show count of expired swaps
General:
help/h— Show helpexit/quit/q— Exit
- Rust toolchain (stable)
dfxwith local IC environment and PEM identities- Canister deployed via
setup_all.sh
Copyright 2026 PolyCrypt GmbH. Use of the source code is governed by the Apache 2.0 license that can be found in the LICENSE file.