Peer-to-Peer Databases for the Decentralized Web

Overview

OrbitDB

Gitter Matrix CircleCI Status npm version node

OrbitDB is a serverless, distributed, peer-to-peer database. OrbitDB 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 OrbitDB an excellent choice for decentralized apps (dApps), blockchain applications and offline-first web applications.

Test it live at Live demo 1, Live demo 2, or P2P TodoMVC app!

OrbitDB provides various types of databases for different data models and use cases:

  • log: an immutable (append-only) log with traversable history. Useful for "latest N" use cases or as a message queue.
  • feed: a mutable log with traversable history. Entries can be added and removed. Useful for "shopping cart" type of use cases, or for example as a feed of blog posts or "tweets".
  • keyvalue: a key-value database just like your favourite key-value database.
  • docs: a document database to which JSON documents can be stored and indexed by a specified key. Useful for building search indices or version controlling documents and data.
  • counter: Useful for counting events separate from log/feed data.

All databases are implemented on top of ipfs-log, an immutable, operation-based conflict-free replicated data structure (CRDT) for distributed systems. If none of the OrbitDB database types match your needs and/or you need case-specific functionality, you can easily implement and use a custom database store of your own.

Project status & support

  • Status: in active development
  • Compatible with js-ipfs versions <= 0.52 and go-ipfs versions <= 0.6.0

NOTE! OrbitDB is alpha-stage software. It means OrbitDB hasn't been security audited and programming APIs and data formats can still change. We encourage you to reach out to the maintainers if you plan to use OrbitDB in mission critical systems.

This is the Javascript implementation and it works both in Browsers and Node.js with support for Linux, OS X, and Windows. LTS versions (even numbered versions 8, 10, etc) are supported.

To use with older versions of Node.js, we provide an ES5-compatible build through the npm package, located in dist/es5/ when installed through npm.

Table of Contents

Usage

Read the GETTING STARTED guide for a quick tutorial on how to use OrbitDB.

For a more in-depth tutorial and exploration of OrbitDB's architecture, please check out the OrbitDB Field Manual.

Database browser UI

OrbitDB databases can easily be managed using a web UI, see OrbitDB Control Center.

Install and run it locally:

git clone https://github.com/orbitdb/orbit-db-control-center.git
cd orbit-db-control-center/
npm i && npm start

Module with IPFS Instance

If you're using orbit-db to develop browser or Node.js applications, use it as a module with the javascript instance of IPFS

Install dependencies:

npm install orbit-db ipfs
const IPFS = require('ipfs')
const OrbitDB = require('orbit-db')

// For js-ipfs >= 0.38

// Create IPFS instance
const initIPFSInstance = async () => {
  return await IPFS.create({ repo: "./path-for-js-ipfs-repo" });
};

initIPFSInstance().then(async ipfs => {
  const orbitdb = await OrbitDB.createInstance(ipfs);

  // Create / Open a database
  const db = await orbitdb.log("hello");
  await db.load();

  // Listen for updates from peers
  db.events.on("replicated", address => {
    console.log(db.iterator({ limit: -1 }).collect());
  });

  // Add an entry
  const hash = await db.add("world");
  console.log(hash);

  // Query
  const result = db.iterator({ limit: -1 }).collect();
  console.log(JSON.stringify(result, null, 2));
});


// For js-ipfs < 0.38

// Create IPFS instance
const ipfsOptions = {
    EXPERIMENTAL: {
      pubsub: true
    }
  };

ipfs = new IPFS(ipfsOptions);

initIPFSInstance().then(ipfs => {
  ipfs.on("error", e => console.error(e));
  ipfs.on("ready", async () => {
    const orbitdb = await OrbitDB.createInstance(ipfs);

    // Create / Open a database
    const db = await orbitdb.log("hello");
    await db.load();

    // Listen for updates from peers
    db.events.on("replicated", address => {
      console.log(db.iterator({ limit: -1 }).collect());
    });

    // Add an entry
    const hash = await db.add("world");
    console.log(hash);

    // Query
    const result = db.iterator({ limit: -1 }).collect();
    console.log(JSON.stringify(result, null, 2));
  });
});

Module with IPFS Daemon

Alternatively, you can use ipfs-http-client to use orbit-db with a locally running IPFS daemon. Use this method if you're using orbitd-db to develop backend or desktop applications, eg. with Electron.

Install dependencies:

npm install orbit-db ipfs-http-client
const IpfsClient = require('ipfs-http-client')
const OrbitDB = require('orbit-db')

const ipfs = IpfsClient('localhost', '5001')

const orbitdb = await OrbitDB.createInstance(ipfs)
const db = await orbitdb.log('hello')
// Do something with your db.
// Of course, you may want to wrap these in an async function.

API

See API.md for the full documentation.

Examples

Install dependencies

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

Some dependencies depend on native addon modules, so you'll also need to meet node-gyp's installation prerequisites. Therefore, Linux users may need to

make clean-dependencies && make deps

to redo the local package-lock.json with working native dependencies.

Browser example

npm run build
npm run examples:browser

Using Webpack:

npm run build
npm run examples:browser-webpack

Check the code in examples/browser/browser.html and try the live example.

Node.js example

npm run examples:node

Eventlog

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

node examples/eventlog.js

Workshop

We have a field manual which has much more detailed examples and a run-through of how to understand OrbitDB, at orbitdb/field-manual. There is also a workshop you can follow, which shows how to build an app, at orbit-db/web3-workshop.

More examples at examples.

Packages

OrbitDB uses the following modules:

OrbitDB Store Packages

To understand a little bit about the architecture, 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/.

Community-maintained Typescript typings are available here: https://github.com/orbitdb/orbit-db-types

Development

Run Tests

npm test

Build

npm run build

Benchmark

node benchmarks/benchmark-add.js

See benchmarks/ for more benchmarks.

Logging

To enable OrbitDB's logging output, set a global ENV variable called LOG to debug,warn or error:

LOG=debug node <file>

Frequently Asked Questions

We have an FAQ! Go take a look at it. If a question isn't there, open an issue and suggest adding it. We can work on the best answer together.

Are there implementations in other languages?

Yes! Take a look at these implementations:

The best place to find out what is out there and what is being actively worked on is likely by asking in the Gitter. If you know of any other repos that ought to be included in this section, please open a PR and add them.

Contributing

Take a look at our organization-wide Contributing Guide. You'll find most of your questions answered there. Some questions may be answered in the FAQ, as well.

As far as code goes, we 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 us on Gitter, or in the issues section.

If you want to code but don't know where to start, check out the issues labelled "help wanted".

Please note that we have a Code of Conduct, and that all activity in the @orbitdb organization falls under it. Read it when you get the chance, as being part of this community means that you agree to abide by it. Thanks.

Sponsors

The development of OrbitDB has been sponsored by:

If you want to sponsor developers to work on OrbitDB, please reach out to @haadcode.

License

MIT © 2015-2019 Protocol Labs Inc., Haja Networks Oy

Comments
  • typescript typings

    typescript typings

    I created some basic typescript typings. they don't have comments and some of the values/methods/classes are missing but it's better than nothing :+1: @types.zip

    opened by m00nwtchr 31
  • docs: Add TOCs using an npm script

    docs: Add TOCs using an npm script

    This is a stab at making #426 work automatically, so that we don't need to manually adjust the files. I've also edited some of the depths of the headings. What do you think, @mistakia?

    One thing I would like is to add this to the build. It shouldn't change anything if there are no changes to make.

    enhancement docs 
    opened by RichardLitt 27
  • Monorepo approach

    Monorepo approach

    I've been exploring the codebase the last few days and I constantly find myself jumping between different repos, that's not a problem, not at all. But maybe the monorepo approach could be interesting for orbit? (https://github.com/babel/babel/blob/master/doc/design/monorepo.md)

    opened by thiagodelgado111 26
  • Start a community call

    Start a community call

    Having talked to several people about this privately, it seems that there's interest to do a bi-/weekly community call for OrbitDB to discuss progress, ask questions and general get together.

    Let's try to make it a fixed time every week taking into consideration All The Timezones, which I suppose means sometime between 3pm to 5pm or similar. Another thing to consider is that many OS teams seem to have weekly calls on Monday's and people might have scheduling conflicts, so we should be considerate of that too.

    Would love to hear who's interested to join on (semi-)regular basis and what the preferred times are?

    Would Monday be a good day, or should we consider Tuesday or Wednesday?

    Should we do a weekly or bi-weekly call?

    meta 
    opened by haadcode 23
  • Electron apps syncing simple db between each other

    Electron apps syncing simple db between each other

    I'm a bit confused what I need to do here to have several electron apps communicate with each other, and syncing a simple key-value db. Essentially any app could add or modify the contents of the DB over a local network.

    I've created a local DB in one of the apps using orbit-db and ipfs, but I'm not sure how to connect two. In the getting started guide in the replication section (https://github.com/orbitdb/orbit-db/blob/master/GUIDE.md#replicating-a-database) there seem to be an assumtion, that there's a "master" DB, which is replicated by the second DB, which is not what I want.

    Essentially these apps would need to automatically discover each other, and just sync automatically, without having a "master" that all others replicate.

    Another thing that confused me is this the "ipfs daemon" (https://github.com/orbitdb/orbit-db#module-with-ipfs-daemon) which seems to be recommended for electron apps, but I'm not sure what the difference is between this and my first approach which just using the ipfs module.

    I'm sure I just need to do my research, I just feel like I don't know where to look. 😅

    opened by ZeeCoder 19
  • Support write-permissioned databases

    Support write-permissioned databases

    The goal here is to add write-permissioned databases to OrbitDB. It'll mean that we can have per-user databases or define a set of keys that can write to a given database.

    enhancement 
    opened by haadcode 19
  • ./orbitdb/identity/identitykeys/LOCK: already held by process

    ./orbitdb/identity/identitykeys/LOCK: already held by process

    Hi. I am developing node.js server application. Some data from queries I put in orbitdb. When the server receives many queries, I can see the following error:

    UnhandledPromiseRejectionWarning: OpenError: IO error: lock ./orbitdb/identity/identitykeys/LOCK: already held by process

    at .../node_modules/levelup/lib/levelup.js:87:23
    at .../node_modules/abstract-leveldown/abstract-leveldown.js:30:14
    at .../node_modules/deferred-leveldown/deferred-leveldown.js:20:21
    at .../node_modules/leveldown/node_modules/abstract-leveldown/abstract-leveldown.js:41:14
    

    Library versions: "orbit-db": "^0.21.0-rc.1" "orbit-db-identity-provider": "^0.1.2-rc.1.2" "ipfs": "^0.35.0" "ipfs-http-client": "^30.1.3"

    opened by alexander-lipnitskiy 15
  • How to create a database from a known address

    How to create a database from a known address

    In all your examples, you create a new IPFS and OrbitDB instance. I would like to replicate your Live Demo 1, but I am not sure how to refer to an existing address when a client want to access a known database.

    I guess I need to call new OrbitDB (or IPFS) with an optional parameters that indicate the address? I couldn't find it anywhere...

    Thanks!

    opened by AlessandroChecco 15
  • Replication issue

    Replication issue

    When I add something from machine A where IPFS is running , it gets replicated to machine B where i i am running the code and opening database using address.

    When I add something from Machine B, it does't get replicated in machine A unless I restart the code. Restarting the code on machine A makes the replication works.

    Anything I am missing here?

    opened by shaikh-shahid 14
  • OrbitDB p2p failed on Google Cloud VM Ubuntu16.04 with 2 VM

    OrbitDB p2p failed on Google Cloud VM Ubuntu16.04 with 2 VM

    HI I was able to run the orbit db in Ubuntu 16.04.... but failed to make 2VM Peer to Peer working. Please find the attachment.

    My first node is run with firstOrbitDbHost.js with internal IP 10.128.0.3 From netstat, the program is listening to 4002 and 4003.... I enabled firewall for those ports. firstOrbitDbHost only create a keystore db and insert value pair of name - hello hosted with address: /orbitdb/QmcswCMgT6qrDtpCRUZGVdcFy7n6Ax2cMcRTiUaBgSQpBK/first-database

    Then, I run the second PeerOrbitDb.js in another vm with internal IP 10.128.0.4 It open the DB with const db = await orbitdb.keyvalue("/orbitdb/QmcswCMgT6qrDtpCRUZGVdcFy7n6Ax2cMcRTiUaBgSQpBK/first-database")

    However, from the log, PeerOrbitDb only listen to Swarm listening on /ip4/127.0.0.1/tcp/4003/ws/ipfs/QmU8xnHDiRJ3tGvRS3d3LxLNZXNmUjSwiHGziwobA7BKrJ Swarm listening on /ip4/127.0.0.1/tcp/4002/ipfs/QmU8xnHDiRJ3tGvRS3d3LxLNZXNmUjSwiHGziwobA7BKrJ Swarm listening on /ip4/10.128.0.4/tcp/4002/ipfs/QmU8xnHDiRJ3tGvRS3d3LxLNZXNmUjSwiHGziwobA7BKrJ

    But not 10.128.0.3....

    The 2 VM run local independently.... Is there something wrong with my API call? I expect the PeerOrbitDb run the data extraction after replication completed. But, replicated event never appear......

    Archive 2.zip

    opened by dexterchan 14
  • TypeError: exists is not a function

    TypeError: exists is not a function

    Hi, It seems that in 'orbit-db-cache' you require 'level', which in turn requires 'node-bindings'. 'node-bindings' has a bug and returns the above error in a clean orbit-db install.

    Luckily it seems they fixed it: https://github.com/TooTallNate/node-bindings/pull/20 + https://github.com/Level/level/issues/34

    It might be just a matter of updating the version of level? Right now, installing orbit-db and importing it dies.

    opened by cristiano-belloni 14
  • Orbitdb failed to work on azure vm

    Orbitdb failed to work on azure vm

    Hi All,

    I am using orbit-db and ipfs with below versions "ipfs": "^0.46.0", "orbit-db": "^0.24.1"

    the below code works fine in windows machine with following configurations Processor: Intel(R) Core(TM) i5-5300U CPU @ 2.30GHz 2.29 GHz RAM: 8.00 GB (7.89 GB usable) ` const IPFS = require('ipfs') const OrbitDB = require('orbit-db') const Identities = require('orbit-db-identity-provider')

    // optional settings for the ipfs instance const ipfsOptions = { EXPERIMENTAL: { pubsub: true }, }

    const options = { id: 'test1' }

    async function main() { const ipfs = await IPFS.create(ipfsOptions) //console.log('ipfs', ipfs)

    const identity = await Identities.createIdentity(options) const orbitdb = await OrbitDB.createInstance(ipfs, { identity: identity }) //console.log('orbitdb', orbitdb)

    //create KV database // const db1 = await orbitdb.docstore('test-utm-db') // console.log(db1.address.toString())

    const optionsToWrite = { accessController: { type: 'orbitdb', //OrbitDBAccessController write: [orbitdb.identity.id, '049ed262ac058f91794e2e822868758c9d270bb1f057a541dcb97ce19a0cb96c25c5a5dade728b2de35d98c3ac7b4696ca0bc768aee141dabf2c78a13a6631171b'], }, }

    const db = await orbitdb.docs('/orbitdb/zdpuAqr5TB6FKmrdztkfDDBPLty96WTmqkAzWVZYSK5tamvRc/test-utm-db', optionsToWrite) //await db.put({ _id: 'test', name: 'test-doc-db', category: 'distributed', name: "omkar", email: "[email protected]" }) await db.put({ _id: 'test2', name: 'test-doc-db', category: 'distributed', name: "omkar sai", email: "[email protected]" }) const address = db.address.toString()

    await db.access.grant('write', '049ed262ac058f91794e2e822868758c9d270bb1f057a541dcb97ce19a0cb96c25c5a5dade728b2de35d98c3ac7b4696ca0bc768aee141dabf2c78a13a6631171b') // grant access to identity2 await db.load(); console.log(identity.toJSON(), 'peer1 database identity')

    console.log(identity.publicKey, 'public key') console.log(identity, 'public key')

    console.log(address, 'peer1 database address')

    // const value = db.get('') // console.log(value, 'value from peer 1')

    const value2 = db.get('') console.log(value2, 'value from peer 1') console.log('all', db.all[0].payload) }

    main() Here is the output node peer1.js Swarm listening on /ip4/172.23.224.1/tcp/4002/p2p/QmRRHtS6Aiepr53e1kwMgBwet1eK6ic27ARXVi8GEnaCBP Swarm listening on /ip4/192.168.0.100/tcp/4002/p2p/QmRRHtS6Aiepr53e1kwMgBwet1eK6ic27ARXVi8GEnaCBP Swarm listening on /ip4/127.0.0.1/tcp/4002/p2p/QmRRHtS6Aiepr53e1kwMgBwet1eK6ic27ARXVi8GEnaCBP Swarm listening on /ip4/127.0.0.1/tcp/4003/ws/p2p/QmRRHtS6Aiepr53e1kwMgBwet1eK6ic27ARXVi8GEnaCBP { id: '03d9bd3e4f3c831fa1352a53dc72063b94a3e6207bd04e353441f0fd9d0a811607', publicKey: '049ed262ac058f91794e2e822868758c9d270bb1f057a541dcb97ce19a0cb96c25c5a5dade728b2de35d98c3ac7b4696ca0bc768aee141dabf2c78a13a6631171b', signatures: { id: '30450221009461811e8890974171506921cd8ae611563692f922f40633319174e77c01c40a0220530643ebf339975c253b87a1df4d9d16e2fe96db893f8b7c5293de8cb2e91a1c', publicKey: '3045022100f2bc983abcd196e1648ba88e4b8abd8f833148ce99c1f30ae0d175de2bbf9a64022053c31ba9af2d436c46d513fb556340083b63a310992a4319fa2f3910bb477bf2' }, type: 'orbitdb' } peer1 database identity 049ed262ac058f91794e2e822868758c9d270bb1f057a541dcb97ce19a0cb96c25c5a5dade728b2de35d98c3ac7b4696ca0bc768aee141dabf2c78a13a6631171b p blic key Identity { _id: '03d9bd3e4f3c831fa1352a53dc72063b94a3e6207bd04e353441f0fd9d0a811607', _publicKey: '049ed262ac058f91794e2e822868758c9d270bb1f057a541dcb97ce19a0cb96c25c5a5dade728b2de35d98c3ac7b4696ca0bc768aee141dabf2c78 a 13a6631171b', _signatures: { id: '30450221009461811e8890974171506921cd8ae611563692f922f40633319174e77c01c40a0220530643ebf339975c253b87a1df4d9d16e2fe96db893f8b 7 c5293de8cb2e91a1c', publicKey: '3045022100f2bc983abcd196e1648ba88e4b8abd8f833148ce99c1f30ae0d175de2bbf9a64022053c31ba9af2d436c46d513fb556340083b63a31 0 992a4319fa2f3910bb477bf2' }, _type: 'orbitdb', _provider: Identities { _keystore: Keystore { _store: [LevelUP], _cache: [LRU] }, _signingKeystore: Keystore { _store: [LevelUP], _cache: [LRU] }, _knownIdentities: LRU { _events: [Object: null prototype] {}, _eventsCount: 0, _maxListeners: undefined, cache: [Object], tail: '30450221009461811e8890974171506921cd8ae611563692f922f40633319174e77c01c40a0220530643ebf339975c253b87a1df4d9d16e2fe96db893f8b7c5293de8cb2e91a1c', head: '30450221009461811e8890974171506921cd8ae611563692f922f40633319174e77c01c40a0220530643ebf339975c253b87a1df4d9d16e2fe96db893f8b7c5293de8cb2e91a1c', length: 1, max: 100, maxAge: 0, [Symbol(kCapture)]: false } } } public key /orbitdb/zdpuAqr5TB6FKmrdztkfDDBPLty96WTmqkAzWVZYSK5tamvRc/test-utm-db peer1 database address [ { _id: 'test2', name: 'omkar sai', category: 'distributed', email: '[email protected]' } ] value from peer 1 all { op: 'PUT', key: 'test2', value: { _id: 'test2', name: 'omkar sai', category: 'distributed', email: '[email protected]' } } `

    But when try to execute same on ubuntu vm on azure with following configurations Linux x86_64 x86_64 GNU/Linux RAM 8 GiB

    it is not working or not code throwing any issues it is just running and stopping with below lines of code Swarm listening on /ip4/127.0.0.1/tcp/4002/p2p/QmevfX7WZuoNtKGJMhDsvYRHkPberMVMLecZdaNBhojaSk Swarm listening on /ip4/10.1.0.4/tcp/4002/p2p/QmevfX7WZuoNtKGJMhDsvYRHkPberMVMLecZdaNBhojaSk Swarm listening on /ip4/172.18.0.1/tcp/4002/p2p/QmevfX7WZuoNtKGJMhDsvYRHkPberMVMLecZdaNBhojaSk Swarm listening on /ip4/127.0.0.1/tcp/4003/ws/p2p/QmevfX7WZuoNtKGJMhDsvYRHkPberMVMLecZdaNBhojaSk /orbitdb/zdpuAsZGQL8qxWKcV82HHD9Cm347KpKyZg5dQN1due3bmXHFN/test-utm-db

    Can any one please let me what could be problem when working on azure vm?

    opened by omkarsunku 0
  • Feature Request: Simpler address string processing.

    Feature Request: Simpler address string processing.

    Currently, an OrbitDB database object contains an address object containing a root (the database hash) and a path (the database name). It would be nice if there was a simple string or function that contained or returned the "full address" that could easily be passed into other functions. eg. db.address() would return /orbitdb/QFNnfjnfewjkfnejkfejffjgbuirleghuithwntwhtiu44t3w434/mydbname. As it is it seems like you have to manually construct the address from its components, unless I'm missing something.

    Alternatively it would be nice if you could pass the address object itself as an argument into db.open().

    opened by threshold862543 0
  • Upgrade leveldown

    Upgrade leveldown

    Because OrbitDB uses leveldown 5.x (leveldown is now on 6.x) a patch is required to build OrbitDB on different hardware platforms e.g. mobile.

    See: https://github.com/TryQuiet/quiet/issues/844#issuecomment-1227379574

    OrbitDB should upgrade to the latest leveldown.

    (I think leveldown is used in orbit-db-keystore and orbit-db-storage-adapter. If I should create issues in the respective repositories please let me know.)

    opened by holmesworcester 0
  • Bump file-type and open-cli

    Bump file-type and open-cli

    Bumps file-type and open-cli. These dependencies needed to be updated together. Updates file-type from 16.5.3 to 16.5.4

    Release notes

    Sourced from file-type's releases.

    v16.5.4

    Commits

    Updates open-cli from 6.0.1 to 7.0.1

    Release notes

    Sourced from open-cli's releases.

    v7.0.1

    • Fix support for multiple app arguments (#19) 616290e

    https://github.com/sindresorhus/open-cli/compare/v7.0.0...v7.0.1

    v7.0.0

    Breaking

    • Require Node.js 14 bf6110c

    Improvements

    • Upgrade dependencies bf6110c

    https://github.com/sindresorhus/open-cli/compare/v6.0.1...v7.0.0

    Commits

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Feature request: Multi-threaded database access

    Feature request: Multi-threaded database access

    LevelDB and thus the OrbitDB databases can only be accessed by a single process at a time, posing an obstacle for multithread database access:

    OpenError: IO error: lock ... LOCK: Resource temporarily unavailable
    ... at .../node_modules/orbit-db-storage-adapter/node_modules/levelup/lib/levelup.js:119:23
    

    It would be cool if there was a way to somehow avoid this issue.

    opened by threshold862543 0
  • [ERR_INVALID_ARG_TYPE]: The

    [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string.

    I have an IPFS daemon running and I want to initialize OrbitDB on it:

    async function SetupIpfsAndOrbitDb (){
    
    	//Load in IPFS and OrbitDB
    	const IPFS = await import('ipfs-http-client')
    	const OrbitDB = await require('orbit-db')
    
    	//Create IPFS instance
    	const ipfs = await IPFS.create()
    
    	//Create OrbitDB instance
    	const orbitdb = await OrbitDB.createInstance(ipfs)
    	const newsdb = await orbitdb.docs('news')
    	return newsdb
    }
    const odb = SetupIpfsAndOrbitDb()
    

    This produces an error:

    12|test    |     at Function.createInstance (/home/.../node_modules/orbit-db/src/OrbitDB.js:109:33)
    12|test    |     at processTicksAndRejections (node:internal/process/task_queues:96:5)
    12|test    |     at async SetupIpfsAndOrbitDb (/home/.../models/forms/addnews.js:45:18) {
    12|test    |   code: 'ERR_INVALID_ARG_TYPE'
    12|test    | } Promise {
    12|test    |   <rejected> TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received an instance of Ed25519PeerIdImpl
    12|test    |       at new NodeError (node:internal/errors:387:5)
    12|test    |       at validateString (node:internal/validators:121:11)
    12|test    |       at Object.join (node:path:1172:7)
    12|test    |       at Function.createInstance (/home/.../node_modules/orbit-db/src/OrbitDB.js:109:33)
    12|test    |       at processTicksAndRejections (node:internal/process/task_queues:96:5)
    12|test    |       at async SetupIpfsAndOrbitDb (/home/.../models/forms/addnews.js:45:18) {
    12|test    |     code: 'ERR_INVALID_ARG_TYPE'
    12|test    |   }
    12|test    | }
    

    I'm not sure what the problem is.

    opened by threshold862543 2
Releases(v0.26.0)
Owner
OrbitDB
Peer-to-Peer Databases for the Decentralized Web
OrbitDB
TypeScript ORM for Node.js based on Data Mapper, Unit of Work and Identity Map patterns. Supports MongoDB, MySQL, MariaDB, PostgreSQL and SQLite databases.

TypeScript ORM for Node.js based on Data Mapper, Unit of Work and Identity Map patterns. Supports MongoDB, MySQL, MariaDB, PostgreSQL and SQLite datab

MikroORM 5.1k Sep 24, 2022
TypeScript clients for databases that prevent SQL Injection

Safe From HTML Injection Using tagged template literals for queries, e.g. db.query(sql`SELECT * FROM users WHERE id=${userID}`); makes it virtually im

Forbes Lindesay 412 Sep 17, 2022
This is the semester project for the course "Databases" at ECE-NTUA, in 2021.

Hotel Management project Semester Assignments for Databases course, summer semester 2021 Concept The project's concept is to create a system that mana

ApoGrs 3 Mar 30, 2022
Explore, create and deploy your SQLite databases right from your browser. Quick and easy, no installation required.

SQLighter (under development, alpha code) SQLighter is a database explorer born for SQLite that helps you design and deploy your application database

sqlighter 10 Sep 4, 2022
An open source cybersecurity protocol for syncing decentralized graph data.

GUN is an ecosystem of tools that let you build community run and encrypted applications. Currently, Internet Archive and HackerNoon run GUN in produc

Mark Nadal 16.4k Sep 20, 2022
A javascript library to run SQLite on the web.

SQLite compiled to JavaScript sql.js is a javascript SQL database. It allows you to create a relational database and query it entirely in the browser.

SQL.JS 10.5k Sep 20, 2022
Lovefield is a relational database for web apps. Written in JavaScript, works cross-browser. Provides SQL-like APIs that are fast, safe, and easy to use.

Lovefield Lovefield is a relational database written in pure JavaScript. It provides SQL-like syntax and works cross-browser (currently supporting Chr

Google 6.8k Sep 22, 2022
Composable data framework for ambitious web applications.

Orbit Orbit is a composable data framework for managing the complex needs of today's web applications. Although Orbit is primarily used as a flexible

Orbit.js 2.3k Sep 18, 2022
A transparent, in-memory, streaming write-on-update JavaScript database for Small Web applications that persists to a JavaScript transaction log.

JavaScript Database (JSDB) A zero-dependency, transparent, in-memory, streaming write-on-update JavaScript database for the Small Web that persists to

Small Technology Foundation 237 Sep 6, 2022
Welcome to the LEGO Games Repository, where you can enjoy anytime, anywhere. This is the 2021 KNU Advanced Web Programming team project.

Welcome to LEGO git repository! Here are some useful information about LEGO service. 0. Docker image Link : https://hub.docker.com/r/leibniz21c/legoga

Heesung Yang 16 Jul 21, 2022
A web client port-scanner written in GO, that supports the WASM/WASI interface for Browser WebAssembly runtime execution.

WebAssembly Port Scanner Written in Go with target WASM/WASI. The WASM main function scans all the open ports in the specified range (see main.go), vi

Avi Lumelsky 71 Sep 9, 2022
Jsynchronous.js - Data synchronization for games and real-time web apps.

Jsynchronous.js Synchronize your rapidly changing app state with all connected browsers. Jsynchronous ensures all clients see the same data as what’s

Sirius 108 Sep 10, 2022
A proposal to add modern, easy to use binary encoders to the web platform.

proposal-binary-encoding A proposal to add modern, easy to use binary encoders to the web platform. This is proposed as an addition to the HTML spec,

Luca Casonato 34 Aug 28, 2022
Database manager for MySQL, PostgreSQL, SQL Server, MongoDB, SQLite and others. Runs under Windows, Linux, Mac or as web application

Database manager for MySQL, PostgreSQL, SQL Server, MongoDB, SQLite and others. Runs under Windows, Linux, Mac or as web application

DbGate 1.8k Sep 20, 2022
ConnectNOW - Live web application that allows you to connect with people around the world!

connectNOW Live web application that allows you to connect with people around the world! You can share images, quotes, and anything on your mind! It a

Isha Chaudhry 1 Jan 3, 2022
Fastify is a web framework highly focused on providing the best developer experience with the least overhead and a powerful plugin architecture, inspired by Hapi and Express.

Fastify is a web framework highly focused on providing the best developer experience with the least overhead and a powerful plugin architecture, inspired by Hapi and Express.

Jared Hanson 4 May 10, 2022
PathQL is a json standard based on GraphQL to build simple web applications.

PathQL Usage You can simple create a new PathQL Entry, which allows you to automize database over an orm and client requests over the PathQL JSON Requ

Nowhere 3 Jul 20, 2022
A web SQL interface to your Stripe account using Datasette.

Datasette, Stripe and tdog Or: Stripe Sigma Alternative Datasette is a web GUI for exploring SQLite datasets. Stripe handles online payments. Sigma is

Table Dog 19 Aug 12, 2022
Thin Backend is a Blazing Fast, Universal Web App Backend for Making Realtime Single Page Apps

Website | Documentation About Thin Thin Backend is a blazing fast, universal web app backend for making realtime single page apps. Instead of manually

digitally induced GmbH 983 Sep 21, 2022