mirror of
https://github.com/orbitdb/orbitdb.git
synced 2025-03-30 15:08:28 +00:00
docs: Use Level Blockstore.
This commit is contained in:
parent
12d17b1ceb
commit
03f8a69856
@ -206,11 +206,13 @@ import { createLibp2p } from 'libp2p'
|
||||
import { createHelia } from 'helia'
|
||||
import { createOrbitDB, IPFSAccessController } from '@orbitdb/core'
|
||||
import { LevelBlockstore } from 'blockstore-level'
|
||||
import { LevelBlockstore } from 'blockstore-level'
|
||||
import { Libp2pOptions } from './config/libp2p.js'
|
||||
|
||||
const main = async () => {
|
||||
const blockstore = new LevelBlockstore('./ipfs')
|
||||
const libp2p = await createLibp2p(Libp2pOptions)
|
||||
const ipfs = await createHelia({ libp2p })
|
||||
const ipfs = await createHelia({ libp2p, blockstore })
|
||||
|
||||
// create a random directory to avoid OrbitDB conflicts.
|
||||
let randDir = (Math.random() + 1).toString(36).substring(2)
|
||||
|
Loading…
x
Reference in New Issue
Block a user