This project consumes the official Python protobuf bindings published to PyPI from hyperledger/fabric-protos.
- Package name:
hyperledger-fabric-protos - Import namespace used by this repository:
fabric_protos
The package is installed as a regular dependency:
pip install -r requirements.txtFor contributors: custom bindings
scripts/install_fabric_protos.sh remains available for contributors who need bindings not published to PyPI (an unreleased upstream commit, or a local checkout). Normal users do not need to run it; it is a no-op when a working fabric_protos is already importable.
Installation order of preference:
- Do nothing if a working
fabric_protosis already importable. - Local checkout from
FABRIC_PROTOS_SRC(runsmake pythonbindings). - Default sibling checkout ../fabric-protos, if present.
- PyPI package
hyperledger-fabric-protos. - Git checkout of
hyperledger/fabric-protosatFABRIC_PROTOS_REF,then local build/install of bindings/python.
FABRIC_PROTOS_SRC=/path/to/fabric-protos PYTHON_BIN=python ./scripts/install_fabric_protos.shFABRIC_PROTOS_REF=<commit-sha> PYTHON_BIN=python ./scripts/install_fabric_protos.shThe script validates after install that the required generated modules
fabric_protos.peer.chaincode_pb2fabric_protos.peer.chaincode_shim_pb2fabric_protos.common.common_pb2
are importable.
For debugging or contributor workflows, bindings can still be generated from
a local fabric-protos checkout:
PROTO_SRC=/path/to/fabric-protos OUT_DIR=$PWD/fabric_protos bash scripts/gen_protos.shThis is optional and should not be required for normal runtime use
fabric-protos is Apache-2.0. If distributing generated bindings yourself,
keep original licensing notices intact.