Skip to content
This repository was archived by the owner on Mar 23, 2023. It is now read-only.

Commit 0ce8f01

Browse files
authored
chore: use ipfs 0.39 and repo 0.29 (#22)
1 parent c78598a commit 0ce8f01

File tree

3 files changed

+28
-29
lines changed

3 files changed

+28
-29
lines changed

examples/full-s3-repo/index.js

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,24 @@
33
const IPFS = require('ipfs')
44
const { createRepo } = require('datastore-s3')
55

6-
// Create the repo
7-
const s3Repo = createRepo({
8-
path: '/tmp/test/.ipfs'
9-
}, {
10-
bucket: 'my-bucket',
11-
accessKeyId: 'myaccesskey',
12-
secretAccessKey: 'mysecretkey'
13-
})
14-
15-
// Create a new IPFS node with our S3 backed Repo
16-
let node = new IPFS({
17-
repo: s3Repo
18-
})
19-
20-
console.log('Start the node')
21-
22-
// Test out the repo by sending and fetching some data
23-
node.on('ready', async () => {
24-
console.log('Ready')
6+
;(async () => {
7+
// Create the repo
8+
const s3Repo = createRepo({
9+
path: '/tmp/test/.ipfs'
10+
}, {
11+
bucket: 'my-bucket',
12+
accessKeyId: 'myaccesskey',
13+
secretAccessKey: 'mysecretkey'
14+
})
15+
16+
// Create a new IPFS node with our S3 backed Repo
17+
console.log('Start ipfs')
18+
const node = await IPFS.create({
19+
repo: s3Repo
20+
})
21+
22+
// Test out the repo by sending and fetching some data
23+
console.log('IPFS is ready')
2524

2625
try {
2726
const version = await node.version()
@@ -36,7 +35,7 @@ node.on('ready', async () => {
3635

3736
// Log out the added files metadata and cat the file from IPFS
3837
const data = await node.cat(filesAdded[0].hash)
39-
38+
4039
// Print out the files contents to console
4140
console.log(`\nFetched file content containing ${data.byteLength} bytes`)
4241
} catch (err) {
@@ -46,5 +45,5 @@ node.on('ready', async () => {
4645
// After everything is done, shut the node down
4746
// We don't need to worry about catching errors here
4847
console.log('\n\nStopping the node')
49-
return node.stop()
50-
})
48+
await node.stop()
49+
})()

examples/full-s3-repo/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
"author": "",
1111
"license": "ISC",
1212
"dependencies": {
13-
"aws-sdk": "^2.402.0",
13+
"aws-sdk": "^2.579.0",
1414
"datastore-s3": "../../",
15-
"ipfs": "~0.34.4",
16-
"ipfs-repo": "~0.26.1"
15+
"ipfs": "^0.39.0",
16+
"ipfs-repo": "~0.29.2"
1717
}
1818
}

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,18 +42,18 @@
4242
"upath": "^1.1.0"
4343
},
4444
"devDependencies": {
45-
"aegir": "^20.0.0",
46-
"aws-sdk": "^2.510.0",
45+
"aegir": "^20.4.1",
46+
"aws-sdk": "^2.579.0",
4747
"chai": "^4.2.0",
4848
"dirty-chai": "^2.0.1",
4949
"flow-bin": "^0.93.0",
5050
"flow-typed": "^2.5.1",
51-
"ipfs-repo": "^0.27.0",
51+
"ipfs-repo": "^0.29.2",
5252
"stand-in": "^4.2.0"
5353
},
5454
"peerDependencies": {
5555
"aws-sdk": "2.x",
56-
"ipfs-repo": "^0.27.0"
56+
"ipfs-repo": "^0.29.0"
5757
},
5858
"contributors": [
5959
"Andrew Nesbitt <[email protected]>",

0 commit comments

Comments
 (0)