@helia/ipns 10.0.8-e1cc85b9 → 10.1.0-16fc74d3
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 +11 -13
- package/dist/index.min.js +4 -4
- package/dist/index.min.js.map +3 -3
- package/dist/src/index.d.ts +11 -13
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +11 -13
- package/dist/src/index.js.map +1 -1
- package/dist/src/pb/ipns.d.ts +9 -9
- package/dist/src/pb/ipns.d.ts.map +1 -1
- package/dist/src/pb/ipns.js +24 -10
- package/dist/src/pb/ipns.js.map +1 -1
- package/dist/src/pb/metadata.d.ts +2 -2
- package/dist/src/pb/metadata.d.ts.map +1 -1
- package/dist/src/pb/metadata.js +17 -3
- package/dist/src/pb/metadata.js.map +1 -1
- package/package.json +4 -4
- package/src/index.ts +11 -13
- package/src/pb/ipns.ts +35 -19
- package/src/pb/metadata.ts +21 -5
package/README.md
CHANGED
|
@@ -133,25 +133,23 @@ may fail to be published with "Insufficient peers" errors.
|
|
|
133
133
|
|
|
134
134
|
```TypeScript
|
|
135
135
|
import { ipns, pubSubIPNSRouting } from '@helia/ipns'
|
|
136
|
-
import { withLibp2p
|
|
136
|
+
import { withLibp2p } from '@helia/libp2p'
|
|
137
137
|
import { unixfs } from '@helia/unixfs'
|
|
138
|
+
import { fetch } from '@libp2p/fetch'
|
|
138
139
|
import { floodsub } from '@libp2p/floodsub'
|
|
139
140
|
import { createHelia } from 'helia'
|
|
140
|
-
import type { Helia } from '@helia/interface'
|
|
141
|
-
import type { PubSub } from '@helia/ipns'
|
|
142
|
-
import type { DefaultLibp2pServices } from '@helia/libp2p'
|
|
143
|
-
import type { FloodSub } from '@libp2p/floodsub'
|
|
144
|
-
import type { Libp2p } from '@libp2p/interface'
|
|
145
141
|
|
|
146
|
-
const
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
142
|
+
const helia = await withLibp2p(createHelia(), {
|
|
143
|
+
services: {
|
|
144
|
+
fetch: fetch(),
|
|
145
|
+
pubsub: floodsub()
|
|
146
|
+
}
|
|
147
|
+
}).start()
|
|
150
148
|
|
|
151
149
|
const name = ipns(helia, {
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
150
|
+
routers: [
|
|
151
|
+
pubSubIPNSRouting(helia)
|
|
152
|
+
]
|
|
155
153
|
})
|
|
156
154
|
|
|
157
155
|
// store some data to publish
|