@decentnetwork/lan 0.1.4 → 0.1.6
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.
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -38,7 +38,12 @@ export class DoraIntegration {
|
|
|
38
38
|
handler(fromUserid, text);
|
|
39
39
|
});
|
|
40
40
|
},
|
|
41
|
-
|
|
41
|
+
// 30s — China → overseas-bootstrap → relay → dora's TCP relay
|
|
42
|
+
// → back round-trips can blow past 10s under jitter. Initial
|
|
43
|
+
// roster fetch was failing for cn (Aliyun) at 10s consistently;
|
|
44
|
+
// bumping to 30s gets through. Configurable via env var for
|
|
45
|
+
// operators on even worse paths.
|
|
46
|
+
timeoutMs: parseInt(process.env.AGENTNET_DORA_TIMEOUT_MS || "30000", 10),
|
|
42
47
|
});
|
|
43
48
|
}
|
|
44
49
|
/**
|
|
@@ -76,7 +81,16 @@ export class DoraIntegration {
|
|
|
76
81
|
new Promise((r) => setTimeout(() => r(null), 30_000)),
|
|
77
82
|
]);
|
|
78
83
|
if (!anyOnline) {
|
|
79
|
-
this.logger.warn("No dora server became reachable within 30s — falling back to config IP");
|
|
84
|
+
this.logger.warn("No dora server became reachable within 30s — falling back to config IP. Will retry in background.");
|
|
85
|
+
// Without this the daemon would never re-attempt registration
|
|
86
|
+
// after a cold-start where the dora friend session was slow
|
|
87
|
+
// to come up. Symptom: friends.status=online for dora a
|
|
88
|
+
// moment later, but ipam stays empty and packetsForwarded=0
|
|
89
|
+
// forever because we never called register/list. The 30s
|
|
90
|
+
// window expiring is the SAME failure class as register
|
|
91
|
+
// throwing AllRegistriesUnavailableError, so reuse the same
|
|
92
|
+
// retry timer.
|
|
93
|
+
this.scheduleBootstrapRetry();
|
|
80
94
|
return this.opts.preferredIp ?? "";
|
|
81
95
|
}
|
|
82
96
|
this.logger.debug(`Dora friend online: ${anyOnline.id}`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@decentnetwork/lan",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"description": "Private virtual LAN for self-hosted services and AI agents, built on Elastos Carrier. NAT-traversal, name service, ACL, all over a peer-to-peer mesh — no public IP required.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|