feat(encoding,oracles,time-ordering): expand wire registry and singleton categories
- wire-registry: builtins, encodeBatch, snapshot, unregisterCodec - decentralized-oracle: listFeeds, feedStats, setQuorum - temporal-index: queryBucket, bucketsForRange - Add category README hubs for oracles and time-ordering - Add _shared/gossip-base.js envelope helpers Co-authored-by: Cursor <[email protected]>
This commit is contained in:
@@ -417,6 +417,30 @@ class HyperP2PDecentralizedOracle extends EventEmitter {
|
||||
return { ...this.metrics, activeFeeds: this.feeds.size, pendingReports: this.pendingReports.size }
|
||||
}
|
||||
|
||||
listFeeds () {
|
||||
return [...this.feeds.keys()]
|
||||
}
|
||||
|
||||
feedStats (feedId) {
|
||||
const feed = this.feeds.get(feedId)
|
||||
if (!feed) return null
|
||||
return {
|
||||
feedId,
|
||||
reports: feed.reports.size,
|
||||
aggregates: feed.aggregates.size,
|
||||
disputes: (feed.disputes && feed.disputes.size) || 0,
|
||||
quorum: feed.quorum
|
||||
}
|
||||
}
|
||||
|
||||
setQuorum (feedId, size) {
|
||||
if (!this.feeds.has(feedId)) {
|
||||
this.feeds.set(feedId, { reports: new Map(), aggregates: new Map(), disputes: new Map(), quorum: size })
|
||||
} else {
|
||||
this.feeds.get(feedId).quorum = size
|
||||
}
|
||||
return size
|
||||
}
|
||||
|
||||
getStats () {
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user