@highway1/cli 0.1.35 → 0.1.37
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.js +16 -5
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/commands/join.ts +7 -3
package/package.json
CHANGED
package/src/commands/join.ts
CHANGED
|
@@ -70,15 +70,19 @@ export function registerJoinCommand(program: Command): void {
|
|
|
70
70
|
const hasRelayAddr = () => node.getMultiaddrs().some(a => a.includes('/p2p-circuit'));
|
|
71
71
|
if (!hasRelayAddr()) {
|
|
72
72
|
info('Waiting for relay reservation...');
|
|
73
|
+
info(`Listen addresses configured: ${JSON.stringify((node.libp2p as any).components?.addressManager?.getListenAddrs?.() || [])}`);
|
|
74
|
+
|
|
73
75
|
await new Promise<void>((resolve) => {
|
|
74
76
|
const timeout = setTimeout(() => {
|
|
75
|
-
info(`Relay reservation timeout after 10s
|
|
77
|
+
info(`Relay reservation timeout after 10s.`);
|
|
78
|
+
info(`Final multiaddrs: ${node.getMultiaddrs().join(', ')}`);
|
|
79
|
+
info(`Connected peers: ${node.libp2p.getPeers().map(p => p.toString()).join(', ')}`);
|
|
76
80
|
resolve();
|
|
77
81
|
}, 10000);
|
|
78
82
|
|
|
79
83
|
// Listen for relay:reservation event (fires when reservation succeeds)
|
|
80
|
-
const onReservation = () => {
|
|
81
|
-
info(`Relay reservation successful
|
|
84
|
+
const onReservation = (evt: any) => {
|
|
85
|
+
info(`Relay reservation successful! Details: ${JSON.stringify(evt.detail)}`);
|
|
82
86
|
clearTimeout(timeout);
|
|
83
87
|
// Wait a bit for multiaddrs to update
|
|
84
88
|
setTimeout(() => {
|