2016-11-29 13:34:55 +01:00
2016-11-25 17:28:42 +01:00
2016-11-25 16:56:17 +01:00
2016-10-05 10:35:50 +02:00
2016-10-04 19:07:31 +02:00
2016-11-03 09:35:52 +01:00
2016-11-02 14:27:27 +01:00
2016-10-04 19:07:33 +02:00
2016-10-04 19:07:31 +02:00
2016-03-10 17:00:45 +01:00
2016-11-26 14:26:56 +01:00
2016-11-25 15:40:49 +01:00
2016-11-25 15:40:49 +01:00
2016-11-15 09:08:46 +01:00

orbit-db

npm version CircleCI Status Project Status

Distributed, peer-to-peer database on IPFS.

orbit-db is a serverless, distributed, peer-to-peer database. orbit-db uses IPFS as its data storage and IPFS Pubsub to automatically sync databases with peers. It's an eventually consistent database that uses CRDTs for conflict-free database merges making orbit-db and excellent choice for offline-first applications.

Data in orbit-db can be stored in a

This is the Javascript implementation and it works both in Node.js and Browsers.

Table of Contents

Usage

Note that to run this example, you need to have an IPFS daemon, started with --enable-pubsub-experiment, running at localhost:5001

npm install orbit-db ipfs-api@https://github.com/haadcode/js-ipfs-api.git
const IpfsApi = require('ipfs-api')
const OrbitDB = require('orbit-db')

const ipfs = IpfsApi('localhost', '5001')
const orbitdb = new OrbitDB(ipfs)

const db = orbitdb.eventlog("feed name")

db.add("hello world")
  .then(() => {
    const latest = db.iterator({ limit: 5 }).collect()
    console.log(JSON.stringify(latest, null, 2))
  })

For more details, see examples for kvstore, eventlog, feed, docstore and counter.

API

See API documentation for the full documentation.

Examples

Install dependencies

git clone https://github.com/haadcode/orbit-db.git
cd orbit-db
npm install

Browser example

npm run build:examples
npm run examples:browser

Check the code in examples/browser/browser.html.

Node.js example

npm run examples:node

Eventlog

Check the code in examples/eventlog.js and run it with:

LOG=debug node examples/eventlog.js

Key-Value

Check the code in examples/keyvalue.js and run it with:

LOG=debug node examples/keyvalue.js

Development

Run Tests

npm test

Build

npm run build

Benchmark

node examples/benchmark.js

Background

Check out a visualization of the data flow at https://github.com/haadcode/proto2 or a live demo: http://celebdil.benet.ai:8080/ipfs/Qmezm7g8mBpWyuPk6D84CNcfLKJwU6mpXuEN5GJZNkX3XK/.

TODO

  • list of modules used
  • orbit-db-pubsub
  • crdts
  • ipfs-log

Contributing

I would be happy to accept PRs! If you want to work on something, it'd be good to talk beforehand to make sure nobody else is working on it. You can reach me on Twitter @haadcode or on IRC #ipfs on Freenode, or in the comments of the issues section.

A good place to start are the issues labelled "help wanted" or the project's status board.

License

MIT ©️ 2016 Haadcode

Description
No description provided
Readme 11 MiB
Languages
JavaScript 94.2%
HTML 5.4%
Makefile 0.3%
Dockerfile 0.1%