Skip to main content

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

iop_python-0.1.0.tar.gz (3.7 MB view hashes)

Uploaded Source

Built Distributions

iop_python-0.1.0-cp310-cp310-macosx_11_0_arm64.whl (2.0 MB view hashes)

Uploaded CPython 3.10 macOS 11.0+ ARM64

iop_python-0.1.0-cp310-cp310-macosx_10_12_x86_64.whl (2.0 MB view hashes)

Uploaded CPython 3.10 macOS 10.12+ x86-64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page