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.
sed
andawk
:- We modify some fields of the files generated by the
ckb init --chain dev
command usingsed
andawk
.
- We modify some fields of the files generated by the
tmux
andtmuxp
:tmuxp
is a session manager fortmux
that allows to easily create descriptive.yaml
configuration files to create and attach totmux
sessions.
expect
:- We completely automize the process for test-wallet creation, deploying of contracts etc. To make this work reliably, we use
expect
which 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
make
check out theMakefile
content 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
ckb
with version0.201.0
or higher.ckb-cli
with version1.13.0
or 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.