Perun's Hyperledger Fabric Chaincode and Backend

August 26, 2022 ยท View on GitHub

License: Apache 2.0 CI status

This repository provides the chaincode and go-perun backend implementation for Hyperledger Fabric.

Project structure

  • adjudicator/: On-chain logic. Memory implementations for off-chain testing.
  • chaincode/: Chaincode endpoint, ledger and asset implementation.
  • channel/: Off-chain logic. Channel interface implementations.
    • binding/ Chaincode bindings.
  • client/: Helper functions for setting up a go-perun client.
    • test/ End-2-end tests.
  • pkg/: 3rd-party helpers.
  • scripts/: Test environment setup.
  • wallet/: Wallet interface implementations.

Development Setup

If you want to locally develop with this project:

  1. Setup the fabric-samples test environment and add its directory as FABRIC_SAMPLES_DIR to your path.
curl -sSL https://raw.githubusercontent.com/hyperledger/fabric/v2.4.6/scripts/bootstrap.sh | bash -s
FABRIC_SAMPLES_DIR=$(pwd)/fabric-samples/
  1. Clone this repo.
git clone https://github.com/perun-network/perun-fabric.git
cd perun-fabric
  1. Start the test chain and deploy the chaincode. This step needs a working Docker instance running in the background.
./scripts/deployCC.sh
  1. Run the tests. This step needs a working Go distribution, see go.mod for the required version. Always ensure that FABRIC_SAMPLES_DIR is set.
go test ./... -p 1

Further, you can shut down the test environment.

./scripts/network.sh down

Or start the test environment without chaincode deployment.

./scripts/network.sh up

Security Disclaimer

This software is still under development. The authors take no responsibility for any loss of digital assets or other damage caused by the use of it.

Copyright 2022 - See NOTICE file for copyright holders. Use of the source code is governed by the Apache 2.0 license that can be found in the LICENSE file.

Contact us at info@perun.network.