@helia/ipns 10.0.8 → 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 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, libp2pDefaults } from '@helia/libp2p'
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 libp2pOptions = libp2pDefaults() as any
147
- libp2pOptions.services.pubsub = floodsub()
148
-
149
- const helia = await withLibp2p<Helia, { pubsub: FloodSub }>(createHelia(), libp2pOptions).start()
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
- routers: [
153
- pubSubIPNSRouting(helia)
154
- ]
150
+ routers: [
151
+ pubSubIPNSRouting(helia)
152
+ ]
155
153
  })
156
154
 
157
155
  // store some data to publish