Skip to content

Commit

Permalink
adding files
Browse files Browse the repository at this point in the history
Signed-off-by: Atharva Amritkar <[email protected]>
  • Loading branch information
wiredhikari committed Dec 23, 2023
1 parent 64c5161 commit f11864e
Show file tree
Hide file tree
Showing 8 changed files with 765 additions and 255 deletions.
34 changes: 34 additions & 0 deletions wrappers/python/demo/ledger_check.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/usr/bin/python3

import asyncio
import pprint

from indy_vdr import ledger, pool

# import indy_vdr

path = "/home/hikar/genesis.txn"
TRUSTEE_SEED = b"000000000000000000000000Steward2"
TRUSTEE_ID = "EbP4aYNeTHL6q385GuVpRV"

async def check():
req = ledger.build_get_txn_request(None, 1, 1)
my_pool = await pool.open_pool(path)

first_txn = await my_pool.submit_request(req)
print("First txn: ")
pprint.pprint(first_txn['data']['txn'])

ledger_size = first_txn['data']['ledgerSize']

req = ledger.build_get_txn_request(None, 1, ledger_size)

last_txn = await my_pool.submit_request(req)

print("Last txn: ")
pprint.pprint(last_txn['data']['txn'])

print(f"Ledger size: {ledger_size}")

if __name__ == "__main__":
asyncio.run(check())
34 changes: 34 additions & 0 deletions wrappers/python/demo/readdid.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/usr/bin/python3

import asyncio
import logging
import os
import random
import sys
import traceback

import base58
import nacl.encoding
import nacl.signing
from hypercorn.asyncio import serve
from hypercorn.config import Config
from quart import Quart, send_file

from indy_vdr import ledger, pool
TRUSTEE_ID = "EbP4aYNeTHL6q385GuVpRV"

async def read_did():

GENESIS_FILE = "/home/hikar/genesis.txn"
indy_pool = await pool.open_pool(GENESIS_FILE)
# global indy_pool
#logger.info('Received read-did request')
get_req = ledger.build_get_nym_request(None, TRUSTEE_ID)
result = await indy_pool.submit_request(get_req)
print(result)
print("as")
asyncio.run(read_did())
# logger.info(f"Read DID: {result}\n")
# return "Read DID!"
# read_did()
# aliases = ["Alice", "Bob", "Charlie", "Dean", "Eric"]
Loading

0 comments on commit f11864e

Please sign in to comment.