mirror of
https://github.com/orbitdb/orbitdb.git
synced 2025-03-30 15:08:28 +00:00
Merge pull request #1171 from orbitdb/docs/blockstore-config
docs: Randomize blockstore location.
This commit is contained in:
commit
0550a44949
@ -27,7 +27,7 @@ then instantiate and pass to Helia:
|
||||
```
|
||||
import { LevelBlockstore } from 'blockstore-level'
|
||||
|
||||
const blockstore = new LevelBlockstore('./ipfs')
|
||||
const blockstore = new LevelBlockstore('./ipfs/blocks')
|
||||
const ipfs = createHelia({ blockstore })
|
||||
```
|
||||
|
||||
@ -117,7 +117,7 @@ import { LevelBlockstore } from 'blockstore-level'
|
||||
import { Libp2pOptions } from './config/libp2p.js'
|
||||
|
||||
// Create an IPFS instance.
|
||||
const blockstore = new LevelBlockstore('./ipfs')
|
||||
const blockstore = new LevelBlockstore('./ipfs/blocks')
|
||||
const libp2p = await createLibp2p(Libp2pOptions)
|
||||
const ipfs = await createHelia({ libp2p, blockstore })
|
||||
|
||||
@ -207,13 +207,13 @@ import { createOrbitDB, IPFSAccessController } from '@orbitdb/core'
|
||||
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, blockstore })
|
||||
|
||||
const main = async () => {
|
||||
// create a random directory to avoid OrbitDB conflicts.
|
||||
let randDir = (Math.random() + 1).toString(36).substring(2)
|
||||
|
||||
const blockstore = new LevelBlockstore(`./${randDir}/ipfs/blocks`)
|
||||
const libp2p = await createLibp2p(Libp2pOptions)
|
||||
const ipfs = await createHelia({ libp2p, blockstore })
|
||||
|
||||
const orbitdb = await createOrbitDB({ ipfs, directory: `./${randDir}/orbitdb` })
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user