Skip to content

Commit ce1f803

Browse files
committed
removed oob from notebook
1 parent b152370 commit ce1f803

File tree

2 files changed

+70
-33
lines changed

2 files changed

+70
-33
lines changed

tutorials/aries-basic-controller/notebooks/alice/Part 3 - Establishing a Connection.ipynb

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -161,39 +161,6 @@
161161
"print(invite)"
162162
]
163163
},
164-
{
165-
"cell_type": "markdown",
166-
"metadata": {},
167-
"source": [
168-
"## 4a. Use the controller to create an out of band connection invitation"
169-
]
170-
},
171-
{
172-
"cell_type": "code",
173-
"execution_count": 29,
174-
"metadata": {},
175-
"outputs": [
176-
{
177-
"name": "stdout",
178-
"output_type": "stream",
179-
"text": [
180-
"{\"include_handshake\": true, \"use_public_did\": false}\n",
181-
"{\"state\": \"initial\", \"invitation\": {\"@type\": \"did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/out-of-band/1.0/invitation\", \"@id\": \"0945a4a3-ab68-44c1-9929-2399d4eb973c\", \"label\": \"Alice\", \"request~attach\": [], \"handshake_protocols\": [\"https://didcomm.org/connections/1.0/invitation\", \"did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/connections/1.0/invitation\"], \"service\": [{\"id\": \"#inline\", \"type\": \"did-communication\", \"recipientKeys\": [\"did:key:z6Mku6aab9HkD9LNm3ZMrFyzCQ7szRQUFQB91wG52uvaUmXt\"], \"routingKeys\": [], \"serviceEndpoint\": \"http://192.168.65.3:8020\"}]}, \"created_at\": \"2020-10-30 10:27:07.312380Z\", \"invitation_id\": \"c25c888a-ba1a-4ba1-b571-3c50d724dba4\", \"updated_at\": \"2020-10-30 10:27:07.312380Z\", \"trace\": false}\n"
182-
]
183-
}
184-
],
185-
"source": [
186-
"payload = {\n",
187-
" \"include_handshake\": True,\n",
188-
" \"use_public_did\": False\n",
189-
"}\n",
190-
"print(json.dumps(payload))\n",
191-
"\n",
192-
"# Create an out of band Invitation\n",
193-
"oob_invite = await agent_controller.oob.create_invitation(json.dumps(payload))\n",
194-
"print(json.dumps(oob_invite))"
195-
]
196-
},
197164
{
198165
"cell_type": "markdown",
199166
"metadata": {

tutorials/aries-basic-controller/notebooks/alice/Part 8 - Out of Band Protocol.ipynb

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,81 @@
11
{
22
"cells": [
3+
{
4+
"cell_type": "code",
5+
"execution_count": null,
6+
"metadata": {},
7+
"outputs": [],
8+
"source": [
9+
"%autoawait\n",
10+
"import time\n",
11+
"import asyncio"
12+
]
13+
},
14+
{
15+
"cell_type": "code",
16+
"execution_count": null,
17+
"metadata": {},
18+
"outputs": [],
19+
"source": [
20+
"from aries_basic_controller.aries_controller import AriesAgentController\n",
21+
" \n",
22+
"WEBHOOK_HOST = \"0.0.0.0\"\n",
23+
"WEBHOOK_PORT = 8022\n",
24+
"WEBHOOK_BASE = \"\"\n",
25+
"ADMIN_URL = \"http://alice-agent:8021\"\n",
26+
"\n",
27+
"# WARNING: You should use environment variables for this\n",
28+
"# TODO: Make env variables accessible through juypter notebooks\n",
29+
"API_KEY = \"alice_api_123456789\"\n",
30+
"\n",
31+
"# Based on the aca-py agent you wish to control\n",
32+
"agent_controller = AriesAgentController(webhook_host=WEBHOOK_HOST, webhook_port=WEBHOOK_PORT,\n",
33+
" webhook_base=WEBHOOK_BASE, admin_url=ADMIN_URL, api_key=API_KEY)\n"
34+
]
35+
},
36+
{
37+
"cell_type": "code",
38+
"execution_count": null,
39+
"metadata": {},
40+
"outputs": [],
41+
"source": [
42+
"\n",
43+
"loop = asyncio.get_event_loop()\n",
44+
"loop.create_task(agent_controller.listen_webhooks())\n",
45+
"\n",
46+
"agent_controller.register_listeners([], defaults=True)"
47+
]
48+
},
349
{
450
"cell_type": "code",
551
"execution_count": null,
652
"metadata": {},
753
"outputs": [],
854
"source": []
55+
},
56+
{
57+
"cell_type": "markdown",
58+
"metadata": {},
59+
"source": [
60+
"## 4a. Use the controller to create an out of band connection invitation"
61+
]
62+
},
63+
{
64+
"cell_type": "code",
65+
"execution_count": null,
66+
"metadata": {},
67+
"outputs": [],
68+
"source": [
69+
"payload = {\n",
70+
" \"include_handshake\": True,\n",
71+
" \"use_public_did\": False\n",
72+
"}\n",
73+
"print(json.dumps(payload))\n",
74+
"\n",
75+
"# Create an out of band Invitation\n",
76+
"oob_invite = await agent_controller.oob.create_invitation(json.dumps(payload))\n",
77+
"print(json.dumps(oob_invite))"
78+
]
979
}
1080
],
1181
"metadata": {

0 commit comments

Comments
 (0)