@hive-p2p/server 1.0.37 → 1.0.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/core/node.mjs
CHANGED
|
@@ -55,12 +55,13 @@ export async function createNode(options = {}) {
|
|
|
55
55
|
|
|
56
56
|
export class Node {
|
|
57
57
|
started = false;
|
|
58
|
-
id; cryptoCodex; verbose;
|
|
59
|
-
/**
|
|
60
|
-
/**
|
|
61
|
-
/**
|
|
62
|
-
/**
|
|
63
|
-
/**
|
|
58
|
+
id; cryptoCodex; verbose;
|
|
59
|
+
/** @type {OfferManager} */ offerManager;
|
|
60
|
+
/** @type {Arbiter} */ arbiter;
|
|
61
|
+
/** @type {PeerStore} */ peerStore;
|
|
62
|
+
/** @type {UnicastMessager} */ messager;
|
|
63
|
+
/** @type {Gossip} */ gossip;
|
|
64
|
+
/** @type {Topologist} */ topologist;
|
|
64
65
|
/** @type {NodeServices | undefined} */ services;
|
|
65
66
|
|
|
66
67
|
/** Initialize a new P2P node instance, use .start() to init topologist
|
|
@@ -142,6 +143,7 @@ export class Node {
|
|
|
142
143
|
// PUBLIC API
|
|
143
144
|
/** @returns {string | undefined} */
|
|
144
145
|
get publicUrl() { return this.services?.publicUrl; }
|
|
146
|
+
get time() { return CLOCK.time; }
|
|
145
147
|
|
|
146
148
|
onMessageData(callback) { this.messager.on('message', callback); }
|
|
147
149
|
onGossipData(callback) { this.gossip.on('gossip', callback); }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { NetworkRendererElements, NetworkRendererOptions } from './renderer-options.mjs';
|
|
2
2
|
import { Node, NodesStore, ConnectionsStore } from './renderer-stores.mjs';
|
|
3
|
-
import {
|
|
3
|
+
import { DISCOVERY } from '../core/config.mjs';
|
|
4
4
|
|
|
5
5
|
export class NetworkRenderer {
|
|
6
6
|
initCameraZ = 1400;
|
package/rendering/visualizer.mjs
CHANGED
|
@@ -156,10 +156,10 @@ class NetworkVisualizer {
|
|
|
156
156
|
const previousIndex = (currentIndex - 1 + peerIds.length) % peerIds.length;
|
|
157
157
|
this.#setSelectedPeer(peerIds[previousIndex]);
|
|
158
158
|
}
|
|
159
|
-
#setCurrentPeer(id,
|
|
159
|
+
#setCurrentPeer(id, clearNetworkOnChange = true) {
|
|
160
160
|
this.currentPeerId = id;
|
|
161
161
|
this.simulationInterface.currentPeerId = id;
|
|
162
|
-
this.networkRenderer.setCurrentPeer(id,
|
|
162
|
+
this.networkRenderer.setCurrentPeer(id, clearNetworkOnChange);
|
|
163
163
|
}
|
|
164
164
|
#getSimulatorSettings() {
|
|
165
165
|
return {
|