Create a Helia node.
import { MemoryDatastore } from 'datastore-core'
import { MemoryBlockstore } from 'blockstore-core'
import { createHelia } from 'helia'
import { unixfs } from '@helia/unixfs'
import { CID } from 'multiformats/cid'
const node = await createHelia({
blockstore: new MemoryBlockstore(),
datastore: new MemoryDatastore()
})
const fs = unixfs(node)
fs.cat(CID.parse('bafyFoo'))
Function | Description |
---|---|
createHelia(init) | Create and return a Helia node |
createHelia(init) |
Interface | Description |
---|---|
DAGWalker | DAGWalkers take a block and yield CIDs encoded in that block |
HeliaInit | Options used to create a Helia node. |