mirror of
https://github.com/pezkuwichain/pezkuwi-telemetry.git
synced 2026-06-12 07:41:09 +00:00
Pass through node details
This commit is contained in:
@@ -4,17 +4,17 @@ import { Id } from './id';
|
||||
export type FeedId = Id<'Feed'>;
|
||||
export type NodeId = Id<'Node'>;
|
||||
export type NodeName = Opaque<string, 'NodeName'>;
|
||||
export type NodeImplementation = Opaque<string, 'NodeImplementation'>;
|
||||
export type NodeVersion = Opaque<string, 'NodeVersion'>;
|
||||
export type BlockNumber = Opaque<number, 'BlockNumber'>;
|
||||
export type BlockHash = Opaque<string, 'BlockHash'>;
|
||||
export type Milliseconds = Opaque<number, 'Milliseconds'>;
|
||||
export type PeerCount = Opaque<number, 'PeerCount'>;
|
||||
export type TransactionCount = Opaque<number, 'TransactionCount'>;
|
||||
|
||||
export interface BlockDetails {
|
||||
height: BlockNumber;
|
||||
blockTime: Milliseconds;
|
||||
}
|
||||
|
||||
export interface NodeDetails {
|
||||
name: NodeName;
|
||||
}
|
||||
export type BlockDetails = [BlockNumber, Milliseconds];
|
||||
export type NodeDetails = [NodeName, NodeImplementation, NodeVersion];
|
||||
export type NodeStats = [PeerCount, TransactionCount];
|
||||
|
||||
interface BestBlock {
|
||||
action: 'best';
|
||||
@@ -23,7 +23,7 @@ interface BestBlock {
|
||||
|
||||
interface AddedNode {
|
||||
action: 'added';
|
||||
payload: [NodeId, NodeDetails, BlockDetails];
|
||||
payload: [NodeId, NodeDetails, NodeStats, BlockDetails];
|
||||
}
|
||||
|
||||
interface RemovedNode {
|
||||
@@ -36,4 +36,9 @@ interface Imported {
|
||||
payload: [NodeId, BlockDetails];
|
||||
}
|
||||
|
||||
export type FeedMessage = BestBlock | AddedNode | RemovedNode | Imported;
|
||||
interface Stats {
|
||||
action: 'stats';
|
||||
payload: [NodeId, NodeStats];
|
||||
}
|
||||
|
||||
export type FeedMessage = BestBlock | AddedNode | RemovedNode | Imported | Stats;
|
||||
|
||||
Reference in New Issue
Block a user