hive-p2p 1.0.43 → 1.0.45
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 +6 -6
- package/core/topologist.mjs +1 -1
- package/package.json +1 -1
- package/packages/full/index.mjs +8 -1
package/core/node.mjs
CHANGED
|
@@ -56,12 +56,12 @@ export async function createNode(options = {}) {
|
|
|
56
56
|
export class Node {
|
|
57
57
|
started = false;
|
|
58
58
|
id; cryptoCodex; verbose;
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
59
|
+
offerManager;
|
|
60
|
+
arbiter;
|
|
61
|
+
peerStore;
|
|
62
|
+
messager;
|
|
63
|
+
gossip;
|
|
64
|
+
topologist;
|
|
65
65
|
/** @type {NodeServices | undefined} */ services;
|
|
66
66
|
|
|
67
67
|
/** Initialize a new P2P node instance, use .start() to init topologist
|
package/core/topologist.mjs
CHANGED
|
@@ -19,7 +19,7 @@ const { SANDBOX, ICE_CANDIDATE_EMITTER, TEST_WS_EVENT_MANAGER } = SIMULATION.ENA
|
|
|
19
19
|
* @property {number} timestamp
|
|
20
20
|
* */
|
|
21
21
|
|
|
22
|
-
class OfferQueue {
|
|
22
|
+
export class OfferQueue {
|
|
23
23
|
maxOffers = 30;
|
|
24
24
|
/** @type {Array<OfferQueueItem>} */ offers = [];
|
|
25
25
|
/** @type {'overlap' | 'neighborsCount'} */ orderingBy = 'neighborsCount';
|
package/package.json
CHANGED
package/packages/full/index.mjs
CHANGED
|
@@ -5,6 +5,14 @@ import CONFIG from "../../core/config.mjs";
|
|
|
5
5
|
|
|
6
6
|
// FOR IDE COMPLETION
|
|
7
7
|
import { Arbiter } from "../../core/arbiter.mjs";
|
|
8
|
+
import { OfferManager } from "../../core/offer-manager.mjs";
|
|
9
|
+
import { PeerStore, KnownPeer, PeerConnection } from "../../core/peer-store.mjs";
|
|
10
|
+
import { UnicastMessager, DirectMessage, ReroutedDirectMessage } from "../../core/unicast.mjs";
|
|
11
|
+
import { Gossip, GossipMessage } from "../../core/gossip.mjs";
|
|
12
|
+
import { Topologist, OfferQueue } from "../../core/topologist.mjs";
|
|
13
|
+
import { NodeServices } from "../../core/node-services.mjs";
|
|
14
|
+
import { Converter } from "../../services/converter.mjs";
|
|
15
|
+
import { ed25519, Argon2Unified } from "../../services/cryptos.mjs";
|
|
8
16
|
|
|
9
17
|
async function runSimulation() {
|
|
10
18
|
const simulator = await import("../../simulation/simulator.mjs");
|
|
@@ -19,7 +27,6 @@ function mergeConfig(target, source) {
|
|
|
19
27
|
} else target[key] = source[key];
|
|
20
28
|
}
|
|
21
29
|
|
|
22
|
-
|
|
23
30
|
const HiveP2P = { CLOCK, CONFIG, mergeConfig, CryptoCodex, Node, createNode, createPublicNode, runSimulation };
|
|
24
31
|
export { CLOCK, CONFIG, mergeConfig, CryptoCodex, Node, createNode, createPublicNode, runSimulation };
|
|
25
32
|
export default HiveP2P;
|