storj-mongodb-adapterdeprecated

a storj-lib compatible storage adapter for mongodb

Usage no npm install needed!

<script type="module">
  import storjMongodbAdapter from 'https://cdn.skypack.dev/storj-mongodb-adapter';
</script>

README

MongoDB Storage Adapter

Build Status

A storj-lib compatible storage adapter for MongoDB, primarily used by storj-bridge.

Prerequisites

  • MongoDB
  • Storj Core

Installation

npm install storj-mongodb-adapter --save

Usage

var storj = require('storj-lib');
var MongoStorageAdapter = require('storj-mongo-adapter');
var mongoose = require('mongoose');

mongoose.connect('mongodb://localhost/dbname', function() {
  var adapter = new MongoStorageAdapter(mongoose);
  var manager = new storj.StorageManager(adapter);
  var renter = new storj.RenterInterface({
    storageManager: manager,
    // ...
  });

  // That's it! The `renter` object now uses MongoDB to store
  // contract data!
});

License

This software is licensed under the terms of the GNU Lesser General Public License, version 3 or later.