|
18 | 18 | },
|
19 | 19 | {
|
20 | 20 | "cell_type": "code",
|
21 |
| - "execution_count": 1, |
| 21 | + "execution_count": null, |
22 | 22 | "metadata": {},
|
23 |
| - "outputs": [ |
24 |
| - { |
25 |
| - "name": "stdout", |
26 |
| - "output_type": "stream", |
27 |
| - "text": [ |
28 |
| - "IPython autoawait is `on`, and set to use `asyncio`\n" |
29 |
| - ] |
30 |
| - } |
31 |
| - ], |
| 23 | + "outputs": [], |
32 | 24 | "source": [
|
33 | 25 | "%autoawait\n",
|
34 | 26 | "import time\n",
|
|
42 | 34 | "ADMIN_URL = \"http://issuer-agent:8021\"\n",
|
43 | 35 | "\n",
|
44 | 36 | "# Based on the aca-py agent you wish to control\n",
|
45 |
| - "agent_controller = AriesAgentController(webhook_host=WEBHOOK_HOST, webhook_port=WEBHOOK_PORT,\n", |
46 |
| - " webhook_base=WEBHOOK_BASE, admin_url=ADMIN_URL)" |
| 37 | + "agent_controller = AriesAgentController(admin_url=ADMIN_URL)" |
| 38 | + ] |
| 39 | + }, |
| 40 | + { |
| 41 | + "cell_type": "code", |
| 42 | + "execution_count": null, |
| 43 | + "metadata": {}, |
| 44 | + "outputs": [], |
| 45 | + "source": [ |
| 46 | + "agent_controller.init_webhook_server(webhook_host=WEBHOOK_HOST,\n", |
| 47 | + " webhook_port=WEBHOOK_PORT,\n", |
| 48 | + " webhook_base=WEBHOOK_BASE)" |
47 | 49 | ]
|
48 | 50 | },
|
49 | 51 | {
|
|
57 | 59 | },
|
58 | 60 | {
|
59 | 61 | "cell_type": "code",
|
60 |
| - "execution_count": 4, |
| 62 | + "execution_count": null, |
61 | 63 | "metadata": {},
|
62 |
| - "outputs": [ |
63 |
| - { |
64 |
| - "name": "stdout", |
65 |
| - "output_type": "stream", |
66 |
| - "text": [ |
67 |
| - "{'result': {'did': 'MjFQDoitt2us2JNpLBGnSY', 'verkey': 'CJGSRQvPb9defKY6w8YW8rprDhKiTqkmexp1P8ioUznY', 'posture': 'public'}}\n" |
68 |
| - ] |
69 |
| - } |
70 |
| - ], |
| 64 | + "outputs": [], |
71 | 65 | "source": [
|
72 | 66 | "response = await agent_controller.wallet.get_public_did()\n",
|
73 | 67 | "print(response)"
|
|
82 | 76 | },
|
83 | 77 | {
|
84 | 78 | "cell_type": "code",
|
85 |
| - "execution_count": 3, |
| 79 | + "execution_count": null, |
86 | 80 | "metadata": {},
|
87 |
| - "outputs": [ |
88 |
| - { |
89 |
| - "ename": "ClientResponseError", |
90 |
| - "evalue": "400, message='Ledger rejected transaction request: client request invalid: could not authenticate, verkey for MjFQDoitt2us2JNpLBGnSY cannot be found', url=URL('http://issuer-agent:8021/credential-definitions')", |
91 |
| - "output_type": "error", |
92 |
| - "traceback": [ |
93 |
| - "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", |
94 |
| - "\u001b[0;31mClientResponseError\u001b[0m Traceback (most recent call last)", |
95 |
| - "\u001b[0;32m<ipython-input-3-bec74d987218>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[0mschema_id\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m'MGgoJXWbeupKsaHDa7s4fW:2:testabc:0.0.1'\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 2\u001b[0;31m \u001b[0mresponse\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32mawait\u001b[0m \u001b[0magent_controller\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mdefinitions\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mwrite_cred_def\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mschema_id\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m", |
96 |
| - "\u001b[0;32m/aries_basic_controller/controllers/definitions.py\u001b[0m in \u001b[0;36mwrite_cred_def\u001b[0;34m(self, schema_id, tag, support_revocation)\u001b[0m\n\u001b[1;32m 22\u001b[0m }\n\u001b[1;32m 23\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 24\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0;32mawait\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0madmin_POST\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34mf\"{self.base_url}\"\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mbody\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 25\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 26\u001b[0m async def search_created(self, schema_id = None, schema_issuer_did=None, schema_name=None,\n", |
97 |
| - "\u001b[0;32m/aries_basic_controller/controllers/base.py\u001b[0m in \u001b[0;36madmin_POST\u001b[0;34m(self, path, json_data, text, params, data)\u001b[0m\n\u001b[1;32m 93\u001b[0m \u001b[0;34m(\u001b[0m\u001b[0;34m\" with data: \\n{}\"\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mformat\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mrepr_json\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mjson_data\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mjson_data\u001b[0m \u001b[0;32melse\u001b[0m \u001b[0;34m\"\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 94\u001b[0m )\n\u001b[0;32m---> 95\u001b[0;31m \u001b[0mresponse\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32mawait\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0madmin_request\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\"POST\"\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mpath\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mjson_data\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtext\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mparams\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mdata\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 96\u001b[0m EVENT_LOGGER.debug(\n\u001b[1;32m 97\u001b[0m \u001b[0;34m\"Response from POST %s received: \\n%s\"\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", |
98 |
| - "\u001b[0;32m/aries_basic_controller/controllers/base.py\u001b[0m in \u001b[0;36madmin_request\u001b[0;34m(self, method, path, json_data, text, params, data)\u001b[0m\n\u001b[1;32m 61\u001b[0m \u001b[0mmethod\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0madmin_url\u001b[0m \u001b[0;34m+\u001b[0m \u001b[0mpath\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mjson\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mjson_data\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mparams\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mparams\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mdata\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mdata\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 62\u001b[0m ) as resp:\n\u001b[0;32m---> 63\u001b[0;31m \u001b[0mresp\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mraise_for_status\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 64\u001b[0m \u001b[0mresp_text\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32mawait\u001b[0m \u001b[0mresp\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtext\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 65\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0;32mnot\u001b[0m \u001b[0mresp_text\u001b[0m \u001b[0;32mand\u001b[0m \u001b[0;32mnot\u001b[0m \u001b[0mtext\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", |
99 |
| - "\u001b[0;32m/opt/conda/lib/python3.8/site-packages/aiohttp/client_reqrep.py\u001b[0m in \u001b[0;36mraise_for_status\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 998\u001b[0m \u001b[0;32massert\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mreason\u001b[0m \u001b[0;32mis\u001b[0m \u001b[0;32mnot\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 999\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mrelease\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 1000\u001b[0;31m raise ClientResponseError(\n\u001b[0m\u001b[1;32m 1001\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mrequest_info\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1002\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mhistory\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", |
100 |
| - "\u001b[0;31mClientResponseError\u001b[0m: 400, message='Ledger rejected transaction request: client request invalid: could not authenticate, verkey for MjFQDoitt2us2JNpLBGnSY cannot be found', url=URL('http://issuer-agent:8021/credential-definitions')" |
101 |
| - ] |
102 |
| - }, |
103 |
| - { |
104 |
| - "name": "stderr", |
105 |
| - "output_type": "stream", |
106 |
| - "text": [ |
107 |
| - "Warning: Output is not a terminal (fd=None).\n" |
108 |
| - ] |
109 |
| - }, |
110 |
| - { |
111 |
| - "name": "stdout", |
112 |
| - "output_type": "stream", |
113 |
| - "text": [ |
114 |
| - "\u001b[0m\u001b[?7h\u001b[0;34mError during POST /credential-definitions: 400, message='Ledger rejected transaction request: client request invalid: could not authenticate, verkey for MjFQDoitt2us2JNpLBGnSY cannot be found', url=URL('http://issuer-agent:8021/credential-definitions')\u001b[0m\n", |
115 |
| - "\u001b[0m" |
116 |
| - ] |
117 |
| - } |
118 |
| - ], |
| 81 | + "outputs": [], |
119 | 82 | "source": [
|
120 | 83 | "schema_id = 'MGgoJXWbeupKsaHDa7s4fW:2:testabc:0.0.1'\n",
|
121 | 84 | "response = await agent_controller.definitions.write_cred_def(schema_id)"
|
|
132 | 95 | },
|
133 | 96 | {
|
134 | 97 | "cell_type": "code",
|
135 |
| - "execution_count": 5, |
| 98 | + "execution_count": null, |
136 | 99 | "metadata": {},
|
137 |
| - "outputs": [ |
138 |
| - { |
139 |
| - "name": "stdout", |
140 |
| - "output_type": "stream", |
141 |
| - "text": [ |
142 |
| - "New DID {'did': 'Chd378GJNMskEvivsowWtL', 'verkey': '7NsZLoUwjas2Jyk5aCGwc6x9eVxaNNjVT1g1LUbin4ui', 'posture': 'wallet_only'}\n" |
143 |
| - ] |
144 |
| - } |
145 |
| - ], |
| 100 | + "outputs": [], |
146 | 101 | "source": [
|
147 | 102 | "# generate new DID\n",
|
148 | 103 | "response = await agent_controller.wallet.create_did()\n",
|
|
164 | 119 | },
|
165 | 120 | {
|
166 | 121 | "cell_type": "code",
|
167 |
| - "execution_count": 6, |
| 122 | + "execution_count": null, |
168 | 123 | "metadata": {},
|
169 |
| - "outputs": [ |
170 |
| - { |
171 |
| - "name": "stdout", |
172 |
| - "output_type": "stream", |
173 |
| - "text": [ |
174 |
| - "{'statusCode': 200, 'headers': {'Access-Control-Allow-Origin': '*'}, 'body': '{\"statusCode\": 200, \"Chd378GJNMskEvivsowWtL\": {\"status\": \"Success\", \"statusCode\": 200, \"reason\": \"Successfully wrote NYM identified by Chd378GJNMskEvivsowWtL to the ledger with role ENDORSER\"}}'}\n", |
175 |
| - "200\n" |
176 |
| - ] |
177 |
| - } |
178 |
| - ], |
| 124 | + "outputs": [], |
179 | 125 | "source": [
|
180 | 126 | "# write new DID to Sovrin Stagingnet\n",
|
181 | 127 | "import requests\n",
|
|
0 commit comments