mirror of
https://github.com/fluencelabs/js-libp2p
synced 2025-06-28 16:31:35 +00:00
docs: peerstore configuration datastore fixed
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user