@helia/ipns 8.2.4 → 9.0.0-4d51f16d
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/README.md +31 -135
- package/dist/index.min.js +11 -11
- package/dist/index.min.js.map +4 -4
- package/dist/src/constants.d.ts +17 -0
- package/dist/src/constants.d.ts.map +1 -0
- package/dist/src/constants.js +19 -0
- package/dist/src/constants.js.map +1 -0
- package/dist/src/errors.d.ts +0 -4
- package/dist/src/errors.d.ts.map +1 -1
- package/dist/src/errors.js +0 -7
- package/dist/src/errors.js.map +1 -1
- package/dist/src/index.d.ts +131 -207
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +49 -416
- package/dist/src/index.js.map +1 -1
- package/dist/src/ipns/publisher.d.ts +29 -0
- package/dist/src/ipns/publisher.d.ts.map +1 -0
- package/dist/src/ipns/publisher.js +73 -0
- package/dist/src/ipns/publisher.js.map +1 -0
- package/dist/src/ipns/republisher.d.ts +30 -0
- package/dist/src/ipns/republisher.d.ts.map +1 -0
- package/dist/src/ipns/republisher.js +112 -0
- package/dist/src/ipns/republisher.js.map +1 -0
- package/dist/src/ipns/resolver.d.ts +26 -0
- package/dist/src/ipns/resolver.d.ts.map +1 -0
- package/dist/src/ipns/resolver.js +165 -0
- package/dist/src/ipns/resolver.js.map +1 -0
- package/dist/src/ipns.d.ts +20 -0
- package/dist/src/ipns.d.ts.map +1 -0
- package/dist/src/ipns.js +70 -0
- package/dist/src/ipns.js.map +1 -0
- package/dist/src/local-store.d.ts +42 -0
- package/dist/src/local-store.d.ts.map +1 -0
- package/dist/src/local-store.js +119 -0
- package/dist/src/local-store.js.map +1 -0
- package/dist/src/pb/metadata.d.ts +12 -0
- package/dist/src/pb/metadata.d.ts.map +1 -0
- package/dist/src/pb/metadata.js +57 -0
- package/dist/src/pb/metadata.js.map +1 -0
- package/dist/src/routing/index.d.ts +5 -3
- package/dist/src/routing/index.d.ts.map +1 -1
- package/dist/src/routing/index.js.map +1 -1
- package/dist/src/routing/local-store.d.ts +4 -19
- package/dist/src/routing/local-store.d.ts.map +1 -1
- package/dist/src/routing/local-store.js +7 -62
- package/dist/src/routing/local-store.js.map +1 -1
- package/dist/src/routing/pubsub.d.ts +21 -1
- package/dist/src/routing/pubsub.d.ts.map +1 -1
- package/dist/src/routing/pubsub.js +2 -2
- package/dist/src/routing/pubsub.js.map +1 -1
- package/dist/src/utils.d.ts +24 -0
- package/dist/src/utils.d.ts.map +1 -1
- package/dist/src/utils.js +56 -0
- package/dist/src/utils.js.map +1 -1
- package/package.json +21 -23
- package/src/constants.ts +24 -0
- package/src/errors.ts +0 -9
- package/src/index.ts +154 -548
- package/src/ipns/publisher.ts +97 -0
- package/src/ipns/republisher.ts +144 -0
- package/src/ipns/resolver.ts +217 -0
- package/src/ipns.ts +87 -0
- package/src/local-store.ts +162 -0
- package/src/pb/metadata.proto +9 -0
- package/src/pb/metadata.ts +74 -0
- package/src/routing/index.ts +5 -4
- package/src/routing/local-store.ts +9 -87
- package/src/routing/pubsub.ts +28 -4
- package/src/utils.ts +70 -0
- package/dist/src/dnslink.d.ts +0 -9
- package/dist/src/dnslink.d.ts.map +0 -1
- package/dist/src/dnslink.js +0 -138
- package/dist/src/dnslink.js.map +0 -1
- package/dist/typedoc-urls.json +0 -48
- package/src/dnslink.ts +0 -163
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@helia/ipns",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "9.0.0-4d51f16d",
|
|
4
4
|
"description": "An implementation of IPNS for Helia",
|
|
5
5
|
"license": "Apache-2.0 OR MIT",
|
|
6
6
|
"homepage": "https://github.com/ipfs/helia/tree/main/packages/ipns#readme",
|
|
@@ -56,13 +56,6 @@
|
|
|
56
56
|
"import": "./dist/src/routing/index.js"
|
|
57
57
|
}
|
|
58
58
|
},
|
|
59
|
-
"eslintConfig": {
|
|
60
|
-
"extends": "ipfs",
|
|
61
|
-
"parserOptions": {
|
|
62
|
-
"project": true,
|
|
63
|
-
"sourceType": "module"
|
|
64
|
-
}
|
|
65
|
-
},
|
|
66
59
|
"scripts": {
|
|
67
60
|
"clean": "aegir clean",
|
|
68
61
|
"lint": "aegir lint",
|
|
@@ -70,6 +63,7 @@
|
|
|
70
63
|
"doc-check": "aegir doc-check",
|
|
71
64
|
"build": "aegir build",
|
|
72
65
|
"docs": "aegir docs",
|
|
66
|
+
"generate": "protons ./src/pb/metadata.proto",
|
|
73
67
|
"test": "aegir test",
|
|
74
68
|
"test:chrome": "aegir test -t browser --cov",
|
|
75
69
|
"test:chrome-webworker": "aegir test -t webworker",
|
|
@@ -79,25 +73,29 @@
|
|
|
79
73
|
"test:electron-main": "aegir test -t electron-main"
|
|
80
74
|
},
|
|
81
75
|
"dependencies": {
|
|
82
|
-
"@helia/interface": "
|
|
83
|
-
"@libp2p/
|
|
84
|
-
"@libp2p/
|
|
85
|
-
"@libp2p/
|
|
86
|
-
"@libp2p/
|
|
87
|
-
"@
|
|
88
|
-
"
|
|
89
|
-
"
|
|
90
|
-
"
|
|
76
|
+
"@helia/interface": "6.0.0-4d51f16d",
|
|
77
|
+
"@libp2p/crypto": "^5.1.7",
|
|
78
|
+
"@libp2p/interface": "^3.0.2",
|
|
79
|
+
"@libp2p/kad-dht": "^16.0.5",
|
|
80
|
+
"@libp2p/keychain": "^6.0.5",
|
|
81
|
+
"@libp2p/logger": "^6.0.5",
|
|
82
|
+
"@libp2p/utils": "^7.0.5",
|
|
83
|
+
"interface-datastore": "^9.0.2",
|
|
84
|
+
"ipns": "^10.1.2",
|
|
85
|
+
"multiformats": "^13.4.1",
|
|
91
86
|
"progress-events": "^1.0.1",
|
|
87
|
+
"protons-runtime": "^5.5.0",
|
|
88
|
+
"uint8arraylist": "^2.4.8",
|
|
92
89
|
"uint8arrays": "^5.1.0"
|
|
93
90
|
},
|
|
94
91
|
"devDependencies": {
|
|
95
|
-
"@libp2p/crypto": "^5.
|
|
96
|
-
"@
|
|
97
|
-
"aegir": "^47.0.
|
|
98
|
-
"datastore-core": "^
|
|
99
|
-
"it-drain": "^3.0.
|
|
100
|
-
"
|
|
92
|
+
"@libp2p/crypto": "^5.1.12",
|
|
93
|
+
"@libp2p/peer-id": "^6.0.3",
|
|
94
|
+
"aegir": "^47.0.22",
|
|
95
|
+
"datastore-core": "^11.0.2",
|
|
96
|
+
"it-drain": "^3.0.10",
|
|
97
|
+
"protons": "^7.6.1",
|
|
98
|
+
"sinon": "^21.0.0",
|
|
101
99
|
"sinon-ts": "^2.0.0"
|
|
102
100
|
},
|
|
103
101
|
"browser": {
|
package/src/constants.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
const MINUTE = 60 * 1000
|
|
2
|
+
const HOUR = 60 * MINUTE
|
|
3
|
+
|
|
4
|
+
export const DEFAULT_LIFETIME_MS = 48 * HOUR
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The default DHT record expiry
|
|
8
|
+
*/
|
|
9
|
+
export const DHT_EXPIRY_MS = 48 * HOUR
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* How often to run the republish loop
|
|
13
|
+
*/
|
|
14
|
+
export const DEFAULT_REPUBLISH_INTERVAL_MS = HOUR
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Republish IPNS records when the expiry of our provider records is within this
|
|
18
|
+
* threshold
|
|
19
|
+
*/
|
|
20
|
+
export const REPUBLISH_THRESHOLD = 24 * HOUR
|
|
21
|
+
|
|
22
|
+
export const DEFAULT_TTL_NS = BigInt(MINUTE) * 5_000_000n // 5 minutes
|
|
23
|
+
|
|
24
|
+
export const DEFAULT_REPUBLISH_CONCURRENCY = 5
|
package/src/errors.ts
CHANGED
|
@@ -1,12 +1,3 @@
|
|
|
1
|
-
export class DNSLinkNotFoundError extends Error {
|
|
2
|
-
static name = 'DNSLinkNotFoundError'
|
|
3
|
-
|
|
4
|
-
constructor (message = 'DNSLink not found') {
|
|
5
|
-
super(message)
|
|
6
|
-
this.name = 'DNSLinkNotFoundError'
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
|
|
10
1
|
export class RecordsFailedValidationError extends Error {
|
|
11
2
|
static name = 'RecordsFailedValidationError'
|
|
12
3
|
|