|
19 | 19 | # but it gives us a key that we can use to sign a ledger transaction that we're going to submit later. |
20 | 20 | print_log('\n5. Generating and storing steward DID and verkey\n') |
21 | 21 |
|
22 | | - |
23 | 22 | # The DID and public verkey for this steward key are already in the ledger; they were part of the genesis |
24 | 23 | # transactions we told the SDK to start with in the previous step. But we have to also put the DID, verkey, |
25 | 24 | # and private signing key into our wallet, so we can use the signing key to submit an acceptably signed |
|
33 | 32 | steward_did, steward_verkey = await did.create_and_store_my_did(wallet_handle, did_json) |
34 | 33 | print_log('Steward DID: ', steward_did) |
35 | 34 |
|
36 | | - |
37 | 35 | # Now, create a new DID and verkey for a trust anchor, and store it in our wallet as well. Don't use a seed; |
38 | 36 | # this DID and its keyas are secure and random. Again, we're not writing to the ledger yet. |
39 | 37 | print_log('\n6. Generating and storing trust anchor DID and verkey\n') |
|
46 | 44 | # This call will look up the private key of the steward DID in our wallet, and use it to sign the transaction. |
47 | 45 | print_log('\n7. Building NYM request to add Trust Anchor to the ledger\n') |
48 | 46 | nym_transaction_request = await ledger.build_nym_request(submitter_did=steward_did, |
49 | | - target_did=trust_anchor_did, |
50 | | - ver_key=trust_anchor_verkey, |
51 | | - alias=None, |
52 | | - role='TRUST_ANCHOR') |
| 47 | + target_did=trust_anchor_did, |
| 48 | + ver_key=trust_anchor_verkey, |
| 49 | + alias=None, |
| 50 | + role='TRUST_ANCHOR') |
| 51 | + |
53 | 52 | print_log('NYM request: ') |
54 | 53 | pprint.pprint(json.loads(nym_transaction_request)) |
55 | 54 |
|
|
59 | 58 | # network). |
60 | 59 | print_log('\n8. Sending NYM request to the ledger\n') |
61 | 60 | nym_transaction_response = await ledger.sign_and_submit_request(pool_handle=pool_handle, |
62 | | - wallet_handle=wallet_handle, |
63 | | - submitter_did=steward_did, |
64 | | - request_json=nym_transaction_request) |
| 61 | + wallet_handle=wallet_handle, |
| 62 | + submitter_did=steward_did, |
| 63 | + request_json=nym_transaction_request) |
| 64 | + |
65 | 65 | print_log('NYM response: ') |
66 | 66 | pprint.pprint(json.loads(nym_transaction_response)) |
67 | 67 |
|
|
0 commit comments