Skip to content

perun-network/perun-ckb-backend

Repository files navigation


Perun

Perun CKB Backend

License: Apache 2.0 CI status

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

Project structure

  • 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.

Development

Dependencies

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 and awk:
    • We modify some fields of the files generated by the ckb init --chain dev command using sed and awk.
  • tmux and tmuxp:
    • tmuxp is a session manager for tmux that allows to easily create descriptive .yaml configuration files to create and attach to tmux 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.
  • 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 the Makefile content and issue the command on your own.
  • ckb with version 0.201.0 or higher.
  • ckb-cli with version 1.13.0 or higher.

Build and Test

  1. Clone the repository.
git clone https://github.com/perun-network/perun-ckb-backend
cd perun-ckb-backend
  1. Initialize the submodule.
git submodule update --init --recursive
  1. Start the devnet on a separate terminal and wait for 30 seconds for the devnet to start.
cd devnet

make dev
  1. Run the tests. This step needs a working Go distribution, see go.mod for the required version.
go test ./...

Security Disclaimer

The authors take no responsibility for any loss of digital assets or other damage caused by the use of this software.

Copyright

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.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •