chore: update datastore usage in CONFIGURATION.md (#982)

Co-authored-by: Vasco Santos <vasco.santos@ua.pt>
This commit is contained in:
Leask Wong 2021-08-31 05:51:14 -04:00 committed by Vasco Santos
parent d3f78edffe
commit 97107c4ef7

View File

@ -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