From afdb5be2d4b58630ecbda343e9803049a9f539a8 Mon Sep 17 00:00:00 2001 From: Mark Spanbroek Date: Mon, 18 Jul 2022 10:57:24 +0200 Subject: [PATCH] Add TODOs to indicate wanted architecture As discussed in team: - Retrieving of blocks that are mentioned in the manifest should be moved into a BlockStore. - Sales should be given an instance of BlockStore, and an instance of StorageProofs, instead of the onStore, onClear, and onProve callbacks --- codex/node.nim | 2 ++ 1 file changed, 2 insertions(+) diff --git a/codex/node.nim b/codex/node.nim index bc23fe7f..b234e07e 100644 --- a/codex/node.nim +++ b/codex/node.nim @@ -60,6 +60,7 @@ proc connect*( addrs: seq[MultiAddress]): Future[void] = node.switch.connect(peerId, addrs) +# TODO: move code that retrieves blocks in manifest into blockstore proc retrieve*( node: CodexNodeRef, cid: Cid): Future[?!LPStream] {.async.} = @@ -312,6 +313,7 @@ proc start*(node: CodexNodeRef) {.async.} = await node.discovery.start() if contracts =? node.contracts: + # TODO: remove Sales callbacks, pass BlockStore and StorageProofs instead contracts.sales.onStore = proc(cid: string, _: Availability) {.async.} = # store data in local storage (await node.store(Cid.init(cid).tryGet())).tryGet()