mirror of
https://github.com/pezkuwichain/pezkuwi-telemetry.git
synced 2026-05-31 00:01:06 +00:00
Working on map view
This commit is contained in:
@@ -3,6 +3,7 @@ import * as EventEmitter from 'events';
|
||||
import Node from './Node';
|
||||
import Chain from './Chain';
|
||||
import { VERSION, timestamp, Maybe, FeedMessage, Types, idGenerator } from '@dotstats/common';
|
||||
import { Location } from './location';
|
||||
|
||||
const nextId = idGenerator<Types.FeedId>();
|
||||
const { Actions } = FeedMessage;
|
||||
@@ -42,7 +43,7 @@ export default class Feed {
|
||||
public static addedNode(node: Node): FeedMessage.Message {
|
||||
return {
|
||||
action: Actions.AddedNode,
|
||||
payload: [node.id, node.nodeDetails(), node.nodeStats(), node.blockDetails()]
|
||||
payload: [node.id, node.nodeDetails(), node.nodeStats(), node.blockDetails(), node.nodeLocation()]
|
||||
};
|
||||
}
|
||||
|
||||
@@ -53,6 +54,13 @@ export default class Feed {
|
||||
};
|
||||
}
|
||||
|
||||
public static locatedNode(node: Node, location: Location): FeedMessage.Message {
|
||||
return {
|
||||
action: Actions.LocatedNode,
|
||||
payload: [node.id, location.lat, location.lon]
|
||||
};
|
||||
}
|
||||
|
||||
public static imported(node: Node): FeedMessage.Message {
|
||||
return {
|
||||
action: Actions.ImportedBlock,
|
||||
|
||||
Reference in New Issue
Block a user