@serfab/cadre-core 1.14.0 → 1.16.0
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/README.md +293 -274
- package/dist/cadre-invite-protocol.d.ts +64 -29
- package/dist/cadre-invite-protocol.js +207 -38
- package/dist/cadre-invite-protocol.js.map +1 -1
- package/dist/cadre-join-request.d.ts +42 -0
- package/dist/cadre-join-request.js +144 -0
- package/dist/cadre-join-request.js.map +1 -0
- package/dist/cadre-node.d.ts +375 -79
- package/dist/cadre-node.js +758 -186
- package/dist/cadre-node.js.map +1 -1
- package/dist/control-database.d.ts +92 -12
- package/dist/control-database.js +323 -142
- package/dist/control-database.js.map +1 -1
- package/dist/control-schema.d.ts +1 -1
- package/dist/control-schema.js +19 -3
- package/dist/control-schema.js.map +1 -1
- package/dist/ed25519-key.d.ts +7 -9
- package/dist/ed25519-key.js +20 -10
- package/dist/ed25519-key.js.map +1 -1
- package/dist/fetch-impl.d.ts +12 -0
- package/dist/fetch-impl.js +23 -0
- package/dist/fetch-impl.js.map +1 -0
- package/dist/file-durable-slot.js +2 -1
- package/dist/file-durable-slot.js.map +1 -1
- package/dist/file-safe-name.d.ts +25 -0
- package/dist/file-safe-name.js +29 -0
- package/dist/file-safe-name.js.map +1 -0
- package/dist/formation-approval.js +5 -11
- package/dist/formation-approval.js.map +1 -1
- package/dist/fs-atomic.d.ts +0 -19
- package/dist/fs-atomic.js +3 -24
- package/dist/fs-atomic.js.map +1 -1
- package/dist/index.d.ts +12 -5
- package/dist/index.js +31 -6
- package/dist/index.js.map +1 -1
- package/dist/invitation-bootstrap.d.ts +50 -12
- package/dist/invitation-bootstrap.js +76 -13
- package/dist/invitation-bootstrap.js.map +1 -1
- package/dist/joined-strand-store.d.ts +7 -0
- package/dist/joined-strand-store.js +9 -0
- package/dist/joined-strand-store.js.map +1 -1
- package/dist/key-store-file.js +2 -1
- package/dist/key-store-file.js.map +1 -1
- package/dist/link-budget.d.ts +9 -4
- package/dist/link-budget.js +9 -4
- package/dist/link-budget.js.map +1 -1
- package/dist/machine-removal.d.ts +78 -0
- package/dist/machine-removal.js +166 -0
- package/dist/machine-removal.js.map +1 -0
- package/dist/membership-connection-gater.d.ts +6 -5
- package/dist/membership-connection-gater.js +6 -5
- package/dist/membership-connection-gater.js.map +1 -1
- package/dist/node-claim-payload.d.ts +55 -0
- package/dist/node-claim-payload.js +108 -4
- package/dist/node-claim-payload.js.map +1 -1
- package/dist/node-default-transports.d.ts +27 -0
- package/dist/node-default-transports.js +35 -0
- package/dist/node-default-transports.js.map +1 -0
- package/dist/node-transports.d.ts +30 -0
- package/dist/node-transports.js +40 -0
- package/dist/node-transports.js.map +1 -0
- package/dist/peer-dial.d.ts +124 -27
- package/dist/peer-dial.js +254 -30
- package/dist/peer-dial.js.map +1 -1
- package/dist/peer-join-backfill.js +6 -0
- package/dist/peer-join-backfill.js.map +1 -1
- package/dist/peer-record.d.ts +6 -45
- package/dist/peer-record.js +8 -50
- package/dist/peer-record.js.map +1 -1
- package/dist/primary-lan-address.d.ts +8 -0
- package/dist/primary-lan-address.js +46 -0
- package/dist/primary-lan-address.js.map +1 -0
- package/dist/provider/client.d.ts +131 -0
- package/dist/provider/client.js +226 -0
- package/dist/provider/client.js.map +1 -0
- package/dist/provider/descriptor.d.ts +41 -0
- package/dist/provider/descriptor.js +103 -0
- package/dist/provider/descriptor.js.map +1 -0
- package/dist/provider/index.d.ts +9 -0
- package/dist/provider/index.js +10 -0
- package/dist/provider/index.js.map +1 -0
- package/dist/provider/oauth.d.ts +125 -0
- package/dist/provider/oauth.js +199 -0
- package/dist/provider/oauth.js.map +1 -0
- package/dist/provider/rent-node.d.ts +101 -0
- package/dist/provider/rent-node.js +220 -0
- package/dist/provider/rent-node.js.map +1 -0
- package/dist/relay-addrs.d.ts +9 -4
- package/dist/relay-addrs.js +9 -4
- package/dist/relay-addrs.js.map +1 -1
- package/dist/relay-reservation.d.ts +51 -16
- package/dist/relay-reservation.js +107 -24
- package/dist/relay-reservation.js.map +1 -1
- package/dist/seed-bootstrap.d.ts +22 -5
- package/dist/seed-bootstrap.js +48 -25
- package/dist/seed-bootstrap.js.map +1 -1
- package/dist/strand-commit-durability.d.ts +54 -0
- package/dist/strand-commit-durability.js +74 -0
- package/dist/strand-commit-durability.js.map +1 -0
- package/dist/strand-database.d.ts +23 -8
- package/dist/strand-database.js +41 -13
- package/dist/strand-database.js.map +1 -1
- package/dist/strand-first-sync-gate.d.ts +7 -1
- package/dist/strand-first-sync-gate.js +7 -1
- package/dist/strand-first-sync-gate.js.map +1 -1
- package/dist/strand-formation-protocol.js +4 -1
- package/dist/strand-formation-protocol.js.map +1 -1
- package/dist/strand-fret-addrs.d.ts +19 -1
- package/dist/strand-fret-addrs.js +27 -9
- package/dist/strand-fret-addrs.js.map +1 -1
- package/dist/strand-instance-manager.d.ts +81 -19
- package/dist/strand-instance-manager.js +216 -105
- package/dist/strand-instance-manager.js.map +1 -1
- package/dist/strand-move.d.ts +124 -0
- package/dist/strand-move.js +438 -0
- package/dist/strand-move.js.map +1 -0
- package/dist/strand-network-config.js +7 -6
- package/dist/strand-network-config.js.map +1 -1
- package/dist/strand-peer-redial.d.ts +113 -0
- package/dist/strand-peer-redial.js +236 -0
- package/dist/strand-peer-redial.js.map +1 -0
- package/dist/strand-wake-protocol.js +10 -7
- package/dist/strand-wake-protocol.js.map +1 -1
- package/dist/types.d.ts +212 -4
- package/dist/types.js +10 -0
- package/dist/types.js.map +1 -1
- package/package.json +18 -10
- package/src/cadre-invite-protocol.ts +1052 -864
- package/src/cadre-join-request.ts +167 -0
- package/src/cadre-node.ts +10003 -9381
- package/src/control-database.ts +4663 -4451
- package/src/control-schema.ts +19 -3
- package/src/ed25519-key.ts +20 -10
- package/src/fetch-impl.ts +23 -0
- package/src/file-durable-slot.ts +64 -63
- package/src/file-safe-name.ts +32 -0
- package/src/formation-approval.ts +604 -610
- package/src/fs-atomic.ts +92 -117
- package/src/index.ts +71 -4
- package/src/invitation-bootstrap.ts +91 -13
- package/src/joined-strand-store.ts +508 -498
- package/src/key-store-file.ts +142 -141
- package/src/link-budget.ts +9 -4
- package/src/machine-removal.ts +216 -0
- package/src/membership-connection-gater.ts +638 -637
- package/src/node-claim-payload.ts +138 -4
- package/src/node-default-transports.ts +38 -0
- package/src/node-transports.ts +49 -0
- package/src/peer-dial.ts +604 -336
- package/src/peer-join-backfill.ts +6 -0
- package/src/peer-record.ts +159 -202
- package/src/primary-lan-address.ts +47 -0
- package/src/provider/client.ts +326 -0
- package/src/provider/descriptor.ts +129 -0
- package/src/provider/index.ts +59 -0
- package/src/provider/oauth.ts +285 -0
- package/src/provider/rent-node.ts +275 -0
- package/src/relay-addrs.ts +9 -4
- package/src/relay-reservation.ts +1211 -1121
- package/src/seed-bootstrap.ts +1502 -1471
- package/src/strand-commit-durability.ts +116 -0
- package/src/strand-database.ts +46 -14
- package/src/strand-first-sync-gate.ts +7 -1
- package/src/strand-formation-protocol.ts +1039 -1036
- package/src/strand-fret-addrs.ts +179 -145
- package/src/strand-instance-manager.ts +2026 -1883
- package/src/strand-move.ts +585 -0
- package/src/strand-network-config.ts +7 -6
- package/src/strand-peer-redial.ts +307 -0
- package/src/strand-wake-protocol.ts +10 -7
- package/src/types.ts +220 -4
package/src/strand-fret-addrs.ts
CHANGED
|
@@ -1,145 +1,179 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Reading the signed address records a running strand node's FRET routing table holds,
|
|
3
|
-
* as per-peer addresses ready for that node's own address book (`peer-addr-book.ts`).
|
|
4
|
-
*
|
|
5
|
-
* Why a strand node needs this. libp2p's peerStore hides every address one hour after
|
|
6
|
-
* it was first observed (the `NOTE:` on `mergePeerAddrs`), and FRET does not re-apply
|
|
7
|
-
* the records it holds: it hands a record to the peerStore when a neighbour's snapshot
|
|
8
|
-
* delivers it or a saved table is imported, and the peerStore refuses a record whose
|
|
9
|
-
* sequence number it already has. So a strand node that has been up for more than an
|
|
10
|
-
* hour would have no address for a peer whose connection then drops, although FRET
|
|
11
|
-
* still holds that peer's record. `CadreNode.refreshStrandPeerAddrs` re-merges the
|
|
12
|
-
* records on every pass, which is what keeps another party's strand nodes dialable;
|
|
13
|
-
* own-party siblings are re-resolved separately, over the strand-addr RPC.
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
* the
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
import
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
*
|
|
74
|
-
*
|
|
75
|
-
*
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Reading the signed address records a running strand node's FRET routing table holds,
|
|
3
|
+
* as per-peer addresses ready for that node's own address book (`peer-addr-book.ts`).
|
|
4
|
+
*
|
|
5
|
+
* Why a strand node needs this. libp2p's peerStore hides every address one hour after
|
|
6
|
+
* it was first observed (the `NOTE:` on `mergePeerAddrs`), and FRET does not re-apply
|
|
7
|
+
* the records it holds: it hands a record to the peerStore when a neighbour's snapshot
|
|
8
|
+
* delivers it or a saved table is imported, and the peerStore refuses a record whose
|
|
9
|
+
* sequence number it already has. So a strand node that has been up for more than an
|
|
10
|
+
* hour would have no address for a peer whose connection then drops, although FRET
|
|
11
|
+
* still holds that peer's record. `CadreNode.refreshStrandPeerAddrs` re-merges the
|
|
12
|
+
* records on every pass, which is what keeps another party's strand nodes dialable;
|
|
13
|
+
* own-party siblings are re-resolved separately, over the strand-addr RPC. The strand
|
|
14
|
+
* peer redial (`strand-peer-redial.ts`) reads the same records, and FRET's membership
|
|
15
|
+
* labels, to choose whom to dial.
|
|
16
|
+
*
|
|
17
|
+
* How long a record is available here is FRET's rule, not this module's: while FRET
|
|
18
|
+
* holds the entry, and at most 14 days after the record was last confirmed (a peer
|
|
19
|
+
* connected at export time counts as confirmed then).
|
|
20
|
+
*
|
|
21
|
+
* Every record is opened and verified here rather than taken on FRET's word. A record
|
|
22
|
+
* is self-certifying, the table is reached through a structural type rather than an
|
|
23
|
+
* interface this package depends on, and the address book write is attributed from what
|
|
24
|
+
* the record proves, not from the id the table filed it under.
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
import debug from 'debug';
|
|
28
|
+
import { PeerRecord, RecordEnvelope } from '@libp2p/peer-record';
|
|
29
|
+
import { peerIdFromPublicKey } from '@libp2p/peer-id';
|
|
30
|
+
import { multiaddr, type Multiaddr } from '@multiformats/multiaddr';
|
|
31
|
+
import { fromString as uint8ArrayFromString } from 'uint8arrays';
|
|
32
|
+
import { withTrailingPeerId } from './peer-dial.js';
|
|
33
|
+
|
|
34
|
+
const log = debug('sereus:cadre:strand-fret-addrs');
|
|
35
|
+
|
|
36
|
+
/** The slice of FRET's exported routing table read here (`SerializedTable` in `p2p-fret`). */
|
|
37
|
+
interface FretTableSlice {
|
|
38
|
+
entries: ReadonlyArray<{
|
|
39
|
+
id: string;
|
|
40
|
+
/** `envelope` is the base64url of a marshaled libp2p record envelope. */
|
|
41
|
+
addressRecord?: { envelope: string };
|
|
42
|
+
/** FRET's `MembershipState`: `'member'`, `'foreign'` or `'unknown'`; absent in tables that predate it. */
|
|
43
|
+
membership?: string;
|
|
44
|
+
}>;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/** The slice of FRET's libp2p service called here. */
|
|
48
|
+
interface FretTableSource {
|
|
49
|
+
exportTable(): FretTableSlice;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* The slice of a strand's libp2p node this module touches. Structurally satisfied by
|
|
54
|
+
* `Libp2p`; db-p2p registers FRET as `services.fret`.
|
|
55
|
+
*/
|
|
56
|
+
export interface FretAddrHost {
|
|
57
|
+
peerId: { toString(): string };
|
|
58
|
+
services?: Record<string, unknown>;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/** What one read of a strand node's FRET table yields. */
|
|
62
|
+
export interface FretPeerAddrs {
|
|
63
|
+
/** Peer id → the addresses its record lists, each bound to that peer. Table order. */
|
|
64
|
+
peers: Map<string, Multiaddr[]>;
|
|
65
|
+
/**
|
|
66
|
+
* Records left out because they did not decode, did not verify, or were not signed
|
|
67
|
+
* by and about the peer the table filed them under.
|
|
68
|
+
*/
|
|
69
|
+
rejected: number;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Whether FRET has seen a peer speak this strand network's protocols (`'member'`), seen it
|
|
74
|
+
* list protocols without any of them (`'foreign'`), or not judged it yet (`'unknown'`).
|
|
75
|
+
*
|
|
76
|
+
* The relay a strand node reserves on is `'foreign'`, and that label is the only thing in
|
|
77
|
+
* the table that tells it from a member: FRET files every connected peer, and adopts the
|
|
78
|
+
* signed record identify delivers for it, so the relay's entry carries a record as a
|
|
79
|
+
* member's does.
|
|
80
|
+
*/
|
|
81
|
+
export type FretMembership = 'member' | 'foreign' | 'unknown';
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* The addresses of every peer `host`'s FRET table holds a usable signed record for,
|
|
85
|
+
* `host` itself excluded. A node with no FRET service (a db-p2p build without it, a
|
|
86
|
+
* test double) reads as an empty table. One bad record never costs the others: it is
|
|
87
|
+
* counted in `rejected` and skipped.
|
|
88
|
+
*
|
|
89
|
+
* Throws only what `exportTable()` throws, which a caller treats like any other
|
|
90
|
+
* failure of a pass over a node that may be mid-teardown.
|
|
91
|
+
*/
|
|
92
|
+
export async function strandFretPeerAddrs(host: FretAddrHost): Promise<FretPeerAddrs> {
|
|
93
|
+
const result: FretPeerAddrs = { peers: new Map(), rejected: 0 };
|
|
94
|
+
for (const entry of fretTableEntries(host)) {
|
|
95
|
+
if (entry.addressRecord === undefined) {
|
|
96
|
+
continue;
|
|
97
|
+
}
|
|
98
|
+
const addrs = await verifiedRecordAddrs(entry.id, entry.addressRecord.envelope);
|
|
99
|
+
if (addrs === null) {
|
|
100
|
+
result.rejected++;
|
|
101
|
+
} else if (addrs.length > 0) {
|
|
102
|
+
result.peers.set(entry.id, addrs);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
return result;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* FRET's membership label for every peer `host`'s table holds, `host` itself excluded.
|
|
110
|
+
* Checks no signature, so a caller that needs only the labels pays for one table export
|
|
111
|
+
* rather than one record verification per peer. Throws what `exportTable()` throws.
|
|
112
|
+
*/
|
|
113
|
+
export function strandFretMembership(host: FretAddrHost): Map<string, FretMembership> {
|
|
114
|
+
return new Map(fretTableEntries(host).map((entry) => [entry.id, asMembership(entry.membership)]));
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/** The table's entries other than `host`'s own; none when the node runs no FRET service. */
|
|
118
|
+
function fretTableEntries(host: FretAddrHost): FretTableSlice['entries'] {
|
|
119
|
+
const fret = host.services?.fret;
|
|
120
|
+
if (!isFretTableSource(fret)) {
|
|
121
|
+
return [];
|
|
122
|
+
}
|
|
123
|
+
const selfId = host.peerId.toString();
|
|
124
|
+
return fret.exportTable().entries.filter((entry) => entry.id !== selfId);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/** A label FRET did not write (a table that predates it, or a value this module does not know) is no judgement. */
|
|
128
|
+
function asMembership(label: string | undefined): FretMembership {
|
|
129
|
+
return label === 'member' || label === 'foreign' ? label : 'unknown';
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
function isFretTableSource(service: unknown): service is FretTableSource {
|
|
133
|
+
return typeof service === 'object' && service !== null
|
|
134
|
+
&& typeof (service as { exportTable?: unknown }).exportTable === 'function';
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* The addresses one record lists, bound to `peerId`; null when the record must not be
|
|
139
|
+
* used. `openAndCertify` proves only that the envelope's own key signed it, so the
|
|
140
|
+
* signer and the peer the payload describes are each held against `peerId` here:
|
|
141
|
+
* without that, any peer could sign a record rewriting another peer's addresses.
|
|
142
|
+
*/
|
|
143
|
+
async function verifiedRecordAddrs(peerId: string, envelope: string): Promise<Multiaddr[] | null> {
|
|
144
|
+
try {
|
|
145
|
+
const opened = await RecordEnvelope.openAndCertify(uint8ArrayFromString(envelope, 'base64url'), PeerRecord.DOMAIN);
|
|
146
|
+
const record = PeerRecord.createFromProtobuf(opened.payload);
|
|
147
|
+
const signer = peerIdFromPublicKey(opened.publicKey).toString();
|
|
148
|
+
const subject = record.peerId.toString();
|
|
149
|
+
if (signer !== peerId || subject !== peerId) {
|
|
150
|
+
log('skipping the address record filed under %s: signed by %s about %s', peerId, signer, subject);
|
|
151
|
+
return null;
|
|
152
|
+
}
|
|
153
|
+
return bindToPeer(record.multiaddrs.map((addr) => addr.toString()), peerId);
|
|
154
|
+
} catch (error) {
|
|
155
|
+
log('skipping the address record filed under %s: %o', peerId, error);
|
|
156
|
+
return null;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* A record names its peer once, in `peerId`, so its addresses carry no trailing
|
|
162
|
+
* `/p2p/<peerId>` and a relay-only peer's circuit address ends at the relay hop
|
|
163
|
+
* (`…/p2p/<relay>/p2p-circuit`). Each is given the suffix that makes it a complete
|
|
164
|
+
* dial target; one already terminating in a different peer id does not reach this peer
|
|
165
|
+
* and is dropped.
|
|
166
|
+
*
|
|
167
|
+
* Takes strings because `@libp2p/peer-record` carries its own `@multiformats/multiaddr`
|
|
168
|
+
* copy, a structurally different type from the one `withTrailingPeerId` takes.
|
|
169
|
+
*/
|
|
170
|
+
function bindToPeer(addrs: string[], peerId: string): Multiaddr[] {
|
|
171
|
+
const bound: Multiaddr[] = [];
|
|
172
|
+
for (const addr of addrs) {
|
|
173
|
+
const withPeer = withTrailingPeerId(multiaddr(addr), peerId);
|
|
174
|
+
if (withPeer !== null) {
|
|
175
|
+
bound.push(withPeer);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
return bound;
|
|
179
|
+
}
|