Fiber LogoFiber Docs

Configuration Reference

Reference for Fiber Node config.yml fields, supported overrides, and defaults

Fiber Node is mainly configured by config.yml. Many fields in this file can also be set from command-line flags or environment variables when starting fnn.

Configuration Loading

Native fnn loads configuration file in this order:

  1. -c, --config <path> if provided.
  2. $BASE_DIR/config.yml when -d, --dir <BASE_DIR> is provided.
  3. $HOME/.fiber-node/config.yml.

Values from command-line flags and supported environment variables override config.yml; values not provided by either source fall back to built-in defaults. If both a command-line flag and its environment variable are provided, use the command-line value as the effective override.

services decides which services start. Set it in config.yml, or pass one or more service names with -s, --services when starting fnn, for example --services fiber,rpc,ckb. When the command line includes at least one service name, that list replaces the services list in config.yml; when no service name is provided, fnn uses the list from config.yml. Valid service names are fiber, rpc, ckb, and cch.

Data directories are derived from BASE_DIR, which defaults to $HOME/.fiber-node and can be changed with global -d, --dir. Native startup sets service directories to $BASE_DIR/fiber, $BASE_DIR/ckb, and $BASE_DIR/cch; do not rely on per-service base_dir entries in config.yml. The generated help may list per-service base directory flags and environment variables, but native startup rewrites those service directories from BASE_DIR.

Tip: Run fnn --help to list the available configuration flags and environment variables. Most service-scoped options are generated from the same config structs that parse config.yml, so the corresponding YAML fields work too. For example, --fiber-listening-addr maps to fiber.listening_addr, and --rpc-listening-addr maps to rpc.listening_addr.

Global Startup Options

These options affect native fnn startup. They are not config.yml fields.

OptionDescription
-c, --config <path>Load the specified config file.
-d, --dir <BASE_DIR>Set BASE_DIR; also changes the implicit config path to $BASE_DIR/config.yml when --config is not provided.
-s, --services <services>Services to start. When present, this replaces the services list from config.yml. Values are comma-separated or space-separated.
--check-validateValidate the Fiber store database and exit without starting services.

Top-Level Fields

fiber:
  # P2P network and channel configuration
rpc:
  # JSON-RPC server configuration
ckb:
  # CKB blockchain integration
cch:
  # Cross-Chain Hub configuration (optional)
services:
  - fiber
  - rpc
  - ckb
FieldTypeDefaultDescription
servicesstring[]requiredServices to run. Valid values: fiber, rpc, ckb, cch.
fiberobject{}Fiber P2P, channel, gossip, watchtower, proxy, and Tor settings.
rpcobject{}JSON-RPC server settings.
ckbobject{}CKB chain integration and funding transaction settings.
cchobject{}Cross-Chain Hub settings. Native builds only.

Service dependencies:

  • fiber requires ckb.
  • cch requires either the in-process fiber service or cch.fiber_rpc_url.
  • Standalone cch mode, where fiber is not running in the same process, also requires cch.wrapped_btc_type_script.

Fiber Section (fiber)

Network

FieldTypeDefaultDescription
listening_addrstring/ip4/0.0.0.0/tcp/0TCP listening address for P2P connections (multiaddr format)
reuse_port_for_websocketbooltrueAlso listen on a WebSocket multiaddr using the same TCP port.
announce_listening_addrboolfalseWhether to announce the listening address to peers
announce_private_addrboolfalseWhether to announce and process private addresses. Keep false unless testing or running a private network.
announced_addrsstring[][]Public addresses to announce (multiaddr format). Set this to your public IP.
announced_node_namestringNode name shown in RPC responses, TUI, and network graph
bootnode_addrsstring[][]Bootstrap node addresses for initial peer discovery (multiaddr format)
chainstringrequiredChain specification: mainnet, testnet, or a custom chain spec path relative to BASE_DIR.
scriptsarray[]Fiber contract script configuration. Mainnet/testnet configs should provide at least FundingLock and CommitmentLock entries from the bundled templates.

Contract Scripts

fiber:
  scripts:
    - name: FundingLock
      script:
        code_hash: 0x...
        hash_type: type
        args: 0x
      cell_deps:
        - type_id:
            code_hash: 0x...
            hash_type: type
            args: 0x...
        - cell_dep:
            out_point:
              tx_hash: 0x...
              index: 0x0
            dep_type: code

name must be one of the contract names used by Fiber, such as FundingLock or CommitmentLock. Each cell_deps entry must contain exactly one of type_id or cell_dep.

Channel

FieldTypeDefaultDescription
open_channel_auto_accept_min_ckb_funding_amountu6410000000000 (100 CKB)Minimum CKB funding to auto-accept channel requests
auto_accept_channel_ckb_funding_amountu649900000000 (99 CKB)CKB amount to auto-accept. Set to 0 to disable auto-accept.
to_be_accepted_channels_number_limitusize20Max pending channels from one peer
to_be_accepted_channels_bytes_limitusize51200 (50 KiB)Max storage bytes of pending channels from one peer
pending_channels_number_limitusize100Max pending channel openings globally
funding_timeout_secondsu6486400 (1 day)Timeout for funding transaction confirmation
external_funding_timeout_secondsu64300 (5 min)Timeout waiting for externally signed funding tx

TLC

FieldTypeDefaultDescription
tlc_expiry_deltau6414400000 (4 hours, ms)Expiry delta used when forwarding a TLC
tlc_min_valueu1280Minimum TLC value (0 = no minimum)
tlc_fee_proportional_millionthsu1281000Fee for forwarding TLCs (1000 = 0.1%)

final_tlc_expiry_delta is not a node-level config field. It is a payment/invoice-level value with separate defaults in the payment code.

Node Announcements, Peers, and Gossip

FieldTypeDefaultDescription
auto_announce_nodebooltrueWhether to automatically announce this node on startup.
announce_node_interval_secondsu643600 (1 hour)NodeAnnouncement reannounce interval. 0 means never reannounce.
max_inbound_peersusize16Maximum inbound connections
min_outbound_peersusize8Minimum outbound connections to maintain
enable_peer_reconnect_backoffbooltrueWhether to schedule reconnect backoff for peers with active channels after disconnects
sync_network_graphbooltrueWhether to sync network graph from peers
gossip_network_maintenance_interval_msu6460000 (1 min)Interval for gossip network maintenance
gossip_store_maintenance_interval_msu6420000 (20 sec)Interval for gossip store maintenance
gossip_network_num_targeted_active_syncing_peersusize3Number of peers to actively request missed gossip messages from
gossip_network_num_targeted_outbound_passive_syncing_peersusize3Number of outbound peers targeted for passive gossip syncing
gossip_policyobjectbuilt-in policyAdvanced config-file-only gossip rate-limit and ban policy. It is not exposed as CLI flags or environment variables.

Watchtower

FieldTypeDefaultDescription
watchtower_check_interval_secondsu6460Interval to check watchtower. 0 = never check.
disable_built_in_watchtowerboolfalseDisable built-in watchtower actor
standalone_watchtower_rpc_urlstringURL of standalone watchtower RPC server
standalone_watchtower_tokenstringRPC token for standalone watchtower

If disable_built_in_watchtower is true, standalone_watchtower_rpc_url must be set.

Proxy & Tor

proxy and onion are config-file-only fields. They are not exposed as direct CLI flags or environment variables.

FieldTypeDefaultDescription
proxy.proxy_urlstringSOCKS5 proxy URL (e.g., socks5://127.0.0.1:9050)
proxy.proxy_random_authbooltrueRandom username/password for Tor stream isolation
onion.listen_on_onionboolfalseMake node reachable via .onion address
onion.onion_serverstringTor SOCKS5 server for outbound .onion connections, e.g. 127.0.0.1:9050
onion.p2p_listen_addressstringderivedLocal address the onion service forwards to, e.g. 127.0.0.1:8228
onion.onion_private_key_pathstring$BASE_DIR/fiber/onion_private_keyPath for the onion service private key
onion.tor_controllerstring127.0.0.1:9051Tor controller address
onion.tor_passwordstringTor controller password
onion.onion_external_portu168228External port exposed by the onion service
onion.onion_service_start_timeoutusize5Seconds to wait for onion service registration

Feature-Gated Fields

FieldTypeDefaultDescription
metrics_addrstringMetrics endpoint address, available only when the binary is built with the metrics feature.

RPC Section (rpc)

FieldTypeDefaultDescription
listening_addrstring[::1]:0Listen address for JSON-RPC. The bundled configs use 127.0.0.1:8227.
biscuit_public_keystringPublic key for Biscuit authorization. If set, RPC requires Bearer token auth.
enabled_modulesstring[]see belowRPC modules to enable
cors_enabledboolfalseEnable CORS for HTTP RPC
cors_allowed_originsstring[][]Allowed origins for CORS (empty = allow all if CORS enabled)

Default modules are cch, channel, graph, payment, info, invoice, and peer. Builds with the watchtower feature also enable watchtower by default.

Available module names include cch, channel, graph, payment, info, invoice, peer, pubsub, watchtower, dev in debug builds, and prof when built with the pprof feature.

If listening_addr is public, biscuit_public_key is required. Without auth, the RPC server refuses to bind public addresses such as 0.0.0.0:8227.


CKB Section (ckb)

FieldTypeDefaultDescription
rpc_urlstringhttp://127.0.0.1:8114CKB node RPC URL
udt_whitelistarray[]Supported UDT configurations (see below)
tx_tracing_polling_interval_msu644000Polling interval for the CKB transaction tracing actor
funding_tx_shell_builderstringExternal command used to build funding transactions

UDT Configuration

ckb:
  udt_whitelist:
    - name: "USDI"
      script:
        code_hash: "0x..."
        hash_type: type
        args: "0x..."
      auto_accept_amount: 10000000  # Optional: auto-accept amount
      cell_deps:
        - type_id:
            code_hash: "0x..."
            hash_type: type
            args: "0x..."

script.args is compiled as a regular expression and matched against the UDT type script args rendered as a 0x-prefixed hex string. Use an exact regex if you only want to match one token.

Each UDT cell_deps entry must contain exactly one of:

  • type_id, a script used to resolve the current cell dep through the CKB indexer.
  • cell_dep, a direct out_point plus dep_type.

funding_tx_shell_builder is configured under ckb, but its environment variable is FIBER_FUNDING_TX_SHELL_BUILDER. The command receives a funding request JSON object on stdin and must print a CKB transaction JSON object to stdout on success.


CCH Section (cch) — Cross-Chain Hub

FieldTypeDefaultDescription
lnd_rpc_urlstringhttps://127.0.0.1:10009LND gRPC endpoint
lnd_cert_pathstringPath to TLS cert for gRPC
lnd_macaroon_pathstringPath to Macaroon file
wrapped_btc_type_script_argsstringrequiredWrapped BTC UDT type script args
order_expiry_delta_secondsu64129600 (36h)Cross-chain order expiry time
base_fee_satsu640Base fee per order (satoshis)
fee_rate_per_million_satsu641Proportional fee per million satoshis
max_outgoing_fee_percentageu64100Max percentage of the collected CCH fee that may be used as outgoing Fiber routing fee budget. Must be 1..=100.
btc_final_tlc_expiry_delta_blocksu64360Final TLC relative expiry in BTC blocks
ckb_final_tlc_expiry_delta_secondsu64216000 (60h)Final TLC relative expiry for CKB Fiber payments
min_outgoing_invoice_expiry_delta_secondsu6421600 (6h)Minimum acceptable relative expiry for outgoing invoices
fiber_rpc_urlstringExternal Fiber RPC endpoint for standalone CCH mode
wrapped_btc_type_scriptstringFull wrapped BTC type script JSON. Required in standalone CCH mode.
ignore_startup_failureboolfalseConfig-file-only setting to ignore CCH startup failure.

Relative lnd_cert_path and lnd_macaroon_path values are resolved under the effective CCH data directory, normally $BASE_DIR/cch.


Environment Variables

Only fields wired to clap can be overridden by environment variables. List values use comma-separated strings. Complex values such as FIBER_SCRIPTS and CKB_UDT_WHITELIST are easier and less error-prone in YAML.

Fiber

FieldEnvironment variable
listening_addrFIBER_LISTENING_ADDR
announce_listening_addrFIBER_ANNOUNCE_LISTENING_ADDR
announce_private_addrFIBER_ANNOUNCE_PRIVATE_ADDR
announced_addrsFIBER_ANNOUNCED_ADDRS
bootnode_addrsFIBER_BOOTNODE_ADDRS
announced_node_nameFIBER_ANNOUNCED_NODE_NAME
chainFIBER_CHAIN
scriptsFIBER_SCRIPTS
open_channel_auto_accept_min_ckb_funding_amountFIBER_OPEN_CHANNEL_AUTO_ACCEPT_MIN_CKB_FUNDING_AMOUNT
auto_accept_channel_ckb_funding_amountFIBER_AUTO_ACCEPT_CHANNEL_CKB_FUNDING_AMOUNT
tlc_expiry_deltaFIBER_TLC_EXPIRY_DELTA
tlc_min_valueFIBER_TLC_MIN_VALUE
tlc_fee_proportional_millionthsFIBER_TLC_FEE_PROPORTIONAL_MILLIONTHS
auto_announce_nodeFIBER_AUTO_ANNOUNCE_NODE
announce_node_interval_secondsFIBER_ANNOUNCE_NODE_INTERVAL_SECONDS
gossip_network_maintenance_interval_msFIBER_GOSSIP_NETWORK_MAINTENANCE_INTERVAL_MS
max_inbound_peersFIBER_MAX_INBOUND_PEERS
min_outbound_peersFIBER_MIN_OUTBOUND_PEERS
enable_peer_reconnect_backoffFIBER_ENABLE_PEER_RECONNECT_BACKOFF
gossip_store_maintenance_interval_msFIBER_GOSSIP_STORE_MAINTENANCE_INTERVAL_MS
gossip_network_num_targeted_active_syncing_peersFIBER_GOSSIP_NETWORK_NUM_TARGETED_ACTIVE_SYNCING_PEERS
gossip_network_num_targeted_outbound_passive_syncing_peersFIBER_GOSSIP_NETWORK_NUM_TARGETED_OUTBOUND_PASSIVE_SYNCING_PEERS
sync_network_graphFIBER_SYNC_NETWORK_GRAPH
watchtower_check_interval_secondsFIBER_WATCHTOWER_CHECK_INTERVAL_SECONDS
standalone_watchtower_rpc_urlFIBER_STANDALONE_WATCHTOWER_RPC_URL
standalone_watchtower_tokenFIBER_STANDALONE_WATCHTOWER_TOKEN
disable_built_in_watchtowerFIBER_DISABLE_BUILT_IN_WATCHTOWER
to_be_accepted_channels_number_limitFIBER_TO_BE_ACCEPTED_CHANNELS_NUMBER_LIMIT
to_be_accepted_channels_bytes_limitFIBER_TO_BE_ACCEPTED_CHANNELS_BYTESS_LIMIT
pending_channels_number_limitFIBER_PENDING_CHANNELS_NUMBER_LIMIT
funding_timeout_secondsFIBER_FUNDING_TIMEOUT_SECONDS
external_funding_timeout_secondsFIBER_EXTERNAL_FUNDING_TIMEOUT_SECONDS
reuse_port_for_websocketFIBER_REUSE_PORT_FOR_WEBSOCKET
metrics_addrFIBER_METRICS_ADDR

FIBER_TO_BE_ACCEPTED_CHANNELS_BYTESS_LIMIT keeps the current source spelling of the environment variable. The YAML field and CLI flag use bytes.

RPC

FieldEnvironment variable
listening_addrRPC_LISTENING_ADDR
biscuit_public_keyRPC_BISCUIT_PUBLIC_KEY
enabled_modulesRPC_ENABLED_MODULES
cors_enabledRPC_CORS_ENABLED
cors_allowed_originsRPC_CORS_ALLOWED_ORIGINS

CKB

FieldEnvironment variable
rpc_urlCKB_NODE_RPC_URL
udt_whitelistCKB_UDT_WHITELIST
tx_tracing_polling_interval_msCKB_TX_TRACING_POLLING_INTERVAL_MS
funding_tx_shell_builderFIBER_FUNDING_TX_SHELL_BUILDER

CCH

FieldEnvironment variable
lnd_rpc_urlCCH_LND_RPC_URL
lnd_cert_pathCCH_LND_CERT_PATH
lnd_macaroon_pathCCH_LND_MACAROON_PATH
wrapped_btc_type_script_argsCCH_WRAPPED_BTC_TYPE_SCRIPT_ARGS
order_expiry_delta_secondsCCH_ORDER_EXPIRY_DELTA_SECONDS
base_fee_satsCCH_BASE_FEE_SATS
fee_rate_per_million_satsCCH_FEE_RATE_PER_MILLION_SATS
max_outgoing_fee_percentageCCH_MAX_OUTGOING_FEE_PERCENTAGE
btc_final_tlc_expiry_delta_blocksCCH_BTC_FINAL_TLC_EXPIRY_DELTA_BLOCKS
ckb_final_tlc_expiry_delta_secondsCCH_CKB_FINAL_TLC_EXPIRY_DELTA_SECONDS
min_outgoing_invoice_expiry_delta_secondsCCH_MIN_OUTGOING_INVOICE_EXPIRY_DELTA_SECONDS
fiber_rpc_urlCCH_FIBER_RPC_URL
wrapped_btc_type_scriptCCH_WRAPPED_BTC_TYPE_SCRIPT

Special variable: FIBER_SECRET_KEY_PASSWORD — Required to decrypt the CKB private key at startup.

No supported direct environment variable exists for native service directories, fiber.proxy, fiber.onion, fiber.gossip_policy, or cch.ignore_startup_failure.


Example: Minimal Testnet Config

fiber:
  listening_addr: "/ip4/0.0.0.0/tcp/8228"
  bootnode_addrs:
    - "/ip4/54.179.226.154/tcp/8228/p2p/Qmes1EBD4yNo9Ywkfe6eRw9tG1nVNGLDmMud1xJMsoYFKy"
    - "/ip4/16.163.7.105/tcp/8228/p2p/QmdyQWjPtbK4NWWsvy8s69NGJaQULwgeQDT5ZpNDrTNaeV"
  announce_listening_addr: true
  chain: testnet
  scripts:
    - name: FundingLock
      script:
        code_hash: 0x6c67887fe201ee0c7853f1682c0b77c0e6214044c156c7558269390a8afa6d7c
        hash_type: type
        args: 0x
      cell_deps:
        - type_id:
            code_hash: 0x00000000000000000000000000000000000000000000000000545950455f4944
            hash_type: type
            args: 0x3cb7c0304fe53f75bb5727e2484d0beae4bd99d979813c6fc97c3cca569f10f6
        - cell_dep:
            out_point:
              tx_hash: 0x12c569a258dd9c5bd99f632bb8314b1263b90921ba31496467580d6b79dd14a7
              index: 0x0
            dep_type: code
    - name: CommitmentLock
      script:
        code_hash: 0x740dee83f87c6f309824d8fd3fbdd3c8380ee6fc9acc90b1a748438afcdf81d8
        hash_type: type
        args: 0x
      cell_deps:
        - type_id:
            code_hash: 0x00000000000000000000000000000000000000000000000000545950455f4944
            hash_type: type
            args: 0xf7e458887495cf70dd30d1543cad47dc1dfe9d874177bf19291e4db478d5751b
        - cell_dep:
            out_point:
              tx_hash: 0x12c569a258dd9c5bd99f632bb8314b1263b90921ba31496467580d6b79dd14a7
              index: 0x0
            dep_type: code

rpc:
  listening_addr: "127.0.0.1:8227"

ckb:
  rpc_url: "https://testnet.ckbapp.dev/"

services:
  - fiber
  - rpc
  - ckb

Tip: Use the config files from the Fiber repository as starting points. They include current script hashes, cell deps, UDT whitelist entries, and bootnode addresses for each network.