mirror of
https://github.com/fluencelabs/js-libp2p
synced 2025-04-24 18:12:14 +00:00
docs: peerstore configuration datastore fixed
This commit is contained in:
parent
a0516ebc85
commit
70a4bb9451
@ -675,15 +675,15 @@ const { NOISE } = require('libp2p-noise')
|
||||
const LevelDatastore = require('datastore-level')
|
||||
|
||||
const datastore = new LevelDatastore('path/to/store')
|
||||
const dsInstant = await datastore.open()
|
||||
await datastore.open() // level database must be ready before node boot
|
||||
|
||||
const node = await Libp2p.create({
|
||||
datastore, // pass the opened datastore
|
||||
modules: {
|
||||
transport: [TCP],
|
||||
streamMuxer: [MPLEX],
|
||||
connEncryption: [NOISE]
|
||||
},
|
||||
datastore: dsInstant,
|
||||
peerStore: {
|
||||
persistence: true,
|
||||
threshold: 5
|
||||
|
Loading…
x
Reference in New Issue
Block a user