forked from hyperledger/indy-vdr
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Atharva Amritkar <[email protected]>
- Loading branch information
1 parent
64c5161
commit f11864e
Showing
8 changed files
with
765 additions
and
255 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] |
Oops, something went wrong.