@helia/ipns 8.1.0 → 8.2.0
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 +23 -0
- package/dist/index.min.js +2 -72
- package/dist/src/index.d.ts +41 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +68 -4
- package/dist/src/index.js.map +1 -1
- package/dist/src/utils.d.ts +1 -0
- package/dist/src/utils.d.ts.map +1 -1
- package/dist/src/utils.js +1 -0
- package/dist/src/utils.js.map +1 -1
- package/dist/typedoc-urls.json +2 -0
- package/package.json +4 -4
- package/src/index.ts +91 -7
- package/src/utils.ts +2 -0
package/README.md
CHANGED
|
@@ -283,6 +283,29 @@ const name = ipns(node)
|
|
|
283
283
|
const result = await name.resolveDNSLink('ipfs.io')
|
|
284
284
|
```
|
|
285
285
|
|
|
286
|
+
## Example - Republishing an existing IPNS record
|
|
287
|
+
|
|
288
|
+
The `republishRecord` method allows you to republish an existing IPNS record without
|
|
289
|
+
needing the private key. This is useful for relay nodes or when you want to extend
|
|
290
|
+
the availability of a record that was created elsewhere.
|
|
291
|
+
|
|
292
|
+
```TypeScript
|
|
293
|
+
import { createHelia } from 'helia'
|
|
294
|
+
import { ipns } from '@helia/ipns'
|
|
295
|
+
import { createDelegatedRoutingV1HttpApiClient } from '@helia/delegated-routing-v1-http-api-client'
|
|
296
|
+
import { CID } from 'multiformats/cid'
|
|
297
|
+
|
|
298
|
+
const helia = await createHelia()
|
|
299
|
+
const name = ipns(helia)
|
|
300
|
+
|
|
301
|
+
const ipnsName = 'k51qzi5uqu5dktsyfv7xz8h631pri4ct7osmb43nibxiojpttxzoft6hdyyzg4'
|
|
302
|
+
const parsedCid: CID<unknown, 114, 0 | 18, 1> = CID.parse(ipnsName)
|
|
303
|
+
const delegatedClient = createDelegatedRoutingV1HttpApiClient('https://delegated-ipfs.dev')
|
|
304
|
+
const record = await delegatedClient.getIPNS(parsedCid)
|
|
305
|
+
|
|
306
|
+
await name.republishRecord(ipnsName, record)
|
|
307
|
+
```
|
|
308
|
+
|
|
286
309
|
# Install
|
|
287
310
|
|
|
288
311
|
```console
|