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

chore: use ipfs 0.39 and repo 0.29 #22

Merged
merged 1 commit into from
Nov 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
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
43 changes: 21 additions & 22 deletions examples/full-s3-repo/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,24 @@
const IPFS = require('ipfs')
const { createRepo } = require('datastore-s3')

// Create the repo
const s3Repo = createRepo({
path: '/tmp/test/.ipfs'
}, {
bucket: 'my-bucket',
accessKeyId: 'myaccesskey',
secretAccessKey: 'mysecretkey'
})

// Create a new IPFS node with our S3 backed Repo
let node = new IPFS({
repo: s3Repo
})

console.log('Start the node')

// Test out the repo by sending and fetching some data
node.on('ready', async () => {
console.log('Ready')
;(async () => {
// Create the repo
const s3Repo = createRepo({
path: '/tmp/test/.ipfs'
}, {
bucket: 'my-bucket',
accessKeyId: 'myaccesskey',
secretAccessKey: 'mysecretkey'
})

// Create a new IPFS node with our S3 backed Repo
console.log('Start ipfs')
const node = await IPFS.create({
repo: s3Repo
})

// Test out the repo by sending and fetching some data
console.log('IPFS is ready')

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

// Log out the added files metadata and cat the file from IPFS
const data = await node.cat(filesAdded[0].hash)

// Print out the files contents to console
console.log(`\nFetched file content containing ${data.byteLength} bytes`)
} catch (err) {
Expand All @@ -46,5 +45,5 @@ node.on('ready', async () => {
// After everything is done, shut the node down
// We don't need to worry about catching errors here
console.log('\n\nStopping the node')
return node.stop()
})
await node.stop()
})()
6 changes: 3 additions & 3 deletions examples/full-s3-repo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
"author": "",
"license": "ISC",
"dependencies": {
"aws-sdk": "^2.402.0",
"aws-sdk": "^2.579.0",
"datastore-s3": "../../",
"ipfs": "~0.34.4",
"ipfs-repo": "~0.26.1"
"ipfs": "^0.39.0",
"ipfs-repo": "~0.29.2"
}
}
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,18 @@
"upath": "^1.1.0"
},
"devDependencies": {
"aegir": "^20.0.0",
"aws-sdk": "^2.510.0",
"aegir": "^20.4.1",
"aws-sdk": "^2.579.0",
"chai": "^4.2.0",
"dirty-chai": "^2.0.1",
"flow-bin": "^0.93.0",
"flow-typed": "^2.5.1",
"ipfs-repo": "^0.27.0",
"ipfs-repo": "^0.29.2",
"stand-in": "^4.2.0"
},
"peerDependencies": {
"aws-sdk": "2.x",
"ipfs-repo": "^0.27.0"
"ipfs-repo": "^0.29.0"
},
"contributors": [
"Andrew Nesbitt <[email protected]>",
Expand Down