Giter Club home page Giter Club logo

hydra-python-api's Introduction

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

hydra-python-api's People

Contributors

bukioffor avatar

Forkers

dimonwoo

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.