Skip to content
This repository was archived by the owner on Jan 12, 2024. It is now read-only.

Commit edb49fd

Browse files
authored
fix: add missing dep (#59)
The `ipfs-core` dep was still `ipfs`
1 parent 28761a3 commit edb49fd

File tree

3 files changed

+150
-634
lines changed

3 files changed

+150
-634
lines changed

examples/custom-ipfs-repo/index.js

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,13 @@
11
'use strict'
22

33
const { create } = require('ipfs-core')
4-
const {
5-
createRepo,
6-
locks: {
7-
fs: fsLock
8-
}
9-
} = require('ipfs-repo')
4+
const { createRepo } = require('ipfs-repo')
5+
const FSLock = require('ipfs-repo/locks/fs')
106
const all = require('it-all')
117
const { fromString: uint8ArrayFromString } = require('uint8arrays/from-string')
128
const { concat: uint8ArrayConcat } = require('uint8arrays/concat')
13-
const DatastoreFS = require('datastore-fs')
14-
const BlockstoreDatastoreAdapter = require('blockstore-datastore-adapter')
9+
const { FsDatastore } = require('datastore-fs')
10+
const { BlockstoreDatastoreAdapter } = require('blockstore-datastore-adapter')
1511

1612
// multiformat codecs to support
1713
const codecs = [
@@ -46,31 +42,31 @@ async function main () {
4642
* you could store your keys in a levelDB database while everything else is in files.
4743
* See https://www.npmjs.com/package/interface-datastore for more about datastores.
4844
*/
49-
root: new DatastoreFS(path, {
45+
root: new FsDatastore(path, {
5046
extension: '.ipfsroot', // Defaults to '', appended to all files
5147
errorIfExists: false, // If the datastore exists, don't throw an error
5248
createIfMissing: true // If the datastore doesn't exist yet, create it
5349
}),
5450
// blocks is a blockstore, all other backends are datastores - but we can wrap a datastore
5551
// in an adapter to turn it into a blockstore
5652
blocks: new BlockstoreDatastoreAdapter(
57-
new DatastoreFS(`${path}/blocks`, {
53+
new FsDatastore(`${path}/blocks`, {
5854
extension: '.ipfsblock',
5955
errorIfExists: false,
6056
createIfMissing: true
6157
})
6258
),
63-
keys: new DatastoreFS(`${path}/keys`, {
59+
keys: new FsDatastore(`${path}/keys`, {
6460
extension: '.ipfskey',
6561
errorIfExists: false,
6662
createIfMissing: true
6763
}),
68-
datastore: new DatastoreFS(`${path}/datastore`, {
64+
datastore: new FsDatastore(`${path}/datastore`, {
6965
extension: '.ipfsds',
7066
errorIfExists: false,
7167
createIfMissing: true
7268
}),
73-
pins: new DatastoreFS(`${path}/pins`, {
69+
pins: new FsDatastore(`${path}/pins`, {
7470
extension: '.ipfspin',
7571
errorIfExists: false,
7672
createIfMissing: true
@@ -80,7 +76,7 @@ async function main () {
8076
* A custom lock can be added here. Or the build in Repo `fs` or `memory` locks can be used.
8177
* See https://github.com/ipfs/js-ipfs-repo for more details on setting the lock.
8278
*/
83-
lock: fsLock
79+
lock: FSLock
8480
}),
8581

8682
// This just means we dont try to connect to the network which isn't necessary

examples/custom-ipfs-repo/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@
1414
"dependencies": {
1515
"@ipld/dag-cbor": "^6.0.5",
1616
"@ipld/dag-pb": "^2.1.3",
17-
"blockstore-datastore-adapter": "^1.0.0",
18-
"datastore-fs": "^5.0.2",
19-
"ipfs": "^0.59.0",
20-
"ipfs-repo": "^12.0.0",
17+
"blockstore-datastore-adapter": "^2.0.3",
18+
"datastore-fs": "^6.0.1",
19+
"ipfs-core": "^0.11.1",
20+
"ipfs-repo": "^13.0.5",
2121
"it-all": "^1.0.4",
2222
"multiformats": "^9.4.1",
2323
"uint8arrays": "^3.0.0"

0 commit comments

Comments
 (0)