mirror of
https://github.com/fluencelabs/js-libp2p
synced 2025-04-24 18:12:14 +00:00
chore: update datastore usage in CONFIGURATION.md (#982)
Co-authored-by: Vasco Santos <vasco.santos@ua.pt>
This commit is contained in:
parent
d3f78edffe
commit
97107c4ef7
@ -1,4 +1,4 @@
|
||||
# Configuration
|
||||
#
|
||||
|
||||
- [Configuration](#configuration)
|
||||
- [Overview](#overview)
|
||||
@ -503,6 +503,9 @@ const MPLEX = require('libp2p-mplex')
|
||||
const { NOISE } = require('libp2p-noise')
|
||||
const LevelStore = require('datastore-level')
|
||||
|
||||
const datastore = new LevelStore('path/to/store')
|
||||
await datastore.open()
|
||||
|
||||
const node = await Libp2p.create({
|
||||
modules: {
|
||||
transport: [TCP],
|
||||
@ -511,7 +514,7 @@ const node = await Libp2p.create({
|
||||
},
|
||||
keychain: {
|
||||
pass: 'notsafepassword123456789',
|
||||
datastore: new LevelStore('path/to/store')
|
||||
datastore: dsInstant,
|
||||
}
|
||||
})
|
||||
|
||||
@ -673,16 +676,18 @@ const Libp2p = require('libp2p')
|
||||
const TCP = require('libp2p-tcp')
|
||||
const MPLEX = require('libp2p-mplex')
|
||||
const { NOISE } = require('libp2p-noise')
|
||||
|
||||
const LevelStore = require('datastore-level')
|
||||
|
||||
const datastore = new LevelStore('path/to/store')
|
||||
const dsInstant = await datastore.open()
|
||||
|
||||
const node = await Libp2p.create({
|
||||
modules: {
|
||||
transport: [TCP],
|
||||
streamMuxer: [MPLEX],
|
||||
connEncryption: [NOISE]
|
||||
},
|
||||
datastore: new LevelStore('path/to/store'),
|
||||
datastore: dsInstant,
|
||||
peerStore: {
|
||||
persistence: true,
|
||||
threshold: 5
|
||||
|
Loading…
x
Reference in New Issue
Block a user