Skip to content

Commit ea8f3b6

Browse files
committed
Finish user guide
1 parent 70a4790 commit ea8f3b6

2 files changed

Lines changed: 64 additions & 6 deletions

File tree

TODO

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,6 @@ TODO: Use data (instead of value) in Fragment for consistency. Also in documenta
6262

6363
TODO: Rename topology file to configuration file
6464

65-
TODO: Use configuration file dske_default_config.yaml by default
65+
TODO: Use configuration file dske_default_config.yaml by default
66+
67+
TODO: Avoid usage: __main__.py in --help output for client / hub

docs/user-guide.md

Lines changed: 61 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -246,9 +246,65 @@ Waiting for client carol, client corrie, hub hank to be started
246246

247247
## Starting and stopping nodes directly
248248

249-
TODO: Document this
249+
Behind the scenes, the `manager.py` script spawns a separate Python process each client node
250+
and for each hub node.
251+
If you so desire, you can also start these Python processes manually.
250252

251-
TODO: Continue from here
253+
The Python module `client` implements the client node process.
254+
Use the `--help` option to see its usage:
255+
256+
<pre>
257+
$ <b>python -m client --help</b>
258+
usage: __main__.py [-h] [--port PORT] [--hubs HUBS [HUBS ...]] name
259+
260+
DSKE Client
261+
262+
positional arguments:
263+
name Client name
264+
265+
options:
266+
-h, --help show this help message and exit
267+
--port PORT Port number
268+
--hubs HUBS [HUBS ...]
269+
Base URLs for hubs (e.g., http://127.0.0.1:8100)
270+
</pre>
271+
272+
The typical usage is to provide the client name, the port number, and a list of base URLs for
273+
the hubs in the network. For example:
274+
275+
<pre>
276+
$ <b>python -m client carol --port 8105 --hubs http://127.0.0.1:8100/hub/hank http://127.0.0.1:8101/hub/helen http://127.0.0.1:8102/hub/hilary http://127.0.0.1:8103/hub/holly http://127.0.0.1:8104/hub/hugo</b>
277+
</pre>
278+
279+
Similarly, the Python module `hub` implements the client node process.
280+
Use the `--help` option to see its usage:
281+
282+
<pre>
283+
$ <b>python -m hub --help</b>
284+
285+
usage: __main__.py [-h] [-p PORT] name
286+
287+
DSKE Hub
288+
289+
positional arguments:
290+
name Hub name
291+
292+
options:
293+
-h, --help show this help message and exit
294+
-p, --port PORT Port number
295+
</pre>
296+
297+
The typical usage is to provide the hub name and the port number.
298+
299+
<pre>
300+
$ <b>python -m hub helen --port 8101
301+
</pre>
302+
303+
As you can see, manually starting clients and hubs involves typing long error-prone commands
304+
and requires some book-keeping about which node uses which TCP port number.
305+
This is why the `manager.py` script exists;
306+
it collects all the necessary information from the topology file and starts all the nodes with
307+
the correct (long) command-line arguments.
252308

253309
## Get encryption keys
254310

@@ -498,17 +554,17 @@ and then click on "Try it out").
498554
Here is an example of the automatically generated documentation at `http://127.0.0.1:8105/docs`
499555
for a client node:
500556

501-
![Client REST API documentation](docs/figures/client-rest-api-documentation.png)
557+
![Client REST API documentation](figures/client-rest-api-documentation.png)
502558

503559
Here is an example of the automatically generated documentation at `http://127.0.0.1:8100/docs`
504560
for a hub node:
505561

506-
![Hub REST API documentation](docs/figures/hub-rest-api-documentation.png)
562+
![Hub REST API documentation](figures/hub-rest-api-documentation.png)
507563

508564
When you click on the row for `POST /dske/hub/api/v1/key-share` you see the detailed documentation
509565
for that particular REST endpoint:
510566

511-
![Hub POST key-share details documentation](docs/figures/hub-post-key-share-endpoint-details-documentation.png)
567+
![Hub POST key-share details documentation](figures/hub-post-key-share-endpoint-details-documentation.png)
512568

513569
### Invoking the REST interface
514570

0 commit comments

Comments
 (0)