mirror of
https://github.com/orbitdb/orbitdb.git
synced 2025-06-22 14:02:30 +00:00
Merge pull request #1051 from orbitdb/update-documentation
Release Notes for v0.29.0
This commit is contained in:
commit
61c28d6a88
2
API.md
2
API.md
@ -493,7 +493,7 @@ OrbitDB.isValidType('docstore')
|
|||||||
### OrbitDB.addDatabaseType(type, store)
|
### OrbitDB.addDatabaseType(type, store)
|
||||||
Adds a custom database type & store to OrbitDB
|
Adds a custom database type & store to OrbitDB
|
||||||
```js
|
```js
|
||||||
const CustomStore = require('./CustomStore')
|
import CustomStore from './CustomStore'
|
||||||
OrbitDB.addDatabaseType(CustomStore.type, CustomStore)
|
OrbitDB.addDatabaseType(CustomStore.type, CustomStore)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
22
CHANGELOG.md
22
CHANGELOG.md
@ -2,6 +2,28 @@
|
|||||||
|
|
||||||
Note: OrbitDB follows [semver](https://semver.org/). We are currently in alpha: backwards-incompatible changes may occur in minor releases.
|
Note: OrbitDB follows [semver](https://semver.org/). We are currently in alpha: backwards-incompatible changes may occur in minor releases.
|
||||||
|
|
||||||
|
## v0.29.0
|
||||||
|
|
||||||
|
### ESM
|
||||||
|
In this release we've updated OrbitDB and all of its modules to use [ESM](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules), JavaScript Modules.
|
||||||
|
|
||||||
|
### Latest js-ipfs
|
||||||
|
This release also brings compatibility with the latest version of js-ipfs (v0.66.0).
|
||||||
|
|
||||||
|
### Level v8.0.0
|
||||||
|
In addition, we've updated the underlying data storage, [Level](https://github.com/Level), to its latest version v8.0.0. We've dropped the automatic migration from Level < v5.0.0 stores, so if you have databases that use and old version of Level, please see the [Upgrading Guide](https://github.com/Level/level/blob/master/UPGRADING.md) for Level on how to migrate manually.
|
||||||
|
|
||||||
|
### Misc
|
||||||
|
We've also fixed various bugs across the code base, updated all dependencies to their latest versions and removed the ES5 distribution builds.
|
||||||
|
|
||||||
|
Note that there are no API changes to OrbitDB in this release.
|
||||||
|
|
||||||
|
For more details, please see the relevant main PRs:
|
||||||
|
- https://github.com/orbitdb/orbit-db/pull/1044
|
||||||
|
- https://github.com/orbitdb/orbit-db/pull/1050
|
||||||
|
- https://github.com/orbitdb/orbit-db-storage-adapter/pull/24
|
||||||
|
- https://github.com/search?q=org%3Aorbitdb+esm&type=issues
|
||||||
|
|
||||||
## v0.24.1
|
## v0.24.1
|
||||||
|
|
||||||
### JS-IPFS 0.44 Support
|
### JS-IPFS 0.44 Support
|
||||||
|
34
GUIDE.md
34
GUIDE.md
@ -58,8 +58,8 @@ See [API.md](https://github.com/orbitdb/orbit-db/blob/master/API.md) for the ful
|
|||||||
Require OrbitDB and IPFS in your program and create the instances:
|
Require OrbitDB and IPFS in your program and create the instances:
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
const IPFS = require('ipfs')
|
import IPFS from 'ipfs'
|
||||||
const OrbitDB = require('orbit-db')
|
import OrbitDB from 'orbit-db'
|
||||||
|
|
||||||
async function main () {
|
async function main () {
|
||||||
// Create IPFS instance
|
// Create IPFS instance
|
||||||
@ -87,8 +87,8 @@ First, choose the data model you want to use. The available data models are:
|
|||||||
Then, create a database instance (we'll use Key-Value database in this example):
|
Then, create a database instance (we'll use Key-Value database in this example):
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
const IPFS = require('ipfs')
|
import IPFS from 'ipfs'
|
||||||
const OrbitDB = require('orbit-db')
|
import OrbitDB from 'orbit-db'
|
||||||
|
|
||||||
async function main () {
|
async function main () {
|
||||||
// Create IPFS instance
|
// Create IPFS instance
|
||||||
@ -123,8 +123,8 @@ const address = db.address
|
|||||||
|
|
||||||
For example:
|
For example:
|
||||||
```javascript
|
```javascript
|
||||||
const IPFS = require('ipfs')
|
import IPFS from 'ipfs'
|
||||||
const OrbitDB = require('orbit-db')
|
import OrbitDB from 'orbit-db'
|
||||||
|
|
||||||
async function main () {
|
async function main () {
|
||||||
const ipfsOptions = { repo: './ipfs',}
|
const ipfsOptions = { repo: './ipfs',}
|
||||||
@ -175,7 +175,7 @@ console.log(identity.toJSON())
|
|||||||
|
|
||||||
#### Creating an identity
|
#### Creating an identity
|
||||||
```javascript
|
```javascript
|
||||||
const Identities = require('orbit-db-identity-provider')
|
import Identities from 'orbit-db-identity-provider'
|
||||||
const options = { id: 'local-id' }
|
const options = { id: 'local-id' }
|
||||||
const identity = await Identities.createIdentity(options)
|
const identity = await Identities.createIdentity(options)
|
||||||
```
|
```
|
||||||
@ -202,8 +202,8 @@ You can specify the peers that have write-access to a database. You can define a
|
|||||||
Access rights are setup by passing an `accessController` object that specifies the access-controller type and access rights of the database when created. OrbitDB currently supports write-access. The access rights are specified as an array of public keys of the peers who can write to the database. The public keys to which access is given can be retrieved from the identity.publicKey property of each peer.
|
Access rights are setup by passing an `accessController` object that specifies the access-controller type and access rights of the database when created. OrbitDB currently supports write-access. The access rights are specified as an array of public keys of the peers who can write to the database. The public keys to which access is given can be retrieved from the identity.publicKey property of each peer.
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
const IPFS = require('ipfs')
|
import IPFS from 'ipfs'
|
||||||
const OrbitDB = require('orbit-db')
|
import OrbitDB from 'orbit-db'
|
||||||
|
|
||||||
async function main () {
|
async function main () {
|
||||||
const ipfsOptions = { repo: './ipfs',}
|
const ipfsOptions = { repo: './ipfs',}
|
||||||
@ -230,8 +230,8 @@ The keys look like this:
|
|||||||
|
|
||||||
Give access to another peer to write to the database:
|
Give access to another peer to write to the database:
|
||||||
```javascript
|
```javascript
|
||||||
const IPFS = require('ipfs')
|
import IPFS from 'ipfs'
|
||||||
const OrbitDB = require('orbit-db')
|
import OrbitDB from 'orbit-db'
|
||||||
|
|
||||||
async function main () {
|
async function main () {
|
||||||
const ipfsOptions = { repo: './ipfs', }
|
const ipfsOptions = { repo: './ipfs', }
|
||||||
@ -267,8 +267,8 @@ The access control mechanism also support "public" databases to which anyone can
|
|||||||
|
|
||||||
This can be done by adding a `*` to the write access array:
|
This can be done by adding a `*` to the write access array:
|
||||||
```javascript
|
```javascript
|
||||||
const IPFS = require('ipfs')
|
import IPFS from 'ipfs'
|
||||||
const OrbitDB = require('orbit-db')
|
import OrbitDB from 'orbit-db'
|
||||||
|
|
||||||
async function main () {
|
async function main () {
|
||||||
const ipfsOptions = { repo: './ipfs', }
|
const ipfsOptions = { repo: './ipfs', }
|
||||||
@ -312,8 +312,8 @@ await db.access.grant('write', identity2.publicKey) // grant access to identity2
|
|||||||
You can create a custom access controller by implementing the `AccessController` [interface](https://github.com/orbitdb/orbit-db-access-controllers/blob/master/src/access-controller-interface.js) and adding it to the AccessControllers object before passing it to OrbitDB.
|
You can create a custom access controller by implementing the `AccessController` [interface](https://github.com/orbitdb/orbit-db-access-controllers/blob/master/src/access-controller-interface.js) and adding it to the AccessControllers object before passing it to OrbitDB.
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
let AccessControllers = require('orbit-db-access-controllers')
|
import AccessControllers from 'orbit-db-access-controllers'
|
||||||
const AccessController = require('orbit-db-access-controllers/src/access-controller-interface')
|
import AccessController from 'orbit-db-access-controllers/interface'
|
||||||
|
|
||||||
class OtherAccessController extends AccessController {
|
class OtherAccessController extends AccessController {
|
||||||
|
|
||||||
@ -358,8 +358,8 @@ const db = await orbitdb.keyvalue('first-database', {
|
|||||||
To add an entry to the database, we simply call `db.put(key, value)`.
|
To add an entry to the database, we simply call `db.put(key, value)`.
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
const IPFS = require('ipfs')
|
import IPFS from 'ipfs'
|
||||||
const OrbitDB = require('orbit-db')
|
import OrbitDB from 'orbit-db'
|
||||||
|
|
||||||
async function main () {
|
async function main () {
|
||||||
const ipfsOptions = { repo: './ipfs'}
|
const ipfsOptions = { repo: './ipfs'}
|
||||||
|
55
README.md
55
README.md
@ -4,9 +4,9 @@
|
|||||||
<img src="images/orbit_db_logo_color.png" width="256" />
|
<img src="images/orbit_db_logo_color.png" width="256" />
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
[](https://app.element.io/#/room/#orbit-db:matrix.org) [](https://circleci.com/gh/orbitdb/orbit-db) [](https://www.npmjs.com/package/orbit-db) [](https://www.npmjs.com/package/orbit-db)
|
[](https://app.element.io/#/room/#orbit-db:matrix.org) [](https://www.npmjs.com/package/orbit-db) [](https://www.npmjs.com/package/orbit-db)
|
||||||
|
|
||||||
OrbitDB is a **serverless, distributed, peer-to-peer database**. OrbitDB uses [IPFS](https://ipfs.io) as its data storage and [IPFS Pubsub](https://github.com/ipfs/go-ipfs/blob/master/core/commands/pubsub.go#L23) to automatically sync databases with peers. It's an eventually consistent database that uses [CRDTs](https://en.wikipedia.org/wiki/Conflict-free_replicated_data_type) for conflict-free database merges making OrbitDB an excellent choice for decentralized apps (dApps), blockchain applications and [local-first](https://www.inkandswitch.com/local-first/) web applications.
|
OrbitDB is a **serverless, distributed, peer-to-peer database**. OrbitDB uses [IPFS](https://ipfs.tech) as its data storage and [Libp2p Pubsub](https://docs.libp2p.io/concepts/pubsub/overview/) to automatically sync databases with peers. It's an eventually consistent database that uses [Merkle-CRDTs](https://arxiv.org/abs/2004.00107) for conflict-free database writes and merges making OrbitDB an excellent choice for p2p and decentralized apps, blockchain applications and [local-first](https://www.inkandswitch.com/local-first/) web applications.
|
||||||
|
|
||||||
**Test it live at [Live demo 1](https://ipfs.io/ipfs/QmUsoSkGzUQnCgzfjL549KKf29m5EMYky3Y6gQp5HptLTG/), [Live demo 2](https://ipfs.io/ipfs/QmasHFRj6unJ3nSmtPn97tWDaQWEZw3W9Eh3gUgZktuZDZ/), or [P2P TodoMVC app](https://ipfs.io/ipfs/QmVWQMLUM3o4ZFbLtLMS1PMLfodeEeBkBPR2a2R3hqQ337/)**!
|
**Test it live at [Live demo 1](https://ipfs.io/ipfs/QmUsoSkGzUQnCgzfjL549KKf29m5EMYky3Y6gQp5HptLTG/), [Live demo 2](https://ipfs.io/ipfs/QmasHFRj6unJ3nSmtPn97tWDaQWEZw3W9Eh3gUgZktuZDZ/), or [P2P TodoMVC app](https://ipfs.io/ipfs/QmVWQMLUM3o4ZFbLtLMS1PMLfodeEeBkBPR2a2R3hqQ337/)**!
|
||||||
|
|
||||||
@ -19,28 +19,28 @@ OrbitDB provides various types of databases for different data models and use ca
|
|||||||
- **[docs](https://github.com/orbitdb/orbit-db/blob/master/API.md#orbitdbdocsnameaddress-options)**: 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.
|
- **[docs](https://github.com/orbitdb/orbit-db/blob/master/API.md#orbitdbdocsnameaddress-options)**: 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](https://github.com/orbitdb/orbit-db/blob/master/API.md#orbitdbcounternameaddress)**: Useful for counting events separate from log/feed data.
|
- **[counter](https://github.com/orbitdb/orbit-db/blob/master/API.md#orbitdbcounternameaddress)**: Useful for counting events separate from log/feed data.
|
||||||
|
|
||||||
All databases are [implemented](https://github.com/orbitdb/orbit-db-store) on top of [ipfs-log](https://github.com/orbitdb/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](https://github.com/orbitdb/orbit-db/blob/master/GUIDE.md#custom-stores) of your own.
|
All databases are [implemented](https://github.com/orbitdb/orbit-db-store) on top of [ipfs-log](https://github.com/orbitdb/ipfs-log), an immutable, cryptographically verifiable, operation-based conflict-free replicated data structure ([CRDT](https://en.wikipedia.org/wiki/Conflict-free_replicated_data_type)) for distributed systems. ipfs-log is formalized in the paper [Merkle-CRDTs](https://arxiv.org/abs/2004.00107). You can also easily extend OrbitDB by [implementing and using a custom data model](https://github.com/orbitdb/orbit-db/blob/master/GUIDE.md#custom-stores) benefitting from the same properties as the default data models provided by the underlying Merkle-CRDTs.
|
||||||
|
|
||||||
#### Project status & support
|
#### Project status & support
|
||||||
|
|
||||||
* Status: **in active development**
|
* Status: **in active development**
|
||||||
* Compatible with **js-ipfs versions <= 0.52** and **go-ipfs versions <= 0.6.0**
|
* Compatible with **js-ipfs versions >= 0.66.0** and **go-ipfs versions >= 0.17.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](https://app.element.io/#/room/#orbit-db:matrix.org) if you plan to use OrbitDB in mission critical systems.*
|
***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](https://app.element.io/#/room/#orbit-db:matrix.org) 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. Node version 16 is supported.
|
This is the Javascript implementation and it works both in **Browsers** and **Node.js** with support for Linux, OS X, and Windows. Node version 16 is 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.
|
A Go implementation is developed and maintained by the [Berty](https://github.com/berty) project at [berty/go-orbit-db](https://github.com/berty/go-orbit-db).
|
||||||
|
|
||||||
## Table of Contents
|
## Table of Contents
|
||||||
|
|
||||||
<!-- toc -->
|
<!-- toc -->
|
||||||
|
|
||||||
- [Usage](#usage)
|
- [Usage](#usage)
|
||||||
* [Database browser UI](#database-browser-ui)
|
|
||||||
* [Module with IPFS Instance](#module-with-ipfs-instance)
|
* [Module with IPFS Instance](#module-with-ipfs-instance)
|
||||||
* [Module with IPFS Daemon](#module-with-ipfs-daemon)
|
* [Module with IPFS Daemon](#module-with-ipfs-daemon)
|
||||||
- [API](#api)
|
- [API](#api)
|
||||||
|
- [Database browser UI](#database-browser-ui)
|
||||||
- [Examples](#examples)
|
- [Examples](#examples)
|
||||||
* [Install dependencies](#install-dependencies)
|
* [Install dependencies](#install-dependencies)
|
||||||
* [Browser example](#browser-example)
|
* [Browser example](#browser-example)
|
||||||
@ -67,18 +67,6 @@ Read the **[GETTING STARTED](https://github.com/orbitdb/orbit-db/blob/master/GUI
|
|||||||
|
|
||||||
For a more in-depth tutorial and exploration of OrbitDB's architecture, please check out the **[OrbitDB Field Manual](https://github.com/orbitdb/field-manual)**.
|
For a more in-depth tutorial and exploration of OrbitDB's architecture, please check out the **[OrbitDB Field Manual](https://github.com/orbitdb/field-manual)**.
|
||||||
|
|
||||||
### Database browser UI
|
|
||||||
|
|
||||||
OrbitDB databases can easily be managed using a web UI, see **[OrbitDB Control Center](https://github.com/orbitdb/orbit-db-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
|
### 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
|
If you're using `orbit-db` to develop **browser** or **Node.js** applications, use it as a module with the javascript instance of IPFS
|
||||||
@ -91,8 +79,8 @@ npm install orbit-db ipfs
|
|||||||
|
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
const IPFS = require('ipfs')
|
import IPFS from 'ipfs'
|
||||||
const OrbitDB = require('orbit-db')
|
import OrbitDB from 'orbit-db'
|
||||||
|
|
||||||
;(async function () {
|
;(async function () {
|
||||||
const ipfs = await IPFS.create()
|
const ipfs = await IPFS.create()
|
||||||
@ -128,10 +116,10 @@ npm install orbit-db ipfs-http-client
|
|||||||
```
|
```
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
const IpfsClient = require('ipfs-http-client')
|
import { create } from 'ipfs-http-client'
|
||||||
const OrbitDB = require('orbit-db')
|
import OrbitDB from 'orbit-db'
|
||||||
|
|
||||||
const ipfs = IpfsClient('localhost', '5001')
|
const ipfs = create(new URL('http://localhost:5001'))
|
||||||
|
|
||||||
const orbitdb = await OrbitDB.createInstance(ipfs)
|
const orbitdb = await OrbitDB.createInstance(ipfs)
|
||||||
const db = await orbitdb.log('hello')
|
const db = await orbitdb.log('hello')
|
||||||
@ -143,6 +131,18 @@ const db = await orbitdb.log('hello')
|
|||||||
|
|
||||||
See [API.md](https://github.com/orbitdb/orbit-db/blob/master/API.md) for the full documentation.
|
See [API.md](https://github.com/orbitdb/orbit-db/blob/master/API.md) for the full documentation.
|
||||||
|
|
||||||
|
## Database browser UI
|
||||||
|
|
||||||
|
OrbitDB databases can easily be managed using a web UI, see **[OrbitDB Control Center](https://github.com/orbitdb/orbit-db-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
|
||||||
|
```
|
||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
### Install dependencies
|
### Install dependencies
|
||||||
@ -205,10 +205,10 @@ OrbitDB uses the following modules:
|
|||||||
|
|
||||||
- [ipfs](https://github.com/ipfs/js-ipfs)
|
- [ipfs](https://github.com/ipfs/js-ipfs)
|
||||||
- [ipfs-log](https://github.com/orbitdb/ipfs-log)
|
- [ipfs-log](https://github.com/orbitdb/ipfs-log)
|
||||||
- [ipfs-pubsub-room](https://github.com/ipfs-shipyard/ipfs-pubsub-room)
|
|
||||||
- [crdts](https://github.com/orbitdb/crdts)
|
- [crdts](https://github.com/orbitdb/crdts)
|
||||||
- [orbit-db-cache](https://github.com/orbitdb/orbit-db-cache)
|
- [ipfs-pubsub-1on1](https://github.com/orbitdb/ipfs-pubsub-1on1)
|
||||||
- [orbit-db-pubsub](https://github.com/orbitdb/orbit-db-pubsub)
|
- [orbit-db-pubsub](https://github.com/orbitdb/orbit-db-pubsub)
|
||||||
|
- [orbit-db-cache](https://github.com/orbitdb/orbit-db-cache)
|
||||||
- [orbit-db-identity-provider](https://github.com/orbitdb/orbit-db-identity-provider)
|
- [orbit-db-identity-provider](https://github.com/orbitdb/orbit-db-identity-provider)
|
||||||
- [orbit-db-access-controllers](https://github.com/orbitdb/orbit-db-access-controllers)
|
- [orbit-db-access-controllers](https://github.com/orbitdb/orbit-db-access-controllers)
|
||||||
|
|
||||||
@ -272,12 +272,13 @@ If you want to code but don't know where to start, check out the issues labelled
|
|||||||
|
|
||||||
The development of OrbitDB has been sponsored by:
|
The development of OrbitDB has been sponsored by:
|
||||||
|
|
||||||
* [Haja Networks](https://haja.io)
|
|
||||||
* [Protocol Labs](https://protocol.ai/)
|
* [Protocol Labs](https://protocol.ai/)
|
||||||
|
* [Haja Networks](https://haja.io)
|
||||||
* [Maintainer Mountaineer](https://maintainer.io)
|
* [Maintainer Mountaineer](https://maintainer.io)
|
||||||
|
* [OrbitDB Open Collective](https://opencollective.com/orbitdb)
|
||||||
|
|
||||||
If you want to sponsor developers to work on OrbitDB, please reach out to [@haadcode](https://github.com/haadcode).
|
If you want to sponsor developers to work on OrbitDB, please reach out to [@haadcode](https://github.com/haadcode).
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
[MIT](LICENSE) © 2015-2019 Protocol Labs Inc., Haja Networks Oy
|
[MIT](LICENSE) © 2015-2023 Protocol Labs Inc., Haja Networks Oy, OrbitDB Community
|
||||||
|
@ -109,6 +109,7 @@
|
|||||||
],
|
],
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"crdt",
|
"crdt",
|
||||||
|
"merkle-crdt",
|
||||||
"database",
|
"database",
|
||||||
"decentralized",
|
"decentralized",
|
||||||
"decentralised",
|
"decentralised",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user