@highway1/cli 0.1.30 → 0.1.32

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@highway1/cli",
3
- "version": "0.1.30",
3
+ "version": "0.1.32",
4
4
  "description": "CLI tool for Clawiverse network",
5
5
  "type": "module",
6
6
  "bin": {
@@ -69,14 +69,24 @@ export function registerJoinCommand(program: Command): void {
69
69
  // Phase 2: wait for relay address to appear (up to 5s)
70
70
  const hasRelayAddr = () => node.getMultiaddrs().some(a => a.includes('/p2p-circuit'));
71
71
  if (!hasRelayAddr()) {
72
+ info('Waiting for relay reservation...');
72
73
  await new Promise<void>((resolve) => {
73
- const timeout = setTimeout(resolve, 5000);
74
+ const timeout = setTimeout(() => {
75
+ info(`Relay reservation timeout after 5s. Multiaddrs: ${node.getMultiaddrs().join(', ')}`);
76
+ resolve();
77
+ }, 5000);
74
78
  const check = () => {
75
- if (hasRelayAddr()) { clearTimeout(timeout); resolve(); }
79
+ if (hasRelayAddr()) {
80
+ info(`Relay address acquired: ${node.getMultiaddrs().filter(a => a.includes('/p2p-circuit')).join(', ')}`);
81
+ clearTimeout(timeout);
82
+ resolve();
83
+ }
76
84
  };
77
- node.libp2p.addEventListener('self:multiaddress:updated', check);
78
- setTimeout(() => node.libp2p.removeEventListener('self:multiaddress:updated', check), 5000);
85
+ node.libp2p.addEventListener('self:peer:update', check);
86
+ setTimeout(() => node.libp2p.removeEventListener('self:peer:update', check), 5000);
79
87
  });
88
+ } else {
89
+ info(`Relay address already present: ${node.getMultiaddrs().filter(a => a.includes('/p2p-circuit')).join(', ')}`);
80
90
  }
81
91
 
82
92
  connectSpin.succeed('Connected to network!');