Skip to content

Commit

Permalink
chore: update datastore usage in CONFIGURATION.md (#982)
Browse files Browse the repository at this point in the history
Co-authored-by: Vasco Santos <vasco.santos@ua.pt>
  • Loading branch information
Leask and vasco-santos committed Aug 31, 2021
1 parent d3f78ed commit 97107c4
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions doc/CONFIGURATION.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Configuration
#

- [Configuration](#configuration)
- [Overview](#overview)
Expand Down Expand Up @@ -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],
Expand All @@ -511,7 +514,7 @@ const node = await Libp2p.create({
},
keychain: {
pass: 'notsafepassword123456789',
datastore: new LevelStore('path/to/store')
datastore: dsInstant,
}
})

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 97107c4

Please sign in to comment.