@decentnetwork/lan 0.1.5 → 0.1.7
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
|
package/dist/daemon/server.js
CHANGED
|
@@ -90,15 +90,21 @@ export class DaemonServer {
|
|
|
90
90
|
// optional dora registration can decide our IP.
|
|
91
91
|
const keyFile = resolve(this.config.carrier.dataDir, "keypair.json");
|
|
92
92
|
this.peerManager = new PeerManager();
|
|
93
|
-
//
|
|
94
|
-
//
|
|
95
|
-
//
|
|
96
|
-
//
|
|
97
|
-
//
|
|
93
|
+
// Use express nodes. Previously the daemon passed an empty array
|
|
94
|
+
// here on the theory that "express is for offline messages, not
|
|
95
|
+
// live packet forwarding". But asymmetric Carrier sessions (peer
|
|
96
|
+
// A thinks B is online, B thinks A is offline — common across
|
|
97
|
+
// China-WAN paths) make dora's sendText reply fail direct and
|
|
98
|
+
// fall back to express; if we don't subscribe to express we
|
|
99
|
+
// never see the response. dora -> cn for register-ok / list-ok
|
|
100
|
+
// hits this exact case. The cost of enabling express here is
|
|
101
|
+
// that idle text messages may take an extra hop through the
|
|
102
|
+
// HTTPS relay — packet-router doesn't use sendText, so its
|
|
103
|
+
// hot path is unaffected.
|
|
98
104
|
await this.peerManager.create({
|
|
99
105
|
keyFile,
|
|
100
106
|
bootstrapNodes: this.config.carrier.bootstrapNodes,
|
|
101
|
-
expressNodes: [],
|
|
107
|
+
expressNodes: this.config.carrier.expressNodes ?? [],
|
|
102
108
|
});
|
|
103
109
|
await this.peerManager.start();
|
|
104
110
|
this.logger.info(`Identity: ${this.peerManager.getAddress()}`);
|
|
@@ -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
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@decentnetwork/lan",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.7",
|
|
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",
|