Skip to content

Hyperledger Fabric Chaincode Python

GitHub License OpenSSF Best Practices OpenSSF Scorecard

Python Version GitHub Actions GitHub Release

This is a Python based implementation of Hyperledger Fabric chaincode shim and contract API, which enables development of smart contracts using the Python language. Chaincodes (smart contracts) written in Python run inside Hyperledger Fabric peers.

Documentation

Project structure

src/
├── fabric_contract_api/   Python Contract API
└── fabric_shim/           Python chaincode shim (Fabric 2.x)
  • fabric_contract_api - Contains the Python contract API used to write smart contracts with the high-level contract programming model.
  • fabric_shim - Contains the Python classes that implement the chaincode shim API and the way to communicate with Fabric peers.

Building and testing

Make sure you have the following prereqs installed:

Create a virtual environment and install the development dependencies:

python3 -m venv .venv
source .venv/bin/activate
pip install -e . -r requirements-dev.txt

Run the unit tests:

pytest tests/

Contributing

We welcome contributions to the Hyperledger Fabric project in many forms. If you are interested in contributing updates to this project, please start with the contributing guide.

There is also a release guide describing the process for publishing new versions.

Community

License

Hyperledger Project source code files are made available under the Apache License, Version 2.0 (Apache-2.0), located in the LICENSE file. Hyperledger Project documentation files are made available under the Creative Commons Attribution 4.0 International License (CC-BY-4.0), available at http://creativecommons.org/licenses/by/4.0/.

About

Hyperledger Fabric Packages for Python Chaincode

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages