@relay-federation/bridge 0.3.4 → 0.3.5
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/cli.js +4 -4
- package/lib/peer-manager.js +1 -1
- package/package.json +1 -1
package/cli.js
CHANGED
|
@@ -428,7 +428,7 @@ async function cmdStart () {
|
|
|
428
428
|
console.log(` Registry: ${registeredPubkeys.size} trusted pubkeys (self + seeds)`)
|
|
429
429
|
|
|
430
430
|
// ── 4b. Beacon address watcher — detect on-chain registrations ──
|
|
431
|
-
const { extractOpReturnData, decodePayload, PROTOCOL_PREFIX } = await import('
|
|
431
|
+
const { extractOpReturnData, decodePayload, PROTOCOL_PREFIX } = await import('@relay-federation/registry/lib/cbor.js')
|
|
432
432
|
const { Transaction: BsvTx } = await import('@bsv/sdk')
|
|
433
433
|
|
|
434
434
|
// Registry bootstrapped via discoverNewPeers() after server start (no WoC dependency)
|
|
@@ -723,9 +723,9 @@ async function cmdStart () {
|
|
|
723
723
|
// Fallback: scan chain for peers (legacy mode)
|
|
724
724
|
console.log('No seed peers configured. Scanning chain for peers...')
|
|
725
725
|
try {
|
|
726
|
-
const { scanRegistry } = await import('
|
|
727
|
-
const { buildPeerList, excludeSelf } = await import('
|
|
728
|
-
const { savePeerCache, loadPeerCache } = await import('
|
|
726
|
+
const { scanRegistry } = await import('@relay-federation/registry/lib/scanner.js')
|
|
727
|
+
const { buildPeerList, excludeSelf } = await import('@relay-federation/registry/lib/discovery.js')
|
|
728
|
+
const { savePeerCache, loadPeerCache } = await import('@relay-federation/registry/lib/peer-cache.js')
|
|
729
729
|
|
|
730
730
|
const cachePath = join(dir, 'cache', 'peers.json')
|
|
731
731
|
let peers = await loadPeerCache(cachePath)
|
package/lib/peer-manager.js
CHANGED
|
@@ -158,7 +158,7 @@ export class PeerManager extends EventEmitter {
|
|
|
158
158
|
// If cryptographic handshake is available, use it
|
|
159
159
|
if (opts.handshake && msg.nonce && Array.isArray(msg.versions)) {
|
|
160
160
|
const isSeed = opts.seedEndpoints && opts.seedEndpoints.has(msg.endpoint)
|
|
161
|
-
const result = opts.handshake.handleHello(msg,
|
|
161
|
+
const result = opts.handshake.handleHello(msg, isSeed ? null : opts.registeredPubkeys)
|
|
162
162
|
if (result.error) {
|
|
163
163
|
ws.send(JSON.stringify({ type: 'error', error: result.error }))
|
|
164
164
|
ws.close()
|