docs: Use new exports and locations for orbitdb.

This commit is contained in:
Hayden Young 2023-08-17 12:51:27 +01:00
parent 6316eb1706
commit f33c5d15f5

View File

@ -4,7 +4,7 @@
<img src="images/orbit_db_logo_color.png" width="256" />
</p>
[![Matrix](https://img.shields.io/matrix/orbit-db:matrix.org?label=chat%20on%20matrix)](https://app.element.io/#/room/#orbit-db:matrix.org) [![npm version](https://badge.fury.io/js/orbit-db.svg)](https://www.npmjs.com/package/orbit-db) [![node](https://img.shields.io/node/v/orbit-db.svg)](https://www.npmjs.com/package/orbit-db)
[![Matrix](https://img.shields.io/matrix/orbit-db:matrix.org?label=chat%20on%20matrix)](https://app.element.io/#/room/#orbit-db:matrix.org) [![npm version](https://badge.fury.io/js/orbit-db.svg)](https://www.npmjs.com/package/@orbitdb/core) [![node](https://img.shields.io/node/v/orbit-db.svg)](https://www.npmjs.com/package/@orbitdb/core)
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.
@ -13,12 +13,12 @@ OrbitDB is a **serverless, distributed, peer-to-peer database**. OrbitDB uses [I
OrbitDB provides various types of databases for different data models and use cases:
- **[events](https://github.com/orbitdb/orbit-db/blob/master/API.md#orbitdblognameaddress)**: an immutable (append-only) log with traversable history. Useful for *"latest N"* use cases or as a message queue.
- **[documents](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.
- **[keyvalue](https://github.com/orbitdb/orbit-db/blob/master/API.md#orbitdbkeyvaluenameaddress)**: a key-value database just like your favourite key-value database.
- **[keyvalue-indexed](https://github.com/orbitdb/orbit-db/blob/master/API.md#orbitdbkeyvaluenameaddress)**: key-value data indexed in a Level key-value database.
- **[events](./blob/master/API.md#orbitdblognameaddress)**: an immutable (append-only) log with traversable history. Useful for *"latest N"* use cases or as a message queue.
- **[documents](./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.
- **[keyvalue](./blob/master/API.md#orbitdbkeyvaluenameaddress)**: a key-value database just like your favourite key-value database.
- **[keyvalue-indexed](./blob/master/API.md#orbitdbkeyvaluenameaddress)**: key-value data indexed in a Level key-value database.
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.
All databases are [implemented](./tree/main/src/storage/) on top of OrbitDB's [OpLog](./tree/amin/src/oplog/), 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. OpLog 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](./blob/main/docs/DATABASES.md#building-a-custom-database) benefitting from the same properties as the default data models provided by the underlying Merkle-CRDTs.
#### Project status & support
@ -62,7 +62,7 @@ A Go implementation is developed and maintained by the [Berty](https://github.co
## Installation
```
npm install orbit-db
npm install @orbitdb/core
```
### Browser <script> tag
@ -73,15 +73,15 @@ OrbitDB can be loaded in the browser using the distributed js file with the `<sc
## Usage
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 `@orbitdb/core` to develop **browser** or **Node.js** applications, use it as a module with the javascript instance of IPFS.
```javascript
import IPFS from 'ipfs-core'
import OrbitDB from 'orbit-db'
import { createOrbitDB } from '@orbitdb/core'
;(async function () {
const ipfs = await IPFS.create()
const orbitdb = await OrbitDB({ ipfs })
const orbitdb = await createOrbitDB({ ipfs })
// Create / Open a database. Defaults to db type "events".
const db = await orbitdb.open("hello")
@ -116,13 +116,13 @@ Use the **[Getting Started](./docs/GETTING_STARTED.md)** guide for an initial in
## API
See [API.md](https://github.com/orbitdb/orbit-db/blob/master/API.md) for the full documentation.
See [API.md](./blob/master/API.md) for the full documentation.
## Examples
### Install dependencies
```sh
git clone https://github.com/orbitdb/orbit-db.git
git clone https://github.com/orbitdb/orbitdb.git
cd orbit-db
npm install
```
@ -148,10 +148,10 @@ npm run examples:browser-webpack # if browser isn't opening, open examples/brows
```
<p align="left">
<img src="https://raw.githubusercontent.com/orbitdb/orbit-db/master/images/example1.png" width="33%">
<img src="https://raw.githubusercontent.com/orbitdb/orbitdb/master/images/example1.png" width="33%">
</p>
Check the code in [examples/browser/browser.html](https://github.com/orbitdb/orbit-db/blob/master/examples/browser/browser.html) and try the [live example](https://ipfs.io/ipfs/QmRosp97r8GGUEdj5Wvivrn5nBkuyajhRXFUcWCp5Zubbo/).
Check the code in [examples/browser/browser.html](./blob/master/examples/browser/browser.html) and try the [live example](https://ipfs.io/ipfs/QmRosp97r8GGUEdj5Wvivrn5nBkuyajhRXFUcWCp5Zubbo/).
### Node.js example
@ -159,11 +159,11 @@ Check the code in [examples/browser/browser.html](https://github.com/orbitdb/orb
npm run examples:node
```
<img src="https://raw.githubusercontent.com/orbitdb/orbit-db/master/images/orbit-db-demo3.gif" width="66%">
<img src="https://raw.githubusercontent.com/orbitdb/orbitdb/master/images/orbit-db-demo3.gif" width="66%">
**Eventlog**
See the code in [examples/eventlog.js](https://github.com/orbitdb/orbit-db/blob/master/examples/eventlog.js) and run it with:
See the code in [examples/eventlog.js](./blob/master/examples/eventlog.js) and run it with:
```sh
node examples/eventlog.js
```
@ -185,7 +185,7 @@ npm run build
node benchmarks/benchmark-add.js
```
See [benchmarks/](https://github.com/orbitdb/orbit-db/tree/master/benchmarks) for more benchmarks.
See [benchmarks/](./tree/master/benchmarks) for more benchmarks.
### Logging
@ -222,7 +222,7 @@ The best place to find out what is out there and what is being actively worked o
**Take a look at our organization-wide [Contributing Guide](https://github.com/orbitdb/welcome/blob/master/contributing.md).** You'll find most of your questions answered there. Some questions may be answered in the [FAQ](FAQ.md), as well.
If you want to code but don't know where to start, check out the issues labelled ["help wanted"](https://github.com/orbitdb/orbit-db/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22+sort%3Areactions-%2B1-desc).
If you want to code but don't know where to start, check out the issues labelled ["help wanted"](./issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22+sort%3Areactions-%2B1-desc).
## Sponsors