@xyo-network/p2p
Advanced tools
Comparing version 0.24.0 to 0.31.0
@@ -0,1 +1,2 @@ | ||
/// <reference types="node" /> | ||
import { Server } from "net"; | ||
@@ -2,0 +3,0 @@ import { unsubscribeFn } from '@xyo-network/utils'; |
@@ -0,1 +1,2 @@ | ||
/// <reference types="node" /> | ||
import { IXyoP2PService, IXyoPeerDiscoveryService } from './@types'; | ||
@@ -2,0 +3,0 @@ import { XyoBase } from '@xyo-network/base'; |
@@ -31,3 +31,2 @@ "use strict"; | ||
publish(topic, message) { | ||
this.logInfo(`Publishing message with topic ${topic}`); | ||
this.discoveryService.getListOfKnownPublicKeys().forEach(publicKey => this.publishMessageToPeer(topic, message, publicKey)); | ||
@@ -34,0 +33,0 @@ return Promise.resolve(); |
/// <reference path="../src/@types/multiaddr.d.ts" /> | ||
/// <reference types="node" /> | ||
import { IXyoPeerConnection } from './@types'; | ||
@@ -3,0 +4,0 @@ import { Callback } from '@xyo-network/utils'; |
@@ -82,3 +82,2 @@ "use strict"; | ||
return __awaiter(this, void 0, void 0, function* () { | ||
this.logInfo(`Starting discovery`); | ||
if (this.running) | ||
@@ -115,3 +114,2 @@ return this.starting; | ||
dialBootstrapNodes() { | ||
this.logInfo(`Dialing bootstrap nodes`); | ||
this.bootstrapAddresses.forEach((address) => { | ||
@@ -118,0 +116,0 @@ this.transport.dial(address).then((connection) => { |
/// <reference path="../src/@types/multiaddr.d.ts" /> | ||
/// <reference types="node" /> | ||
import { IXyoPeerTransport, IXyoPeerConnection } from './@types'; | ||
@@ -3,0 +4,0 @@ import net from 'net'; |
@@ -29,3 +29,3 @@ "use strict"; | ||
}); | ||
this.server.listen(this.port, this.host, () => { | ||
this.server.listen(this.port, '0.0.0.0', () => { | ||
resolve(this.server); | ||
@@ -32,0 +32,0 @@ }); |
@@ -0,1 +1,2 @@ | ||
/// <reference types="node" /> | ||
interface IXyoTopic { | ||
@@ -2,0 +3,0 @@ topic: string; |
{ | ||
"name": "@xyo-network/p2p", | ||
"version": "0.24.0", | ||
"version": "0.31.0", | ||
"description": "A peer to peer network module", | ||
@@ -10,4 +10,4 @@ "main": "dist/index.js", | ||
"dependencies": { | ||
"@xyo-network/base": "^0.24.0", | ||
"@xyo-network/utils": "^0.24.0", | ||
"@xyo-network/base": "^0.31.0", | ||
"@xyo-network/utils": "^0.31.0", | ||
"multiaddr": "^6.0.3" | ||
@@ -24,3 +24,3 @@ }, | ||
}, | ||
"gitHead": "629618ae9a38cc374b662561d1786827b618c2fd" | ||
"gitHead": "19f9752b9915e96430496a0adf86e5dc79c08ded" | ||
} |
@@ -40,3 +40,2 @@ import { IXyoP2PService, IXyoPeerDiscoveryService } from './@types' | ||
public publish(topic: string, message: Buffer) { | ||
this.logInfo(`Publishing message with topic ${topic}`) | ||
this.discoveryService.getListOfKnownPublicKeys().forEach(publicKey => | ||
@@ -43,0 +42,0 @@ this.publishMessageToPeer(topic, message, publicKey)) |
@@ -79,3 +79,2 @@ import { IXyoPeerTransport, IXyoPeerConnection, IXyoPeerDiscoveryService, IXyoPeerDiscoveryConfig } from "./@types" | ||
public async start() { | ||
this.logInfo(`Starting discovery`) | ||
if (this.running) return this.starting | ||
@@ -121,3 +120,2 @@ | ||
private dialBootstrapNodes () { | ||
this.logInfo(`Dialing bootstrap nodes`) | ||
this.bootstrapAddresses.forEach((address) => { | ||
@@ -124,0 +122,0 @@ this.transport.dial(address).then((connection) => { |
@@ -31,3 +31,3 @@ // tslint:disable-next-line:no-reference | ||
this.server.listen(this.port, this.host, () => { | ||
this.server.listen(this.port, '0.0.0.0', () => { | ||
resolve(this.server) | ||
@@ -34,0 +34,0 @@ }) |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
87829
1678
+ Added@xyo-network/base@0.31.0(transitive)
+ Added@xyo-network/errors@0.31.0(transitive)
+ Added@xyo-network/meta-list@0.31.0(transitive)
+ Added@xyo-network/utils@0.31.0(transitive)
+ Addedbn.js@4.12.1(transitive)
- Removed@xyo-network/base@0.24.0(transitive)
- Removed@xyo-network/errors@0.24.0(transitive)
- Removed@xyo-network/meta-list@0.24.0(transitive)
- Removed@xyo-network/utils@0.24.0(transitive)
Updated@xyo-network/base@^0.31.0
Updated@xyo-network/utils@^0.31.0