|
45 | 45 | },
|
46 | 46 | {
|
47 | 47 | "cell_type": "code",
|
48 |
| - "execution_count": 1, |
| 48 | + "execution_count": null, |
49 | 49 | "metadata": {},
|
50 |
| - "outputs": [ |
51 |
| - { |
52 |
| - "name": "stdout", |
53 |
| - "output_type": "stream", |
54 |
| - "text": [ |
55 |
| - "IPython autoawait is `on`, and set to use `asyncio`\n" |
56 |
| - ] |
57 |
| - } |
58 |
| - ], |
| 50 | + "outputs": [], |
59 | 51 | "source": [
|
60 | 52 | "%autoawait\n",
|
61 | 53 | "import time\n",
|
|
84 | 76 | },
|
85 | 77 | {
|
86 | 78 | "cell_type": "code",
|
87 |
| - "execution_count": 2, |
| 79 | + "execution_count": null, |
88 | 80 | "metadata": {},
|
89 |
| - "outputs": [ |
90 |
| - { |
91 |
| - "name": "stdout", |
92 |
| - "output_type": "stream", |
93 |
| - "text": [ |
94 |
| - "{'result': None}\n" |
95 |
| - ] |
96 |
| - } |
97 |
| - ], |
| 81 | + "outputs": [], |
98 | 82 | "source": [
|
99 | 83 | "response = await agent_controller.wallet.get_public_did()\n",
|
100 | 84 | "print(response)"
|
|
111 | 95 | },
|
112 | 96 | {
|
113 | 97 | "cell_type": "code",
|
114 |
| - "execution_count": 3, |
| 98 | + "execution_count": null, |
115 | 99 | "metadata": {},
|
116 |
| - "outputs": [ |
117 |
| - { |
118 |
| - "name": "stdout", |
119 |
| - "output_type": "stream", |
120 |
| - "text": [ |
121 |
| - "New DID {'did': 'XXGYrwtSiPtqkhncbhuWMJ', 'verkey': 'HdrfXbbCh7wgMAyxiXTSpJiYDybtutRFqve5bi25DxZd', 'public': False}\n" |
122 |
| - ] |
123 |
| - } |
124 |
| - ], |
| 100 | + "outputs": [], |
125 | 101 | "source": [
|
126 | 102 | "# generate new DID\n",
|
127 | 103 | "response = await agent_controller.wallet.create_did()\n",
|
|
143 | 119 | },
|
144 | 120 | {
|
145 | 121 | "cell_type": "code",
|
146 |
| - "execution_count": 4, |
| 122 | + "execution_count": null, |
147 | 123 | "metadata": {},
|
148 |
| - "outputs": [ |
149 |
| - { |
150 |
| - "name": "stdout", |
151 |
| - "output_type": "stream", |
152 |
| - "text": [ |
153 |
| - "{'statusCode': 200, 'headers': {'Access-Control-Allow-Origin': '*'}, 'body': '{\"statusCode\": 200, \"XXGYrwtSiPtqkhncbhuWMJ\": {\"status\": \"Success\", \"statusCode\": 200, \"reason\": \"Successfully wrote NYM identified by XXGYrwtSiPtqkhncbhuWMJ to the ledger with role ENDORSER\"}}'}\n", |
154 |
| - "200\n" |
155 |
| - ] |
156 |
| - } |
157 |
| - ], |
| 124 | + "outputs": [], |
158 | 125 | "source": [
|
159 | 126 | "# write new DID to Sovrin Stagingnet\n",
|
160 | 127 | "import requests\n",
|
|
202 | 169 | },
|
203 | 170 | {
|
204 | 171 | "cell_type": "code",
|
205 |
| - "execution_count": 5, |
206 |
| - "metadata": { |
207 |
| - "scrolled": false |
208 |
| - }, |
| 172 | + "execution_count": null, |
| 173 | + "metadata": {}, |
209 | 174 | "outputs": [],
|
210 | 175 | "source": [
|
211 | 176 | "response = await agent_controller.ledger.get_taa()\n",
|
|
224 | 189 | },
|
225 | 190 | {
|
226 | 191 | "cell_type": "code",
|
227 |
| - "execution_count": 6, |
| 192 | + "execution_count": null, |
228 | 193 | "metadata": {},
|
229 |
| - "outputs": [ |
230 |
| - { |
231 |
| - "name": "stdout", |
232 |
| - "output_type": "stream", |
233 |
| - "text": [ |
234 |
| - "{}\n" |
235 |
| - ] |
236 |
| - } |
237 |
| - ], |
| 194 | + "outputs": [], |
238 | 195 | "source": [
|
239 | 196 | "response = await agent_controller.ledger.accept_taa(taa_record)\n",
|
240 | 197 | "## Will return {} if successful\n",
|
|
252 | 209 | },
|
253 | 210 | {
|
254 | 211 | "cell_type": "code",
|
255 |
| - "execution_count": 7, |
| 212 | + "execution_count": null, |
256 | 213 | "metadata": {},
|
257 |
| - "outputs": [ |
258 |
| - { |
259 |
| - "name": "stdout", |
260 |
| - "output_type": "stream", |
261 |
| - "text": [ |
262 |
| - "{'result': {'did': 'XXGYrwtSiPtqkhncbhuWMJ', 'verkey': 'HdrfXbbCh7wgMAyxiXTSpJiYDybtutRFqve5bi25DxZd', 'public': True}}\n" |
263 |
| - ] |
264 |
| - } |
265 |
| - ], |
| 214 | + "outputs": [], |
266 | 215 | "source": [
|
267 | 216 | "response = await agent_controller.wallet.assign_public_did(did_object[\"did\"])\n",
|
268 | 217 | "print(response)"
|
|
277 | 226 | },
|
278 | 227 | {
|
279 | 228 | "cell_type": "code",
|
280 |
| - "execution_count": 8, |
| 229 | + "execution_count": null, |
281 | 230 | "metadata": {},
|
282 |
| - "outputs": [ |
283 |
| - { |
284 |
| - "name": "stdout", |
285 |
| - "output_type": "stream", |
286 |
| - "text": [ |
287 |
| - "{'result': {'did': 'XXGYrwtSiPtqkhncbhuWMJ', 'verkey': 'HdrfXbbCh7wgMAyxiXTSpJiYDybtutRFqve5bi25DxZd', 'public': True}}\n", |
288 |
| - "\n", |
289 |
| - "Issuer public DID: XXGYrwtSiPtqkhncbhuWMJ\n" |
290 |
| - ] |
291 |
| - } |
292 |
| - ], |
| 231 | + "outputs": [], |
293 | 232 | "source": [
|
294 | 233 | "response = await agent_controller.wallet.get_public_did()\n",
|
295 | 234 | "print(response)\n",
|
|
308 | 247 | },
|
309 | 248 | {
|
310 | 249 | "cell_type": "code",
|
311 |
| - "execution_count": 9, |
| 250 | + "execution_count": null, |
312 | 251 | "metadata": {},
|
313 |
| - "outputs": [ |
314 |
| - { |
315 |
| - "name": "stdout", |
316 |
| - "output_type": "stream", |
317 |
| - "text": [ |
318 |
| - "{'verkey': 'HdrfXbbCh7wgMAyxiXTSpJiYDybtutRFqve5bi25DxZd'}\n" |
319 |
| - ] |
320 |
| - } |
321 |
| - ], |
| 252 | + "outputs": [], |
322 | 253 | "source": [
|
323 | 254 | "issuer_verkey = await agent_controller.ledger.get_did_verkey(issuer_nym)\n",
|
324 | 255 | "print(issuer_verkey)"
|
|
335 | 266 | },
|
336 | 267 | {
|
337 | 268 | "cell_type": "code",
|
338 |
| - "execution_count": 10, |
| 269 | + "execution_count": null, |
339 | 270 | "metadata": {},
|
340 |
| - "outputs": [ |
341 |
| - { |
342 |
| - "name": "stdout", |
343 |
| - "output_type": "stream", |
344 |
| - "text": [ |
345 |
| - "{'endpoint': 'https://580a595cb1c9.ngrok.io'}\n" |
346 |
| - ] |
347 |
| - } |
348 |
| - ], |
| 271 | + "outputs": [], |
349 | 272 | "source": [
|
350 | 273 | "issuer_endpoint = await agent_controller.ledger.get_did_endpoint(issuer_nym)\n",
|
351 | 274 | "print(issuer_endpoint)"
|
|
360 | 283 | },
|
361 | 284 | {
|
362 | 285 | "cell_type": "code",
|
363 |
| - "execution_count": 11, |
| 286 | + "execution_count": null, |
364 | 287 | "metadata": {},
|
365 | 288 | "outputs": [],
|
366 | 289 | "source": [
|
|
370 | 293 | },
|
371 | 294 | {
|
372 | 295 | "cell_type": "code",
|
373 |
| - "execution_count": 12, |
| 296 | + "execution_count": null, |
374 | 297 | "metadata": {},
|
375 |
| - "outputs": [ |
376 |
| - { |
377 |
| - "name": "stdout", |
378 |
| - "output_type": "stream", |
379 |
| - "text": [ |
380 |
| - "XXGYrwtSiPtqkhncbhuWMJ:3:CL:141256:default\n", |
381 |
| - "Stored 'cred_def_id' (str)\n", |
382 |
| - "Stored 'schema_id' (str)\n" |
383 |
| - ] |
384 |
| - } |
385 |
| - ], |
| 298 | + "outputs": [], |
386 | 299 | "source": [
|
387 | 300 | "cred_def_id = response[\"credential_definition_id\"]\n",
|
388 | 301 | "print(cred_def_id)\n",
|
|
401 | 314 | },
|
402 | 315 | {
|
403 | 316 | "cell_type": "code",
|
404 |
| - "execution_count": 13, |
| 317 | + "execution_count": null, |
405 | 318 | "metadata": {},
|
406 |
| - "outputs": [ |
407 |
| - { |
408 |
| - "name": "stdout", |
409 |
| - "output_type": "stream", |
410 |
| - "text": [ |
411 |
| - "None\n" |
412 |
| - ] |
413 |
| - } |
414 |
| - ], |
| 319 | + "outputs": [], |
415 | 320 | "source": [
|
416 | 321 | "response = await agent_controller.terminate()\n",
|
417 | 322 | "print(response)"
|
|
0 commit comments