Python library for Hyperledger Iroha 2.
You should install rust (cargo) and python.
pip install maturin
maturin buildArchitecturally python library uses rust client library. It is done
via wrapping classes using rust library pyo3.
The data model of iroha itself is expected to be just classes without
some special methods (without sidechannels, like doing http request).
Communication channel for rust python methods using rust data model
is achieved using pythonize
rust library. It allows to represent almost all rust structures using
python objects (via serde serialization).
Python library right now is in iroha_python/iroha2. This directory has some
directories:
iroha2-- iroha2 library itself. Contains client and key generation at rootiroha2.crypto-- iroha crypto bindingsiroha2.data_model-- data model with all instructions, queries and expressionsiroha2.sys-- raw bindings to rust structures wrapped around python objects
iroha_pythonis rust sys library (sys in terms of raw bindings without abstractions)iroha_python/generateis used for generating classes for rust structures
There is a need to regenerate sys sources and update client library after major rust updates in data model.
cd generate
cargo run ../iroha2/sys