Skip to content
This repository was archived by the owner on Aug 11, 2021. It is now read-only.
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -356,9 +356,24 @@ class IPLDResolver {
* @returns {void}
*/
IPLDResolver.inMemory = function (callback) {
const Memdown = require('memdown')
const repo = new IPFSRepo('in-memory', {
fs: MemoryStore,
level: require('memdown'),
storageBackends: {
root: MemoryStore,
blocks: MemoryStore,
datastore: MemoryStore
},
storageBackendOptions: {
root: {
db: Memdown
},
blocks: {
db: Memdown
},
datastore: {
db: Memdown
}
},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pgte is this correct?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@diasdavid looks like it. I think that, for the tests, it doesn't make a difference whether we use an extension or sharing. Wouldn't you agree?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and that, generally, without persistence, these options would be enough..

lock: 'memory'
})
const blockService = new BlockService(repo)
Expand Down