An abstract-blob-store compatible implementation built using IPFS as the storage backend
JavaScript
Latest commit 022c443 Oct 27, 2016 @diasdavid diasdavid 1.1.2

README.md

ipfs-blob-store

standard-readme compliant Build Status Dependency Status js-standard-style

An abstract-blob-store compatible implementation built using IPFS as the storage backend

Implements the abstract-blob-store, using IPFS for storage.

Install

npm install ipfs-blob-store

Usage

ipfs-blob-store today requires a running IPFS daemon to talk to over HTTP. This module will be able to be entirely self-contained once js-ipfs is complete.

ipfs-blob-store uses the IPFS Files API to create the abstraction of a mutable filesystem over snapshots of Merkle DAGs (per mutation). You'll need to use the Files API directly to get the /ipfs/Qm... address of the filesystem root so that other IPFS nodes can retrieve it.

var ipfsBlobStore = require('ipfs-blob-store')

var options = {
  port: 5001,   // default value
  host: '127.0.0.1', // default value
  baseDir: '/', // default value
  flush: true  // default value
}

var store = ipfsBlobStore(options)

var ws = store.createWriteStream({
  key: 'some/path/file.txt'
})

ws.write('hello world\n')
ws.end(function() {
  var rs = store.createReadStream({
    key: 'some/path/file.txt'
  })

  rs.pipe(process.stdout)
})

Contribute

Feel free to join in. All welcome. Open an issue!

This repository falls under the IPFS Code of Conduct.

Want to hack on IPFS?

License

MIT