@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 CHANGED
@@ -116212,7 +116212,14 @@ async function createNode(config2) {
116212
116212
  },
116213
116213
  selectors: {
116214
116214
  clawiverse: () => 0
116215
- }
116215
+ },
116216
+ // Optimize for small networks: reduce replication factor and query timeout
116217
+ kBucketSize: 20,
116218
+ // Default K=20, keep for compatibility
116219
+ querySelfInterval: 3e5,
116220
+ // Self-query every 5 min (default 30s)
116221
+ // Allow queries to complete faster in small networks
116222
+ allowQueryWithZeroPeers: true
116216
116223
  });
116217
116224
  }
116218
116225
  const peerDiscovery = [];
@@ -116487,7 +116494,8 @@ function createDHTOperations(libp2p) {
116487
116494
  (c2) => typeof c2 === "string" ? c2 : c2.name
116488
116495
  ).filter(Boolean);
116489
116496
  caps.push("__all__");
116490
- await Promise.all(caps.map(async (cap) => {
116497
+ const importantCaps = ["__all__"];
116498
+ await Promise.all(importantCaps.map(async (cap) => {
116491
116499
  const capKeyStr = `/clawiverse/cap/${capKey(cap)}`;
116492
116500
  const capDHTKey = fromString2(capKeyStr);
116493
116501
  try {
@@ -118305,13 +118313,16 @@ function registerJoinCommand(program2) {
118305
118313
  const hasRelayAddr = () => node.getMultiaddrs().some((a2) => a2.includes("/p2p-circuit"));
118306
118314
  if (!hasRelayAddr()) {
118307
118315
  info("Waiting for relay reservation...");
118316
+ info(`Listen addresses configured: ${JSON.stringify(node.libp2p.components?.addressManager?.getListenAddrs?.() || [])}`);
118308
118317
  await new Promise((resolve) => {
118309
118318
  const timeout = setTimeout(() => {
118310
- info(`Relay reservation timeout after 10s. Multiaddrs: ${node.getMultiaddrs().join(", ")}`);
118319
+ info(`Relay reservation timeout after 10s.`);
118320
+ info(`Final multiaddrs: ${node.getMultiaddrs().join(", ")}`);
118321
+ info(`Connected peers: ${node.libp2p.getPeers().map((p2) => p2.toString()).join(", ")}`);
118311
118322
  resolve();
118312
118323
  }, 1e4);
118313
- const onReservation = () => {
118314
- info(`Relay reservation successful!`);
118324
+ const onReservation = (evt) => {
118325
+ info(`Relay reservation successful! Details: ${JSON.stringify(evt.detail)}`);
118315
118326
  clearTimeout(timeout);
118316
118327
  setTimeout(() => {
118317
118328
  info(`Relay addresses: ${node.getMultiaddrs().filter((a2) => a2.includes("/p2p-circuit")).join(", ")}`);