mirror of
https://github.com/logos-storage/logos-storage-network-crawler.git
synced 2026-01-07 07:53:11 +00:00
plans for chain crawler and updated chain metrics
This commit is contained in:
parent
fe9c29760c
commit
1e8621b639
3
codexcrawler/components/chaincrawler.nim
Normal file
3
codexcrawler/components/chaincrawler.nim
Normal file
@ -0,0 +1,3 @@
|
||||
# subscribe to newrequests
|
||||
# iterate past requests on start-up
|
||||
# push them into the request store
|
||||
@ -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.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user