@peerbit/server 5.8.13 → 5.8.15-d375893

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.
@@ -23,7 +23,7 @@
23
23
  Learn how to configure a non-root public URL by running `npm run build`.
24
24
  -->
25
25
  <title>Peerbit</title>
26
- <script type="module" crossorigin src="/assets/index-DIOBOX6-.js"></script>
26
+ <script type="module" crossorigin src="/assets/index-eOjCmm72.js"></script>
27
27
  <link rel="stylesheet" crossorigin href="/assets/index-CIfVvUo9.css">
28
28
  </head>
29
29
 
package/package.json CHANGED
@@ -1,91 +1,111 @@
1
1
  {
2
- "name": "@peerbit/server",
3
- "version": "5.8.13",
4
- "author": "dao.xyz",
5
- "repository": {
6
- "type": "git",
7
- "url": "https://github.com/dao-xyz/peerbit"
8
- },
9
- "license": "Apache-2.0",
10
- "type": "module",
11
- "sideEffects": false,
12
- "bin": {
13
- "peerbit": "./dist/src/bin.js"
14
- },
15
- "module": "dist/src/index.js",
16
- "types": "dist/src/index.d.ts",
17
- "exports": {
18
- "import": "./dist/src/index.js"
19
- },
20
- "browser": {
21
- "./dist/src/server.js": "./dist/src/server.browser.js",
22
- "./server.js": "./dist/src/server.browser.js",
23
- "./dist/src/config.js": "./dist/src/config.browser.js",
24
- "./config.js": "./dist/src/config.browser.js",
25
- "./dist/src/remotes.js": "./dist/src/remotes.browser.js",
26
- "./remotes.js": "./dist/src/remotes.browser.js",
27
- "./dist/src/docker.js": "./dist/src/docker.browser.js",
28
- "./docker.js": "./dist/src/docker.browser.js",
29
- "./dist/src/aws.js": "./dist/src/aws.browser.js"
30
- },
31
- "files": [
32
- "dist",
33
- "src",
34
- "src/nginx-template.conf",
35
- "!src/test",
36
- "!src/**/__tests__",
37
- "!lib/**/__tests__",
38
- "patches",
39
- "LICENSE"
40
- ],
41
- "publishConfig": {
42
- "access": "public"
43
- },
44
- "engines": {
45
- "node": ">=18"
46
- },
47
- "eslintConfig": {
48
- "extends": "peerbit",
49
- "parserOptions": {
50
- "project": true,
51
- "sourceType": "module"
52
- },
53
- "ignorePatterns": [
54
- "!.aegir.js",
55
- "test/ts-use",
56
- "*.d.ts"
57
- ]
58
- },
59
- "scripts": {
60
- "clean": "shx rm -rf lib/*",
61
- "build": "yarn clean && yarn build-lib && yarn build-ui",
62
- "build-lib": "tsc -p tsconfig.json",
63
- "build-ui": "cd ../frontend && yarn build && cd ../node",
64
- "postbuild": "cp src/nginx-template.conf dist/src/ && cp -r ../frontend/dist/. dist/ui",
65
- "test": "aegir test --t node",
66
- "lint": "aegir lint"
67
- },
68
- "devDependencies": {
69
- "@peerbit/test-lib": "^0.0.1",
70
- "@peerbit/test-utils": "2.2.8",
71
- "@types/yargs": "17.0.24",
72
- "aws-sdk": "^2.1259.0",
73
- "dotenv": "^16.1.4",
74
- "@types/tmp": "^0.2.3",
75
- "@types/tar-stream": "^3.1.3",
76
- "shx": "^0.3.4"
77
- },
78
- "dependencies": {
79
- "axios": "^1.4.0",
80
- "chalk": "^5.3.0",
81
- "peerbit": "4.3.7",
82
- "yargs": "^17.7.2",
83
- "tar-stream": "^3.1.7",
84
- "tmp": "^0.2.1",
85
- "tty-table": "^4.2.1"
86
- },
87
- "optionalDependencies": {
88
- "@aws-sdk/client-ec2": "^3.390.0",
89
- "@aws-sdk/client-route-53": "^3.391.0"
90
- }
2
+ "name": "@peerbit/server",
3
+ "version": "5.8.15-d375893",
4
+ "author": "dao.xyz",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "https://github.com/dao-xyz/peerbit"
8
+ },
9
+ "license": "Apache-2.0",
10
+ "type": "module",
11
+ "sideEffects": false,
12
+ "bin": {
13
+ "peerbit": "./dist/src/bin.js"
14
+ },
15
+ "module": "dist/src/index.js",
16
+ "types": "dist/src/index.d.ts",
17
+ "exports": {
18
+ "import": "./dist/src/index.js"
19
+ },
20
+ "browser": {
21
+ "./dist/src/server.js": "./dist/src/server.browser.js",
22
+ "./server.js": "./dist/src/server.browser.js",
23
+ "./dist/src/config.js": "./dist/src/config.browser.js",
24
+ "./config.js": "./dist/src/config.browser.js",
25
+ "./dist/src/remotes.js": "./dist/src/remotes.browser.js",
26
+ "./remotes.js": "./dist/src/remotes.browser.js",
27
+ "./dist/src/docker.js": "./dist/src/docker.browser.js",
28
+ "./docker.js": "./dist/src/docker.browser.js",
29
+ "./dist/src/aws.js": "./dist/src/aws.browser.js"
30
+ },
31
+ "files": [
32
+ "dist",
33
+ "src",
34
+ "src/nginx-template.conf",
35
+ "!src/test",
36
+ "!src/**/__tests__",
37
+ "!lib/**/__tests__",
38
+ "patches",
39
+ "LICENSE"
40
+ ],
41
+ "publishConfig": {
42
+ "access": "public"
43
+ },
44
+ "engines": {
45
+ "node": ">=18"
46
+ },
47
+ "eslintConfig": {
48
+ "extends": "peerbit",
49
+ "parserOptions": {
50
+ "project": true,
51
+ "sourceType": "module"
52
+ },
53
+ "ignorePatterns": [
54
+ "!.aegir.js",
55
+ "test/ts-use",
56
+ "*.d.ts"
57
+ ]
58
+ },
59
+ "scripts": {
60
+ "clean": "shx rm -rf lib/*",
61
+ "build": "pnpm run clean && pnpm run build-lib && pnpm run build-ui",
62
+ "build-lib": "tsc -p tsconfig.json",
63
+ "build-ui": "pnpm --dir ../frontend build",
64
+ "postbuild": "cp src/nginx-template.conf dist/src/ && cp -r ../frontend/dist/. dist/ui",
65
+ "test": "aegir test --t node",
66
+ "lint": "aegir lint"
67
+ },
68
+ "devDependencies": {
69
+ "@peerbit/test-lib": "0.0.1-d375893",
70
+ "@peerbit/test-utils": "2.2.10-d375893",
71
+ "@types/yargs": "17.0.24",
72
+ "aws-sdk": "^2.1259.0",
73
+ "dotenv": "^16.1.4",
74
+ "@types/tmp": "^0.2.3",
75
+ "@types/tar-stream": "^3.1.3",
76
+ "shx": "^0.3.4",
77
+ "@types/libsodium-wrappers": "^0.7.14",
78
+ "uuid": "^10.0.0"
79
+ },
80
+ "dependencies": {
81
+ "axios": "^1.4.0",
82
+ "chalk": "^5.3.0",
83
+ "peerbit": "4.3.9-d375893",
84
+ "yargs": "^17.7.2",
85
+ "tar-stream": "^3.1.7",
86
+ "tmp": "^0.2.1",
87
+ "tty-table": "^4.2.1",
88
+ "@libp2p/interface": "^3.0.0",
89
+ "@libp2p/crypto": "^5.1.10",
90
+ "@libp2p/peer-id": "^6.0.1",
91
+ "@libp2p/tcp": "^11.0.2",
92
+ "@libp2p/websockets": "^10.0.3",
93
+ "@multiformats/multiaddr": "^13.0.1",
94
+ "@peerbit/blocks": "3.0.15-d375893",
95
+ "@peerbit/crypto": "2.3.13-d375893",
96
+ "@peerbit/program": "5.3.5-d375893",
97
+ "@peerbit/pubsub": "4.0.18-d375893",
98
+ "@peerbit/time": "2.2.0-d375893",
99
+ "@dao-xyz/borsh": "^5.2.3",
100
+ "libsodium-wrappers": "^0.7.15",
101
+ "uint8arrays": "^5.1.0",
102
+ "level": "^10.0.0",
103
+ "memory-level": "^3.1.0",
104
+ "multiformats": "^13.4.1",
105
+ "abstract-level": "^3.1.0"
106
+ },
107
+ "optionalDependencies": {
108
+ "@aws-sdk/client-ec2": "^3.390.0",
109
+ "@aws-sdk/client-route-53": "^3.391.0"
110
+ }
91
111
  }
package/src/client.ts CHANGED
@@ -379,7 +379,17 @@ export const waitForDomain = async (
379
379
  const result = await waitForResolved(
380
380
  async () => {
381
381
  const addresses = await c.peer.addresses.get();
382
- const domain = multiaddr(addresses[0]).nodeAddress().address;
382
+ const first = addresses[0];
383
+ const ma = typeof first === "string" ? multiaddr(first) : first;
384
+ const hostComponent = ma
385
+ .getComponents()
386
+ .find(
387
+ (component) =>
388
+ component.value &&
389
+ (component.name.startsWith("dns") ||
390
+ component.name.startsWith("ip")),
391
+ );
392
+ const domain = hostComponent?.value;
383
393
  if (!domain) {
384
394
  throw new Error("Not ready");
385
395
  }
package/src/peerbit.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { privateKeyFromRaw } from "@libp2p/crypto/keys";
1
+ import { keys } from "@libp2p/crypto";
2
2
  import { DirectBlock } from "@peerbit/blocks";
3
3
  import type { Ed25519Keypair } from "@peerbit/crypto";
4
4
  import { DirectSub } from "@peerbit/pubsub";
@@ -18,7 +18,7 @@ export const create = (properties: {
18
18
  properties.directory != null
19
19
  ? path.join(properties.directory, "/blocks").toString()
20
20
  : undefined;
21
- const privateKey = privateKeyFromRaw(
21
+ const privateKey = keys.privateKeyFromRaw(
22
22
  concat([
23
23
  properties.keypair.privateKey.privateKey,
24
24
  properties.keypair.publicKey.publicKey,
@@ -62,7 +62,6 @@ export const create = (properties: {
62
62
  inboundStreamProtocolNegotiationTimeout: 1e4,
63
63
  inboundUpgradeTimeout: 1e4,
64
64
  outboundStreamProtocolNegotiationTimeout: 1e4,
65
- outboundUpgradeTimeout: 1e4,
66
65
  maxConnections: Infinity,
67
66
  reconnectRetries: 0, // https://github.com/libp2p/js-libp2p/issues/3289
68
67
  },