This repository has been archived by the owner on Aug 19, 2020. It is now read-only.
forked from hyperledger-archives/indy-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Template.cs
46 lines (34 loc) · 1.55 KB
/
Template.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// these are packages from .NET Core and other Nuget packages
using System;
using Newtonsoft.Json.Linq;
/*
Example demonstrating how to add DID with the role of Trust Anchor as Steward.
Uses seed to obtain Steward's DID which already exists on the ledger.
Then it generates new DID/Verkey pair for Trust Anchor.
Using Steward's DID, NYM transaction request is built to add Trust Anchor's DID and Verkey
on the ledger with the role of Trust Anchor.
Once the NYM is successfully written on the ledger, it generates new DID/Verkey pair that represents
a client, which are used to create GET_NYM request to query the ledger and confirm Trust Anchor's Verkey.
For the sake of simplicity, a single wallet is used. In the real world scenario, three different wallets
would be used and DIDs would be exchanged using some channel of communication
*/
// These packages are from the Hyperledger Nuget package
using Hyperledger.Indy.DidApi;
using Hyperledger.Indy.LedgerApi;
using Hyperledger.Indy.PoolApi;
using Hyperledger.Indy.WalletApi;
public class WriteDIDAndQueryVerkey
{
public static void Demo()
{
Console.WriteLine("Step 1 -- set up some constants");
string walletName = "myWallet";
string poolName = "pool";
string stewardSeed = "000000000000000000000000Steward1";
string poolConfig = "{\"genesis_txn\": \"/home/vagrant/code/evernym/indy-sdk/cli/docker_pool_transactions_genesis\"}";
// Step 2 code goes here.
// Step 3 code goes here.
// Step 4 code goes here.
// Step 5 code goes here.
}
}