Perun CKB backend
This repository contains the Nervos/CKB backend for the go-perun channel library.
Learn how to use go-perun backends in the documentation of the go-perun core library. It supposed to work in tandem with the perun-ckb-contract
backend/: Backend interface implementations.channel/: Channel interface implementations.client/: Client bindings with tests.wallet/: Wallet interface implementations.encoding/: On/off-chain serialization.devnet/: Local devnet deployment.transaction: Contract bindings.
We use various tools to enable a convenient setup for the local development devnet. If you want to use our setup-devnet.sh script, make sure the following commandline tools are installed:
jq:- Used to parse and edit some configuration files.
sedandawk:- We modify some fields of the files generated by the
ckb init --chain devcommand usingsedandawk.
- We modify some fields of the files generated by the
tmuxandtmuxp:tmuxpis a session manager fortmuxthat allows to easily create descriptive.yamlconfiguration files to create and attach totmuxsessions.
expect:- We completely automize the process for test-wallet creation, deploying of contracts etc. To make this work reliably, we use
expectwhich allows to describe how a commandline application is fed input.
- We completely automize the process for test-wallet creation, deploying of contracts etc. To make this work reliably, we use
make:- Not strictly necessary, but it should be available on most systems by default. In case you do not want to install
makecheck out theMakefilecontent and issue the command on your own.
- Not strictly necessary, but it should be available on most systems by default. In case you do not want to install
ckbwith version0.201.0or higher.ckb-cliwith version1.13.0or higher.
- Clone the repository.
git clone https://github.com/perun-network/perun-ckb-backend
cd perun-ckb-backend- Initialize the submodule.
git submodule update --init --recursive- Start the devnet on a separate terminal and wait for 30 seconds for the devnet to start.
cd devnet
make dev- Run the tests. This step needs a working Go distribution, see go.mod for the required version.
go test ./...The authors take no responsibility for any loss of digital assets or other damage caused by the use of this software.
Copyright 2025 PolyCrypt GmbH.
Use of the source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
