libp2p 0.35.7 → 0.35.8-bf1fc32
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/dist/index.min.js +55 -0
- package/dist/src/circuit/auto-relay.d.ts +8 -10
- package/dist/src/circuit/auto-relay.d.ts.map +1 -1
- package/dist/src/connection-manager/auto-dialler.d.ts +1 -1
- package/dist/src/connection-manager/auto-dialler.d.ts.map +1 -1
- package/dist/src/connection-manager/index.d.ts +1 -2
- package/dist/src/connection-manager/index.d.ts.map +1 -1
- package/dist/src/content-routing/utils.d.ts +3 -3
- package/dist/src/content-routing/utils.d.ts.map +1 -1
- package/dist/src/dht/dht-peer-routing.d.ts.map +1 -1
- package/dist/src/dialer/dial-request.d.ts.map +1 -1
- package/dist/src/dialer/index.d.ts +5 -5
- package/dist/src/dialer/index.d.ts.map +1 -1
- package/dist/src/identify/index.d.ts +4 -4
- package/dist/src/identify/index.d.ts.map +1 -1
- package/dist/src/index.d.ts +6 -6
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/metrics/index.d.ts +9 -4
- package/dist/src/metrics/index.d.ts.map +1 -1
- package/dist/src/metrics/tracked-map.d.ts +6 -1
- package/dist/src/metrics/tracked-map.d.ts.map +1 -1
- package/dist/src/peer-routing.d.ts +1 -1
- package/dist/src/peer-routing.d.ts.map +1 -1
- package/dist/src/peer-store/address-book.d.ts +28 -84
- package/dist/src/peer-store/address-book.d.ts.map +1 -1
- package/dist/src/peer-store/index.d.ts +25 -94
- package/dist/src/peer-store/index.d.ts.map +1 -1
- package/dist/src/peer-store/key-book.d.ts +31 -15
- package/dist/src/peer-store/key-book.d.ts.map +1 -1
- package/dist/src/peer-store/metadata-book.d.ts +33 -29
- package/dist/src/peer-store/metadata-book.d.ts.map +1 -1
- package/dist/src/peer-store/pb/peer.d.ts +222 -0
- package/dist/src/peer-store/proto-book.d.ts +27 -28
- package/dist/src/peer-store/proto-book.d.ts.map +1 -1
- package/dist/src/peer-store/store.d.ts +73 -0
- package/dist/src/peer-store/store.d.ts.map +1 -0
- package/dist/src/peer-store/types.d.ts +202 -0
- package/dist/src/peer-store/types.d.ts.map +1 -0
- package/dist/src/ping/index.d.ts.map +1 -1
- package/dist/src/record/peer-record/index.d.ts +2 -2
- package/dist/src/record/peer-record/index.d.ts.map +1 -1
- package/dist/src/registrar.d.ts +5 -5
- package/dist/src/registrar.d.ts.map +1 -1
- package/dist/src/upgrader.d.ts.map +1 -1
- package/package.json +18 -25
- package/src/circuit/auto-relay.js +19 -19
- package/src/connection-manager/auto-dialler.js +9 -4
- package/src/connection-manager/index.js +39 -22
- package/src/content-routing/utils.js +4 -4
- package/src/dht/dht-peer-routing.js +2 -6
- package/src/dialer/dial-request.js +4 -1
- package/src/dialer/index.js +22 -10
- package/src/identify/index.js +28 -23
- package/src/index.js +33 -27
- package/src/metrics/index.js +15 -8
- package/src/metrics/tracked-map.js +45 -13
- package/src/peer-routing.js +4 -1
- package/src/peer-store/address-book.js +242 -227
- package/src/peer-store/index.js +77 -110
- package/src/peer-store/key-book.js +99 -54
- package/src/peer-store/metadata-book.js +171 -101
- package/src/peer-store/pb/peer.d.ts +222 -0
- package/src/peer-store/pb/peer.js +643 -0
- package/src/peer-store/pb/peer.proto +31 -0
- package/src/peer-store/proto-book.js +171 -105
- package/src/peer-store/store.js +250 -0
- package/src/peer-store/types.ts +245 -0
- package/src/ping/index.js +6 -0
- package/src/record/peer-record/index.js +1 -1
- package/src/record/utils.js +1 -1
- package/src/registrar.js +4 -4
- package/src/upgrader.js +3 -1
- package/dist/src/peer-store/book.d.ts +0 -81
- package/dist/src/peer-store/book.d.ts.map +0 -1
- package/dist/src/peer-store/persistent/consts.d.ts +0 -6
- package/dist/src/peer-store/persistent/consts.d.ts.map +0 -1
- package/dist/src/peer-store/persistent/index.d.ts +0 -129
- package/dist/src/peer-store/persistent/index.d.ts.map +0 -1
- package/dist/src/peer-store/persistent/pb/address-book.d.ts +0 -198
- package/dist/src/peer-store/persistent/pb/proto-book.d.ts +0 -59
- package/src/peer-store/book.js +0 -124
- package/src/peer-store/persistent/consts.js +0 -15
- package/src/peer-store/persistent/index.js +0 -408
- package/src/peer-store/persistent/pb/address-book.d.ts +0 -198
- package/src/peer-store/persistent/pb/address-book.js +0 -522
- package/src/peer-store/persistent/pb/address-book.proto +0 -27
- package/src/peer-store/persistent/pb/proto-book.d.ts +0 -59
- package/src/peer-store/persistent/pb/proto-book.js +0 -157
- package/src/peer-store/persistent/pb/proto-book.proto +0 -5
|
@@ -1,198 +0,0 @@
|
|
|
1
|
-
import * as $protobuf from "protobufjs";
|
|
2
|
-
/** Properties of an Addresses. */
|
|
3
|
-
export interface IAddresses {
|
|
4
|
-
|
|
5
|
-
/** Addresses addrs */
|
|
6
|
-
addrs?: (Addresses.IAddress[]|null);
|
|
7
|
-
|
|
8
|
-
/** Addresses certifiedRecord */
|
|
9
|
-
certifiedRecord?: (Addresses.ICertifiedRecord|null);
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
/** Represents an Addresses. */
|
|
13
|
-
export class Addresses implements IAddresses {
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Constructs a new Addresses.
|
|
17
|
-
* @param [p] Properties to set
|
|
18
|
-
*/
|
|
19
|
-
constructor(p?: IAddresses);
|
|
20
|
-
|
|
21
|
-
/** Addresses addrs. */
|
|
22
|
-
public addrs: Addresses.IAddress[];
|
|
23
|
-
|
|
24
|
-
/** Addresses certifiedRecord. */
|
|
25
|
-
public certifiedRecord?: (Addresses.ICertifiedRecord|null);
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Encodes the specified Addresses message. Does not implicitly {@link Addresses.verify|verify} messages.
|
|
29
|
-
* @param m Addresses message or plain object to encode
|
|
30
|
-
* @param [w] Writer to encode to
|
|
31
|
-
* @returns Writer
|
|
32
|
-
*/
|
|
33
|
-
public static encode(m: IAddresses, w?: $protobuf.Writer): $protobuf.Writer;
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* Decodes an Addresses message from the specified reader or buffer.
|
|
37
|
-
* @param r Reader or buffer to decode from
|
|
38
|
-
* @param [l] Message length if known beforehand
|
|
39
|
-
* @returns Addresses
|
|
40
|
-
* @throws {Error} If the payload is not a reader or valid buffer
|
|
41
|
-
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
42
|
-
*/
|
|
43
|
-
public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): Addresses;
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* Creates an Addresses message from a plain object. Also converts values to their respective internal types.
|
|
47
|
-
* @param d Plain object
|
|
48
|
-
* @returns Addresses
|
|
49
|
-
*/
|
|
50
|
-
public static fromObject(d: { [k: string]: any }): Addresses;
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* Creates a plain object from an Addresses message. Also converts values to other types if specified.
|
|
54
|
-
* @param m Addresses
|
|
55
|
-
* @param [o] Conversion options
|
|
56
|
-
* @returns Plain object
|
|
57
|
-
*/
|
|
58
|
-
public static toObject(m: Addresses, o?: $protobuf.IConversionOptions): { [k: string]: any };
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* Converts this Addresses to JSON.
|
|
62
|
-
* @returns JSON object
|
|
63
|
-
*/
|
|
64
|
-
public toJSON(): { [k: string]: any };
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
export namespace Addresses {
|
|
68
|
-
|
|
69
|
-
/** Properties of an Address. */
|
|
70
|
-
interface IAddress {
|
|
71
|
-
|
|
72
|
-
/** Address multiaddr */
|
|
73
|
-
multiaddr?: (Uint8Array|null);
|
|
74
|
-
|
|
75
|
-
/** Address isCertified */
|
|
76
|
-
isCertified?: (boolean|null);
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
/** Represents an Address. */
|
|
80
|
-
class Address implements IAddress {
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
* Constructs a new Address.
|
|
84
|
-
* @param [p] Properties to set
|
|
85
|
-
*/
|
|
86
|
-
constructor(p?: Addresses.IAddress);
|
|
87
|
-
|
|
88
|
-
/** Address multiaddr. */
|
|
89
|
-
public multiaddr: Uint8Array;
|
|
90
|
-
|
|
91
|
-
/** Address isCertified. */
|
|
92
|
-
public isCertified: boolean;
|
|
93
|
-
|
|
94
|
-
/**
|
|
95
|
-
* Encodes the specified Address message. Does not implicitly {@link Addresses.Address.verify|verify} messages.
|
|
96
|
-
* @param m Address message or plain object to encode
|
|
97
|
-
* @param [w] Writer to encode to
|
|
98
|
-
* @returns Writer
|
|
99
|
-
*/
|
|
100
|
-
public static encode(m: Addresses.IAddress, w?: $protobuf.Writer): $protobuf.Writer;
|
|
101
|
-
|
|
102
|
-
/**
|
|
103
|
-
* Decodes an Address message from the specified reader or buffer.
|
|
104
|
-
* @param r Reader or buffer to decode from
|
|
105
|
-
* @param [l] Message length if known beforehand
|
|
106
|
-
* @returns Address
|
|
107
|
-
* @throws {Error} If the payload is not a reader or valid buffer
|
|
108
|
-
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
109
|
-
*/
|
|
110
|
-
public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): Addresses.Address;
|
|
111
|
-
|
|
112
|
-
/**
|
|
113
|
-
* Creates an Address message from a plain object. Also converts values to their respective internal types.
|
|
114
|
-
* @param d Plain object
|
|
115
|
-
* @returns Address
|
|
116
|
-
*/
|
|
117
|
-
public static fromObject(d: { [k: string]: any }): Addresses.Address;
|
|
118
|
-
|
|
119
|
-
/**
|
|
120
|
-
* Creates a plain object from an Address message. Also converts values to other types if specified.
|
|
121
|
-
* @param m Address
|
|
122
|
-
* @param [o] Conversion options
|
|
123
|
-
* @returns Plain object
|
|
124
|
-
*/
|
|
125
|
-
public static toObject(m: Addresses.Address, o?: $protobuf.IConversionOptions): { [k: string]: any };
|
|
126
|
-
|
|
127
|
-
/**
|
|
128
|
-
* Converts this Address to JSON.
|
|
129
|
-
* @returns JSON object
|
|
130
|
-
*/
|
|
131
|
-
public toJSON(): { [k: string]: any };
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
/** Properties of a CertifiedRecord. */
|
|
135
|
-
interface ICertifiedRecord {
|
|
136
|
-
|
|
137
|
-
/** CertifiedRecord seq */
|
|
138
|
-
seq?: (number|null);
|
|
139
|
-
|
|
140
|
-
/** CertifiedRecord raw */
|
|
141
|
-
raw?: (Uint8Array|null);
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
/** Represents a CertifiedRecord. */
|
|
145
|
-
class CertifiedRecord implements ICertifiedRecord {
|
|
146
|
-
|
|
147
|
-
/**
|
|
148
|
-
* Constructs a new CertifiedRecord.
|
|
149
|
-
* @param [p] Properties to set
|
|
150
|
-
*/
|
|
151
|
-
constructor(p?: Addresses.ICertifiedRecord);
|
|
152
|
-
|
|
153
|
-
/** CertifiedRecord seq. */
|
|
154
|
-
public seq: number;
|
|
155
|
-
|
|
156
|
-
/** CertifiedRecord raw. */
|
|
157
|
-
public raw: Uint8Array;
|
|
158
|
-
|
|
159
|
-
/**
|
|
160
|
-
* Encodes the specified CertifiedRecord message. Does not implicitly {@link Addresses.CertifiedRecord.verify|verify} messages.
|
|
161
|
-
* @param m CertifiedRecord message or plain object to encode
|
|
162
|
-
* @param [w] Writer to encode to
|
|
163
|
-
* @returns Writer
|
|
164
|
-
*/
|
|
165
|
-
public static encode(m: Addresses.ICertifiedRecord, w?: $protobuf.Writer): $protobuf.Writer;
|
|
166
|
-
|
|
167
|
-
/**
|
|
168
|
-
* Decodes a CertifiedRecord message from the specified reader or buffer.
|
|
169
|
-
* @param r Reader or buffer to decode from
|
|
170
|
-
* @param [l] Message length if known beforehand
|
|
171
|
-
* @returns CertifiedRecord
|
|
172
|
-
* @throws {Error} If the payload is not a reader or valid buffer
|
|
173
|
-
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
174
|
-
*/
|
|
175
|
-
public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): Addresses.CertifiedRecord;
|
|
176
|
-
|
|
177
|
-
/**
|
|
178
|
-
* Creates a CertifiedRecord message from a plain object. Also converts values to their respective internal types.
|
|
179
|
-
* @param d Plain object
|
|
180
|
-
* @returns CertifiedRecord
|
|
181
|
-
*/
|
|
182
|
-
public static fromObject(d: { [k: string]: any }): Addresses.CertifiedRecord;
|
|
183
|
-
|
|
184
|
-
/**
|
|
185
|
-
* Creates a plain object from a CertifiedRecord message. Also converts values to other types if specified.
|
|
186
|
-
* @param m CertifiedRecord
|
|
187
|
-
* @param [o] Conversion options
|
|
188
|
-
* @returns Plain object
|
|
189
|
-
*/
|
|
190
|
-
public static toObject(m: Addresses.CertifiedRecord, o?: $protobuf.IConversionOptions): { [k: string]: any };
|
|
191
|
-
|
|
192
|
-
/**
|
|
193
|
-
* Converts this CertifiedRecord to JSON.
|
|
194
|
-
* @returns JSON object
|
|
195
|
-
*/
|
|
196
|
-
public toJSON(): { [k: string]: any };
|
|
197
|
-
}
|
|
198
|
-
}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import * as $protobuf from "protobufjs";
|
|
2
|
-
/** Properties of a Protocols. */
|
|
3
|
-
export interface IProtocols {
|
|
4
|
-
|
|
5
|
-
/** Protocols protocols */
|
|
6
|
-
protocols?: (string[]|null);
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
/** Represents a Protocols. */
|
|
10
|
-
export class Protocols implements IProtocols {
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Constructs a new Protocols.
|
|
14
|
-
* @param [p] Properties to set
|
|
15
|
-
*/
|
|
16
|
-
constructor(p?: IProtocols);
|
|
17
|
-
|
|
18
|
-
/** Protocols protocols. */
|
|
19
|
-
public protocols: string[];
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Encodes the specified Protocols message. Does not implicitly {@link Protocols.verify|verify} messages.
|
|
23
|
-
* @param m Protocols message or plain object to encode
|
|
24
|
-
* @param [w] Writer to encode to
|
|
25
|
-
* @returns Writer
|
|
26
|
-
*/
|
|
27
|
-
public static encode(m: IProtocols, w?: $protobuf.Writer): $protobuf.Writer;
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Decodes a Protocols message from the specified reader or buffer.
|
|
31
|
-
* @param r Reader or buffer to decode from
|
|
32
|
-
* @param [l] Message length if known beforehand
|
|
33
|
-
* @returns Protocols
|
|
34
|
-
* @throws {Error} If the payload is not a reader or valid buffer
|
|
35
|
-
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
36
|
-
*/
|
|
37
|
-
public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): Protocols;
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* Creates a Protocols message from a plain object. Also converts values to their respective internal types.
|
|
41
|
-
* @param d Plain object
|
|
42
|
-
* @returns Protocols
|
|
43
|
-
*/
|
|
44
|
-
public static fromObject(d: { [k: string]: any }): Protocols;
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* Creates a plain object from a Protocols message. Also converts values to other types if specified.
|
|
48
|
-
* @param m Protocols
|
|
49
|
-
* @param [o] Conversion options
|
|
50
|
-
* @returns Plain object
|
|
51
|
-
*/
|
|
52
|
-
public static toObject(m: Protocols, o?: $protobuf.IConversionOptions): { [k: string]: any };
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* Converts this Protocols to JSON.
|
|
56
|
-
* @returns JSON object
|
|
57
|
-
*/
|
|
58
|
-
public toJSON(): { [k: string]: any };
|
|
59
|
-
}
|
package/src/peer-store/book.js
DELETED
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
const errcode = require('err-code')
|
|
4
|
-
const PeerId = require('peer-id')
|
|
5
|
-
const { codes } = require('../errors')
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* @param {any} data
|
|
9
|
-
*/
|
|
10
|
-
const passthrough = data => data
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* @typedef {import('./')} PeerStore
|
|
14
|
-
*/
|
|
15
|
-
|
|
16
|
-
class Book {
|
|
17
|
-
/**
|
|
18
|
-
* The Book is the skeleton for the PeerStore books.
|
|
19
|
-
*
|
|
20
|
-
* @class
|
|
21
|
-
* @param {Object} properties
|
|
22
|
-
* @param {PeerStore} properties.peerStore - PeerStore instance.
|
|
23
|
-
* @param {string} properties.eventName - Name of the event to emit by the PeerStore.
|
|
24
|
-
* @param {string} properties.eventProperty - Name of the property to emit by the PeerStore.
|
|
25
|
-
* @param {(data: any) => any[]} [properties.eventTransformer] - Transformer function of the provided data for being emitted.
|
|
26
|
-
*/
|
|
27
|
-
constructor ({ peerStore, eventName, eventProperty, eventTransformer = passthrough }) {
|
|
28
|
-
this._ps = peerStore
|
|
29
|
-
this.eventName = eventName
|
|
30
|
-
this.eventProperty = eventProperty
|
|
31
|
-
this.eventTransformer = eventTransformer
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* Map known peers to their data.
|
|
35
|
-
*
|
|
36
|
-
* @type {Map<string, any[]|any>}
|
|
37
|
-
*/
|
|
38
|
-
this.data = new Map()
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* Set known data of a provided peer.
|
|
43
|
-
*
|
|
44
|
-
* @param {PeerId} peerId
|
|
45
|
-
* @param {any[]|any} data
|
|
46
|
-
*/
|
|
47
|
-
set (peerId, data) {
|
|
48
|
-
throw errcode(new Error('set must be implemented by the subclass'), codes.ERR_NOT_IMPLEMENTED)
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* Set data into the datastructure, persistence and emit it using the provided transformers.
|
|
53
|
-
*
|
|
54
|
-
* @protected
|
|
55
|
-
* @param {PeerId} peerId - peerId of the data to store
|
|
56
|
-
* @param {any} data - data to store.
|
|
57
|
-
* @param {Object} [options] - storing options.
|
|
58
|
-
* @param {boolean} [options.emit = true] - emit the provided data.
|
|
59
|
-
* @returns {void}
|
|
60
|
-
*/
|
|
61
|
-
_setData (peerId, data, { emit = true } = {}) {
|
|
62
|
-
const b58key = peerId.toB58String()
|
|
63
|
-
|
|
64
|
-
// Store data in memory
|
|
65
|
-
this.data.set(b58key, data)
|
|
66
|
-
|
|
67
|
-
// Emit event
|
|
68
|
-
emit && this._emit(peerId, data)
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
* Emit data.
|
|
73
|
-
*
|
|
74
|
-
* @protected
|
|
75
|
-
* @param {PeerId} peerId
|
|
76
|
-
* @param {any} [data]
|
|
77
|
-
*/
|
|
78
|
-
_emit (peerId, data) {
|
|
79
|
-
this._ps.emit(this.eventName, {
|
|
80
|
-
peerId,
|
|
81
|
-
[this.eventProperty]: this.eventTransformer(data)
|
|
82
|
-
})
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
/**
|
|
86
|
-
* Get the known data of a provided peer.
|
|
87
|
-
* Returns `undefined` if there is no available data for the given peer.
|
|
88
|
-
*
|
|
89
|
-
* @param {PeerId} peerId
|
|
90
|
-
* @returns {any[]|any|undefined}
|
|
91
|
-
*/
|
|
92
|
-
get (peerId) {
|
|
93
|
-
if (!PeerId.isPeerId(peerId)) {
|
|
94
|
-
throw errcode(new Error('peerId must be an instance of peer-id'), codes.ERR_INVALID_PARAMETERS)
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
const rec = this.data.get(peerId.toB58String())
|
|
98
|
-
|
|
99
|
-
// @ts-ignore
|
|
100
|
-
return rec ? [...rec] : undefined
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
/**
|
|
104
|
-
* Deletes the provided peer from the book.
|
|
105
|
-
*
|
|
106
|
-
* @param {PeerId} peerId
|
|
107
|
-
* @returns {boolean}
|
|
108
|
-
*/
|
|
109
|
-
delete (peerId) {
|
|
110
|
-
if (!PeerId.isPeerId(peerId)) {
|
|
111
|
-
throw errcode(new Error('peerId must be an instance of peer-id'), codes.ERR_INVALID_PARAMETERS)
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
if (!this.data.delete(peerId.toB58String())) {
|
|
115
|
-
return false
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
this._emit(peerId, [])
|
|
119
|
-
|
|
120
|
-
return true
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
module.exports = Book
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
module.exports.NAMESPACE_COMMON = '/peers/'
|
|
4
|
-
|
|
5
|
-
// /peers/protos/<b32 peer id no padding>
|
|
6
|
-
module.exports.NAMESPACE_ADDRESS = '/peers/addrs/'
|
|
7
|
-
|
|
8
|
-
// /peers/keys/<b32 peer id no padding>
|
|
9
|
-
module.exports.NAMESPACE_KEYS = '/peers/keys/'
|
|
10
|
-
|
|
11
|
-
// /peers/metadata/<b32 peer id no padding>/<key>
|
|
12
|
-
module.exports.NAMESPACE_METADATA = '/peers/metadata/'
|
|
13
|
-
|
|
14
|
-
// /peers/addrs/<b32 peer id no padding>
|
|
15
|
-
module.exports.NAMESPACE_PROTOCOL = '/peers/protos/'
|