@decentnetwork/lan 0.1.36 → 0.1.38

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
@@ -9,16 +9,32 @@ const DEFAULT_CONFIG_FILE = resolve(DEFAULT_CONFIG_DIR, "config.yaml");
9
9
  // Mirrored from peer SDK's legacy-bootstraps.mjs
10
10
  // 45.207.220.155 omitted — observed timing out repeatedly during testing,
11
11
  // causing relay#2 to flap which knocks the friend connection offline.
12
+ // Ordered with US relays first so a US↔US session (the common case)
13
+ // doesn't land on a China relay just because it was first in the list.
14
+ // Observed in the wild: both Vultr (US public IP) and a Mac (US
15
+ // residential) connected to 47.100.103.201 (Alibaba Cloud Shanghai)
16
+ // as their sole TCP relay — every packet between them transited
17
+ // China, ~600ms RTT, and net_crypto handshakes often dropped because
18
+ // the path was lossy. Reordering puts AWS US-East/US-West first so
19
+ // the SDK's "connect to top-N relays" path naturally picks closer
20
+ // nodes. The China + Singapore nodes stay in the list as fallback for
21
+ // peers actually in those regions.
12
22
  const DEFAULT_BOOTSTRAP_NODES = [
13
- { host: "47.100.103.201", port: 33445, pk: "CX1XH419p4xJ5SV4KvDxBeKYSRdMJW9QpdWJY8owUxHd" },
14
- { host: "154.64.235.176", port: 33445, pk: "GdNtV2N74fZnLjhH7NhQ18nGdxb1k8jRM9dQaK7WnxmL" },
15
- { host: "52.83.171.135", port: 443, pk: "5tuHgK1Q4CYf4K5PutsEPK5E3Z7cbtEBdx7LwmdzqXHL" },
16
- { host: "52.83.191.228", port: 33445, pk: "3khtxZo89SBScAMaHhTvD68pPHiKxgZT6hTCSZZVgNEm" },
23
+ // US-East closest for typical North-American peers.
17
24
  { host: "13.58.208.50", port: 33445, pk: "89vny8MrKdDKs7Uta9RdVmspPjnRMdwMmaiEW27pZ7gh" },
18
25
  { host: "18.216.102.47", port: 33445, pk: "G5z8MqiNDFTadFUPfMdYsYtkUDbX5mNCMVHMZtsCnFeb" },
19
26
  { host: "18.216.6.197", port: 33445, pk: "H8sqhRrQuJZ6iLtP2wanxt4LzdNrN2NNFnpPdq1uJ9n2" },
27
+ // US-West.
20
28
  { host: "54.193.141.205", port: 33445, pk: "7TfZWZNV8vnBxxWzJXuvKgX2QyKkLpg2oXx3LQ5tg8LW" },
29
+ // Unknown / global.
30
+ { host: "154.64.235.176", port: 33445, pk: "GdNtV2N74fZnLjhH7NhQ18nGdxb1k8jRM9dQaK7WnxmL" },
31
+ // Asia-Pacific (Singapore + China). Kept as fallback so peers
32
+ // actually in CN/SG can use a nearby relay. Peers in the US should
33
+ // not be hitting these for normal traffic.
21
34
  { host: "52.74.215.181", port: 33445, pk: "Xv6d34WaUw9bPn7YihzVAFw7D2igbQJZ3jwmzzfYVFV" },
35
+ { host: "47.100.103.201", port: 33445, pk: "CX1XH419p4xJ5SV4KvDxBeKYSRdMJW9QpdWJY8owUxHd" },
36
+ { host: "52.83.171.135", port: 443, pk: "5tuHgK1Q4CYf4K5PutsEPK5E3Z7cbtEBdx7LwmdzqXHL" },
37
+ { host: "52.83.191.228", port: 33445, pk: "3khtxZo89SBScAMaHhTvD68pPHiKxgZT6hTCSZZVgNEm" },
22
38
  ];
23
39
  const DEFAULT_EXPRESS_NODES = [
24
40
  { host: "lens.beagle.chat", port: 443, pk: "ECbs4GxwGzxGerNkmqDJFibEmevu8jAXqAZtikccvD95" },
@@ -153,7 +169,16 @@ export class ConfigLoader {
153
169
  },
154
170
  carrier: {
155
171
  dataDir: config.carrier?.dataDir || defaults.carrier.dataDir,
156
- bootstrapNodes: config.carrier?.bootstrapNodes || defaults.carrier.bootstrapNodes,
172
+ // ALWAYS use the latest DEFAULT_BOOTSTRAP_NODES, even if the
173
+ // user's config.yaml has an older list. Bootstrap nodes are
174
+ // shared public infrastructure — operators who want a private
175
+ // mesh point at their own dora (which handles peer discovery
176
+ // entirely); they don't customize Carrier bootstraps. Without
177
+ // this auto-update, a stale config.yaml from an early install
178
+ // pins a US peer to a China relay forever even after we
179
+ // reorder defaults, and every install upgrade keeps the bad
180
+ // first-relay landing pattern.
181
+ bootstrapNodes: defaults.carrier.bootstrapNodes,
157
182
  expressNodes: config.carrier?.expressNodes || defaults.carrier.expressNodes,
158
183
  },
159
184
  network: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@decentnetwork/lan",
3
- "version": "0.1.36",
3
+ "version": "0.1.38",
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",
@@ -74,7 +74,7 @@
74
74
  },
75
75
  "dependencies": {
76
76
  "@decentnetwork/dora": "^0.1.0",
77
- "@decentnetwork/peer": "^0.1.10",
77
+ "@decentnetwork/peer": "^0.1.11",
78
78
  "js-yaml": "^4.1.0",
79
79
  "yargs": "^17.7.2"
80
80
  },