From 1e8621b639e40e051b95486093ebf7a74dd063f7 Mon Sep 17 00:00:00 2001 From: thatben Date: Wed, 19 Mar 2025 15:59:55 +0100 Subject: [PATCH] plans for chain crawler and updated chain metrics --- codexcrawler/components/chaincrawler.nim | 3 +++ codexcrawler/components/chainmetrics.nim | 14 ++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 codexcrawler/components/chaincrawler.nim diff --git a/codexcrawler/components/chaincrawler.nim b/codexcrawler/components/chaincrawler.nim new file mode 100644 index 0000000..1eefa26 --- /dev/null +++ b/codexcrawler/components/chaincrawler.nim @@ -0,0 +1,3 @@ +# subscribe to newrequests +# iterate past requests on start-up +# push them into the request store diff --git a/codexcrawler/components/chainmetrics.nim b/codexcrawler/components/chainmetrics.nim index 6b053c9..44f8604 100644 --- a/codexcrawler/components/chainmetrics.nim +++ b/codexcrawler/components/chainmetrics.nim @@ -17,6 +17,20 @@ type ChainMetrics* = ref object of Component marketplace: MarketplaceService proc step(c: ChainMetrics): Future[?!void] {.async: (raises: []).} = + # replace slotFills entirely: + # iterate all requests in requestStore: + # get state of request on chain + # if failed/canceled/error: + # if last-seen is old (1month?3months?) + # delete entry + # else (request is running): + # count: + # total running + # total num slots + # total size of request + # iter finished: update metrics! + + without slotFills =? (await c.marketplace.getRecentSlotFillEvents()), err: trace "Unable to get recent slotFill events from chain", err = err.msg return success() # We don't propagate this error.