plans for chain crawler and updated chain metrics

This commit is contained in:
thatben 2025-03-19 15:59:55 +01:00
parent fe9c29760c
commit 1e8621b639
No known key found for this signature in database
GPG Key ID: 62C543548433D43E
2 changed files with 17 additions and 0 deletions

View File

@ -0,0 +1,3 @@
# subscribe to newrequests
# iterate past requests on start-up
# push them into the request store

View File

@ -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.