Skip to content

Commit 1de6550

Browse files
committed
Refactor progress
1 parent 0cb0e9f commit 1de6550

2 files changed

Lines changed: 48 additions & 26 deletions

File tree

common/block.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ def take_data(self, start: int, size: int) -> bytes:
153153
raise PSRDDataAlreadyUsedError(self._block_uuid, start, size)
154154
self._used[start:end] = True
155155
data = self._data[start:end]
156-
# Zero out allocated bytes in block
156+
# Zero out taken bytes in block
157157
self._data = self._data[:start] + b"\x00" * size + self._data[end:]
158158
return data
159159

docs/getting-started-guide.md

Lines changed: 47 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -206,26 +206,26 @@ Status for client carol on port 8105
206206
"local_pool": {
207207
"blocks": [
208208
{
209-
"uuid": "7b5edbb0-e51d-49b6-9e87-99f684df6180",
210-
"size": 1000,
209+
"uuid": "a74c4d68-9c84-4d06-85a6-97e1519eb5b3",
210+
"size": 2000,
211211
"data": "AAAAAAAAAAAAAA==...",
212-
"allocated": 48,
213-
"consumed": 48
212+
"nr_used_bytes": 48,
213+
"nr_unused_bytes": 1952
214214
}
215215
],
216-
"owner": "Owner.LOCAL"
216+
"owner": "local"
217217
},
218218
"peer_pool": {
219219
"blocks": [
220220
{
221-
"uuid": "b9654256-403b-470f-abab-c47901a5bb82",
222-
"size": 1000,
221+
"uuid": "35571355-223a-47ac-a5b1-0d341951e78e",
222+
"size": 2000,
223223
"data": "AAAAAAAAAAAAAA==...",
224-
"allocated": 32,
225-
"consumed": 32
224+
"nr_used_bytes": 32,
225+
"nr_unused_bytes": 1968
226226
}
227227
],
228-
"owner": "Owner.PEER"
228+
"owner": "peer"
229229
}
230230
},
231231
...
@@ -260,24 +260,46 @@ Your output may look different.
260260

261261
```
262262
$ cat client-carol.out
263-
INFO: Started server process [63929]
263+
INFO: Started server process [2353]
264264
INFO: Waiting for application startup.
265+
INFO: Begin register task for peer hub None
266+
INFO: Begin register task for peer hub None
267+
INFO: Begin register task for peer hub None
268+
INFO: Begin register task for peer hub None
269+
INFO: Begin register task for peer hub None
265270
INFO: Application startup complete.
266271
INFO: Uvicorn running on http://127.0.0.1:8105 (Press CTRL+C to quit)
267-
INFO: 127.0.0.1:54108 - "POST /client/carol/mgmt/v1/stop HTTP/1.1" 200 OK
272+
INFO: Call PUT http://127.0.0.1:8100/hub/hank/dske/oob/v1/registration 200
273+
INFO: Call PUT http://127.0.0.1:8101/hub/helen/dske/oob/v1/registration 200
274+
INFO: Call PUT http://127.0.0.1:8103/hub/holly/dske/oob/v1/registration 200
275+
INFO: Finish register task for peer hub None
276+
INFO: Finish register task for peer hub None
277+
INFO: Finish register task for peer hub None
278+
INFO: Call PUT http://127.0.0.1:8102/hub/hilary/dske/oob/v1/registration 200
279+
INFO: Call PUT http://127.0.0.1:8104/hub/hugo/dske/oob/v1/registration 200
280+
INFO: Begin request PSRD task for peer hub hank and pool owner local
281+
INFO: Begin request PSRD task for peer hub hank and pool owner peer
282+
INFO: Begin request PSRD task for peer hub helen and pool owner local
283+
INFO: Begin request PSRD task for peer hub helen and pool owner peer
284+
INFO: Begin request PSRD task for peer hub holly and pool owner local
285+
INFO: Begin request PSRD task for peer hub holly and pool owner peer
286+
INFO: Finish register task for peer hub None
287+
INFO: Finish register task for peer hub None
288+
INFO: Begin request PSRD task for peer hub hilary and pool owner local
289+
INFO: Begin request PSRD task for peer hub hilary and pool owner peer
290+
INFO: Begin request PSRD task for peer hub hugo and pool owner local
291+
INFO: Begin request PSRD task for peer hub hugo and pool owner peer
292+
INFO: Call GET http://127.0.0.1:8100/hub/hank/dske/oob/v1/psrd?client_name=carol&pool_owner=client&size=2000 200
293+
INFO: Finish request PSRD task for peer hub hank and pool owner local
294+
INFO: Call GET http://127.0.0.1:8100/hub/hank/dske/oob/v1/psrd?client_name=carol&pool_owner=hub&size=2000 200
295+
INFO: Finish request PSRD task for peer hub hank and pool owner peer
296+
...
297+
INFO: Call POST http://127.0.0.1:8103/hub/holly/dske/api/v1/key-share 200
298+
INFO: Call POST http://127.0.0.1:8104/hub/hugo/dske/api/v1/key-share 200
299+
INFO: Successfully scattered 5 out of 5 shares for key ID 47487f0d-f164-4ba6-9113-1dfe079f70ac
300+
INFO: 127.0.0.1:49915 - "GET /client/carol/etsi/api/v1/keys/connie/enc_keys HTTP/1.1" 200 OK
301+
INFO: 127.0.0.1:49926 - "POST /client/carol/mgmt/v1/stop HTTP/1.1" 200 OK
268302
INFO: Shutting down
269303
INFO: Waiting for application shutdown.
270304
INFO: Application shutdown complete.
271-
INFO: Finished server process [63929]
272-
INFO: Started server process [73470]
273-
INFO: Waiting for application startup.
274-
INFO: Application startup complete.
275-
INFO: Uvicorn running on http://127.0.0.1:8105 (Press CTRL+C to quit)
276-
INFO: 127.0.0.1:54466 - "GET /client/carol/etsi/api/v1/keys/connie/enc_keys HTTP/1.1" 200 OK
277-
INFO: 127.0.0.1:54611 - "GET /client/carol/mgmt/v1/status HTTP/1.1" 200 OK
278-
INFO: 127.0.0.1:54625 - "POST /client/carol/mgmt/v1/stop HTTP/1.1" 200 OK
279-
INFO: Shutting down
280-
INFO: Waiting for application shutdown.
281-
INFO: Application shutdown complete.
282-
INFO: Finished server process [73470]
283-
```
305+
INFO: Finished server process [2353]```

0 commit comments

Comments
 (0)