No project description provided
Project description
Hydra-Python-API
Building a python Api for hydra-ledger blockchain using Maturin and Rust wasm
Installation
Prerequisite
- Rust
- Maturin
- Python > 3.8
Enter the base directory of the project and activate the virtual environment with the following command and install the required python packages.
source env/bin/activate
pip install -r requirements.txt
To compile the code, you can run the following command. This command builds a python wheel for the rust code.
maturin develop
Usage
hydra.py
contains a module that interacts with the hydra testnet. To use the module, you can import the HydraWallet
class from api/hydra.py.
from hydra import HydraWallet, HydraChain
A example method that verifies a signed statement can be found in the module
chain = HydraChain()
signed_statement = {
"signature": "00987890098776556667788976676787655"
"claim": {
"subject": "did:morpheus:ezbeWGSY2dqcUBqT8K7R14xr",
"content": {}...},
}
result = chain.verify_signed_statement(signed_statement)
print(result)
>>> True
WALLET APPLICATION
To spin up the wallet application run the command below in the base directory
python3 app.py
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for iop_python-0.1.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5dbd4f73f31279a646c7f392d3baf5abd9d08105336b6edcedcfe9f9c584203f |
|
MD5 | a96d225961ee5792ea61f7448b63f827 |
|
BLAKE2b-256 | 631bf0159ffa111a32b2fb3669936c51b9d302cc47212b71f80e64298de138c3 |
Hashes for iop_python-0.1.0-cp310-cp310-macosx_10_12_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2688c2e76e67a7fa23d15ad5842ac0600cf17c832c01283058daac10e57e7a5e |
|
MD5 | c69afd5f45a4b369aece867829cf7e97 |
|
BLAKE2b-256 | d9ccde85287fe80e0b17cd5c1ff492e1209ff7ceaee160aa0c0e871e970127dd |