@helia/ipns 10.2.0 → 10.2.1-bdbda7ae
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 +8 -8
- package/dist/index.min.js +9 -9
- package/dist/index.min.js.map +4 -4
- package/dist/src/pb/ipns.d.ts +14 -3
- package/dist/src/pb/ipns.d.ts.map +1 -1
- package/dist/src/pb/ipns.js +28 -28
- package/dist/src/pb/ipns.js.map +1 -1
- package/dist/src/pb/metadata.d.ts +8 -3
- package/dist/src/pb/metadata.d.ts.map +1 -1
- package/dist/src/pb/metadata.js +16 -16
- package/dist/src/pb/metadata.js.map +1 -1
- package/package.json +4 -4
- package/src/pb/ipns.ts +45 -33
- package/src/pb/metadata.ts +27 -21
- package/dist/typedoc-urls.json +0 -90
package/README.md
CHANGED
|
@@ -169,10 +169,11 @@ for await (const result of name.resolve(publicKey)) {
|
|
|
169
169
|
|
|
170
170
|
It is sometimes useful to be able to republish an existing IPNS record
|
|
171
171
|
without needing the private key. This allows you to extend the availability
|
|
172
|
-
of a record that was created elsewhere
|
|
172
|
+
of a record that was created elsewhere: use `import` to store the record
|
|
173
|
+
locally, then `republish` to broadcast it and keep it alive.
|
|
173
174
|
|
|
174
|
-
There should be only one republisher per IPNS key
|
|
175
|
-
republishing the same key flood the routers with redundant writes.
|
|
175
|
+
> **There should be only one republisher per IPNS key.** Multiple machines
|
|
176
|
+
> republishing the same key flood the routers with redundant writes.
|
|
176
177
|
|
|
177
178
|
```TypeScript
|
|
178
179
|
import { createHelia } from 'helia'
|
|
@@ -193,13 +194,12 @@ const delegatedClient = delegatedRoutingV1HttpApiClient({
|
|
|
193
194
|
})
|
|
194
195
|
const record = await delegatedClient.getIPNS(parsedCid)
|
|
195
196
|
|
|
196
|
-
//
|
|
197
|
-
// but does not publish it to the routers)
|
|
197
|
+
// bring the record fetched from elsewhere into the local store
|
|
198
198
|
await name.import(parsedCid, record)
|
|
199
199
|
|
|
200
|
-
//
|
|
201
|
-
// already
|
|
202
|
-
|
|
200
|
+
// republish the imported record and keep it alive. Throws
|
|
201
|
+
// RecordObsoleteError if the routing already has a newer record
|
|
202
|
+
await name.republish(parsedCid)
|
|
203
203
|
|
|
204
204
|
// stop republishing a key
|
|
205
205
|
await name.unpublish(parsedCid)
|