Skip to content

Commit e8a6d08

Browse files
committed
minor oob notebook updates
1 parent 4fb74a0 commit e8a6d08

File tree

2 files changed

+87
-58
lines changed

2 files changed

+87
-58
lines changed

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

Lines changed: 30 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -110,26 +110,10 @@
110110
"\n",
111111
"# Create an out of band Invitation\n",
112112
"oob_invite = await agent_controller.oob.create_invitation(payload)\n",
113+
"print(\"COPY OOB INVITE\")\n",
113114
"print(oob_invite[\"invitation\"])"
114115
]
115116
},
116-
{
117-
"cell_type": "code",
118-
"execution_count": 7,
119-
"metadata": {},
120-
"outputs": [
121-
{
122-
"name": "stdout",
123-
"output_type": "stream",
124-
"text": [
125-
"{'state': 'initial', 'created_at': '2020-10-30 12:48:46.900970Z', 'invitation_id': '265b5bbe-175a-40a8-a8bc-31655fe3dabe', 'trace': False, 'invitation': {'@type': 'did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/out-of-band/1.0/invitation', '@id': 'e536ed97-2e32-4133-bf20-7ce998739267', 'label': 'Alice', 'handshake_protocols': ['https://didcomm.org/connections/1.0/invitation', 'did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/connections/1.0/invitation'], 'request~attach': [], 'service': [{'id': '#inline', 'type': 'did-communication', 'recipientKeys': ['did:key:z6Mkn6wscbEJxHZ4Fnf31DwuSfADcWqh6Ncc3fpNJTYHYZHP'], 'routingKeys': [], 'serviceEndpoint': 'http://172.17.0.1:8020'}]}, 'updated_at': '2020-10-30 12:48:46.900970Z'}\n"
126-
]
127-
}
128-
],
129-
"source": [
130-
"print(oob_invite)"
131-
]
132-
},
133117
{
134118
"cell_type": "markdown",
135119
"metadata": {},
@@ -141,49 +125,32 @@
141125
"cell_type": "markdown",
142126
"metadata": {},
143127
"source": [
144-
"## 10. Accept Connection Request for the OOB Connection"
128+
"## 10. Connection Should Now Be Active"
145129
]
146130
},
147131
{
148132
"cell_type": "code",
149133
"execution_count": 8,
150134
"metadata": {},
151-
"outputs": [
152-
{
153-
"name": "stdout",
154-
"output_type": "stream",
155-
"text": [
156-
"{'created_at': '2020-10-30 11:18:20.340874Z', 'invitation_id': '5765c0f0-0618-4164-a88f-cfc43824bb59', 'trace': False, 'updated_at': '2020-10-30 11:18:20.340874Z', 'state': 'initial', 'invitation': {'@type': 'did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/out-of-band/1.0/invitation', '@id': '4a611f31-396a-4e94-bdfb-820d81bde452', 'request~attach': [], 'handshake_protocols': ['https://didcomm.org/connections/1.0/invitation', 'did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/connections/1.0/invitation'], 'label': 'Alice', 'service': [{'id': '#inline', 'type': 'did-communication', 'recipientKeys': ['did:key:z6MkuU5tbz5eQ5e5w2NCB1rHFWX5dbMvu8G1yoiY7M9Zd7cH'], 'routingKeys': [], 'serviceEndpoint': 'http://172.17.0.1:8020'}]}}\n"
157-
]
158-
}
159-
],
160-
"source": [
161-
"print(oob_invite)"
162-
]
163-
},
164-
{
165-
"cell_type": "code",
166-
"execution_count": 9,
167-
"metadata": {},
168135
"outputs": [
169136
{
170137
"data": {
171138
"text/plain": [
172-
"{'results': [{'routing_state': 'none',\n",
173-
" 'accept': 'auto',\n",
174-
" 'invitation_mode': 'once',\n",
175-
" 'my_did': '4J8kyCXH4mHE7UW3E6oqyt',\n",
176-
" 'created_at': '2020-10-30 11:18:20.316265Z',\n",
177-
" 'connection_id': '1e539413-8da2-4e2d-94cf-2620015e3ed5',\n",
139+
"{'results': [{'their_label': 'Bob',\n",
140+
" 'state': 'active',\n",
141+
" 'created_at': '2020-10-30 12:48:46.878516Z',\n",
142+
" 'their_did': '3oyc4duyVFbKq6wKLhqfv5',\n",
178143
" 'initiator': 'self',\n",
179-
" 'updated_at': '2020-10-30 11:19:27.696692Z',\n",
180-
" 'their_label': 'Bob',\n",
181-
" 'their_did': 'p79aZieUZCrLJgxM7Kvkc',\n",
182-
" 'invitation_key': 'G1pr1jqD4Y9cpXXVVStSQQy5p265VF1fHnocH5BYhtpu',\n",
183-
" 'state': 'response'}]}"
144+
" 'invitation_key': '8egq2Lysck4b9HpLKez4bZcDnwZqgVNFMeuSUBaGdLW1',\n",
145+
" 'routing_state': 'none',\n",
146+
" 'updated_at': '2020-10-30 12:52:25.926105Z',\n",
147+
" 'invitation_mode': 'once',\n",
148+
" 'connection_id': '3b715fb1-8c0f-4535-8575-37347af9c1c6',\n",
149+
" 'accept': 'auto',\n",
150+
" 'my_did': '6RoJMQnJikyY2Em2pz7p8Q'}]}"
184151
]
185152
},
186-
"execution_count": 9,
153+
"execution_count": 8,
187154
"metadata": {},
188155
"output_type": "execute_result"
189156
}
@@ -192,6 +159,22 @@
192159
"await agent_controller.connections.get_connections()"
193160
]
194161
},
162+
{
163+
"cell_type": "markdown",
164+
"metadata": {},
165+
"source": [
166+
"## End of Tutorial"
167+
]
168+
},
169+
{
170+
"cell_type": "code",
171+
"execution_count": 9,
172+
"metadata": {},
173+
"outputs": [],
174+
"source": [
175+
"await agent_controller.terminate()"
176+
]
177+
},
195178
{
196179
"cell_type": "code",
197180
"execution_count": null,

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

Lines changed: 57 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
},
2323
{
2424
"cell_type": "code",
25-
"execution_count": 2,
25+
"execution_count": 1,
2626
"metadata": {},
2727
"outputs": [
2828
{
@@ -58,7 +58,7 @@
5858
},
5959
{
6060
"cell_type": "code",
61-
"execution_count": null,
61+
"execution_count": 2,
6262
"metadata": {},
6363
"outputs": [],
6464
"source": [
@@ -88,21 +88,23 @@
8888
},
8989
{
9090
"cell_type": "code",
91-
"execution_count": 6,
91+
"execution_count": 3,
9292
"metadata": {},
9393
"outputs": [
9494
{
9595
"name": "stdout",
9696
"output_type": "stream",
9797
"text": [
98-
"{'request_id': '54503fbb-0f20-475b-b014-e6f411e85dea', 'connection_id': '641c865f-0bfb-4ccd-bc26-e5328a1b3f05', 'their_label': 'Alice', 'accept': 'auto', 'created_at': '2020-10-30 11:28:20.655988Z', 'invitation_key': 'G1pr1jqD4Y9cpXXVVStSQQy5p265VF1fHnocH5BYhtpu', 'my_did': 'HdesGn1FTbpZjq3Sg2U8hQ', 'routing_state': 'none', 'updated_at': '2020-10-30 11:28:20.673566Z', 'initiator': 'external', 'state': 'request', 'invitation_mode': 'once'}\n"
98+
"Connection Webhook : {'connection_id': '4f47cb7e-be35-4a34-8c4c-f0d987aec3aa', 'created_at': '2020-10-30 12:50:49.322105Z', 'routing_state': 'none', 'invitation_key': '8egq2Lysck4b9HpLKez4bZcDnwZqgVNFMeuSUBaGdLW1', 'state': 'invitation', 'accept': 'auto', 'initiator': 'external', 'invitation_mode': 'once', 'updated_at': '2020-10-30 12:50:49.322105Z', 'their_label': 'Alice'}\n",
99+
"Connection Webhook : {'connection_id': '4f47cb7e-be35-4a34-8c4c-f0d987aec3aa', 'created_at': '2020-10-30 12:50:49.322105Z', 'routing_state': 'none', 'invitation_key': '8egq2Lysck4b9HpLKez4bZcDnwZqgVNFMeuSUBaGdLW1', 'state': 'request', 'accept': 'auto', 'initiator': 'external', 'invitation_mode': 'once', 'request_id': 'db6d03a3-04ca-4ed3-9da6-36fc31f3ad95', 'updated_at': '2020-10-30 12:50:49.333258Z', 'my_did': '3oyc4duyVFbKq6wKLhqfv5', 'their_label': 'Alice'}\n",
100+
"{'connection_id': '4f47cb7e-be35-4a34-8c4c-f0d987aec3aa', 'created_at': '2020-10-30 12:50:49.322105Z', 'routing_state': 'none', 'invitation_key': '8egq2Lysck4b9HpLKez4bZcDnwZqgVNFMeuSUBaGdLW1', 'state': 'request', 'accept': 'auto', 'initiator': 'external', 'invitation_mode': 'once', 'request_id': 'db6d03a3-04ca-4ed3-9da6-36fc31f3ad95', 'updated_at': '2020-10-30 12:50:49.333258Z', 'my_did': '3oyc4duyVFbKq6wKLhqfv5', 'their_label': 'Alice'}\n",
101+
"Connection Webhook : {'connection_id': '4f47cb7e-be35-4a34-8c4c-f0d987aec3aa', 'created_at': '2020-10-30 12:50:49.322105Z', 'their_did': '6RoJMQnJikyY2Em2pz7p8Q', 'routing_state': 'none', 'invitation_key': '8egq2Lysck4b9HpLKez4bZcDnwZqgVNFMeuSUBaGdLW1', 'state': 'response', 'accept': 'auto', 'initiator': 'external', 'invitation_mode': 'once', 'request_id': 'db6d03a3-04ca-4ed3-9da6-36fc31f3ad95', 'updated_at': '2020-10-30 12:50:49.421094Z', 'my_did': '3oyc4duyVFbKq6wKLhqfv5', 'their_label': 'Alice'}\n"
99102
]
100103
}
101104
],
102105
"source": [
103106
"import json\n",
104-
"oob_invite = {'@type': 'did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/out-of-band/1.0/invitation', '@id': '4a611f31-396a-4e94-bdfb-820d81bde452', 'request~attach': [], 'handshake_protocols': ['https://didcomm.org/connections/1.0/invitation', 'did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/connections/1.0/invitation'], 'label': 'Alice', 'service': [{'id': '#inline', 'type': 'did-communication', 'recipientKeys': ['did:key:z6MkuU5tbz5eQ5e5w2NCB1rHFWX5dbMvu8G1yoiY7M9Zd7cH'], 'routingKeys': [], 'serviceEndpoint': 'http://172.17.0.1:8020'}]}\n",
105-
"\n",
107+
"oob_invite = {'@type': 'did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/out-of-band/1.0/invitation', '@id': 'e536ed97-2e32-4133-bf20-7ce998739267', 'label': 'Alice', 'handshake_protocols': ['https://didcomm.org/connections/1.0/invitation', 'did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/connections/1.0/invitation'], 'request~attach': [], 'service': [{'id': '#inline', 'type': 'did-communication', 'recipientKeys': ['did:key:z6Mkn6wscbEJxHZ4Fnf31DwuSfADcWqh6Ncc3fpNJTYHYZHP'], 'routingKeys': [], 'serviceEndpoint': 'http://172.17.0.1:8020'}]}\n",
106108
"response = await agent_controller.oob.receive_invitation(oob_invite)\n",
107109
"print(response)"
108110
]
@@ -116,15 +118,16 @@
116118
},
117119
{
118120
"cell_type": "code",
119-
"execution_count": 8,
121+
"execution_count": 4,
120122
"metadata": {},
121123
"outputs": [
122124
{
123125
"name": "stdout",
124126
"output_type": "stream",
125127
"text": [
126-
"641c865f-0bfb-4ccd-bc26-e5328a1b3f05\n",
127-
"{'request_id': '54503fbb-0f20-475b-b014-e6f411e85dea', 'connection_id': '641c865f-0bfb-4ccd-bc26-e5328a1b3f05', 'their_label': 'Alice', 'accept': 'auto', 'created_at': '2020-10-30 11:28:20.655988Z', 'invitation_key': 'G1pr1jqD4Y9cpXXVVStSQQy5p265VF1fHnocH5BYhtpu', 'my_did': 'HdesGn1FTbpZjq3Sg2U8hQ', 'routing_state': 'none', 'updated_at': '2020-10-30 11:28:20.673566Z', 'initiator': 'external', 'state': 'request', 'invitation_mode': 'once'}\n"
128+
"4f47cb7e-be35-4a34-8c4c-f0d987aec3aa\n",
129+
"{'connection_id': '4f47cb7e-be35-4a34-8c4c-f0d987aec3aa', 'created_at': '2020-10-30 12:50:49.322105Z', 'their_did': '6RoJMQnJikyY2Em2pz7p8Q', 'routing_state': 'none', 'invitation_key': '8egq2Lysck4b9HpLKez4bZcDnwZqgVNFMeuSUBaGdLW1', 'state': 'response', 'accept': 'auto', 'initiator': 'external', 'invitation_mode': 'once', 'request_id': 'db6d03a3-04ca-4ed3-9da6-36fc31f3ad95', 'updated_at': '2020-10-30 12:50:49.421094Z', 'my_did': '3oyc4duyVFbKq6wKLhqfv5', 'their_label': 'Alice'}\n",
130+
"Connection State : response\n"
128131
]
129132
}
130133
],
@@ -142,9 +145,52 @@
142145
"cell_type": "markdown",
143146
"metadata": {},
144147
"source": [
145-
"## 9. Continue in the Sender [Notebook](http://localhost:8888/notebooks/Part%208%20-%20Out%20of%20Band%20Protocol.ipynb)\n",
148+
"## 9. Send Trust Ping\n",
146149
"\n",
147-
"You will need to accept the request and send a trust ping before this connection moves to the active state."
150+
"This moves the connection to the active state"
151+
]
152+
},
153+
{
154+
"cell_type": "code",
155+
"execution_count": 6,
156+
"metadata": {},
157+
"outputs": [
158+
{
159+
"data": {
160+
"text/plain": [
161+
"{'thread_id': '85e649b0-0fea-4691-a5ae-61dfc51e643c'}"
162+
]
163+
},
164+
"execution_count": 6,
165+
"metadata": {},
166+
"output_type": "execute_result"
167+
},
168+
{
169+
"name": "stdout",
170+
"output_type": "stream",
171+
"text": [
172+
"Connection Webhook : {'connection_id': '4f47cb7e-be35-4a34-8c4c-f0d987aec3aa', 'created_at': '2020-10-30 12:50:49.322105Z', 'their_did': '6RoJMQnJikyY2Em2pz7p8Q', 'routing_state': 'none', 'invitation_key': '8egq2Lysck4b9HpLKez4bZcDnwZqgVNFMeuSUBaGdLW1', 'state': 'active', 'accept': 'auto', 'initiator': 'external', 'invitation_mode': 'once', 'request_id': 'db6d03a3-04ca-4ed3-9da6-36fc31f3ad95', 'updated_at': '2020-10-30 12:52:25.954656Z', 'my_did': '3oyc4duyVFbKq6wKLhqfv5', 'their_label': 'Alice'}\n"
173+
]
174+
}
175+
],
176+
"source": [
177+
"await agent_controller.messaging.trust_ping(connection_id, \"active\")"
178+
]
179+
},
180+
{
181+
"cell_type": "markdown",
182+
"metadata": {},
183+
"source": [
184+
"## End Tutorial\n"
185+
]
186+
},
187+
{
188+
"cell_type": "code",
189+
"execution_count": 7,
190+
"metadata": {},
191+
"outputs": [],
192+
"source": [
193+
"await agent_controller.terminate()"
148194
]
149195
},
150196
{

0 commit comments

Comments
 (0)