Skip to content

nervosnetwork/cfn-node

Repository files navigation

CKB Fiber Network Node

CKB Fiber Network Node (cfn-node) is a reference implementation of a CKB Fiber Network protocol (cfn-protocol). In the current stage, it's not a production-ready implementation, but a prototype to demonstrate the feasibility of the cfn-protocol. It's capable of:

  • Establishing connections with other cfn nodes
  • Creating and closing fiber channel
  • Payments over fiber channel (via cfn-scripts)
  • Cross-chain asset transfer

Please note that the implementation is still under development, there are two major features not implemented yet:

  • Watchtower service to monitor and revoke on-chain transactions
  • Multihop payments

But as a prototype, it's a good starting point for developers to understand the cfn-protocol and try out the integration with their applications.

Build and run a testnet node

  1. Build the project:
cargo build --release
  1. Create a data folder for the node, then copy the built binary and testnet config file to it:
mkdir /folder-to/my-cfn-node
cp target/release/cfn-node /folder-to/my-cfn-node
cp config/testnet/config.yml /folder-to/my-cfn-node
cd /folder-to/my-cfn-node
  1. CFN node has the built-in wallet functionality to sign funding transactions, let's create or import a private key first. The private key is stored in the data folder and named ckb-chain/key. You may use the ckb-cli to generate a new key or export an existing key:
mkdir ckb-chain
ckb-cli account export --lock-arg <lock_arg> --extended-privkey-path ./ckb-chain/exported-key
// ckb-cli exports master private key and chain code, cfn node only needs the private key part
head -n 1 ./ckb-chain/exported-key > ./ckb-chain/key
  1. Start the node, by default it will output logs to the console, you may redirect it to a file:
RUST_LOG=info ./cfn-node -c config.yml -d .

Documentation

Testnet deployment information

  • TODO: Add testnet deployed nodes information *

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages