{"id":13394174,"url":"https://github.com/orbitdb/orbitdb","last_synced_at":"2025-05-13T15:08:30.386Z","repository":{"id":37251827,"uuid":"48617634","full_name":"orbitdb/orbitdb","owner":"orbitdb","description":"Peer-to-Peer Databases for the Decentralized Web","archived":false,"fork":false,"pushed_at":"2025-05-04T08:06:05.000Z","size":18675,"stargazers_count":8512,"open_issues_count":16,"forks_count":574,"subscribers_count":160,"default_branch":"main","last_synced_at":"2025-05-05T21:13:24.740Z","etag":null,"topics":["crdt","database","decentralized","distributed","ipfs","libp2p","merkle-crdt","p2p","peer-to-peer"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/orbitdb.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":null,"patreon":null,"open_collective":"orbitdb","ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":["https://github.com/orbitdb/funding"]}},"created_at":"2015-12-26T17:02:28.000Z","updated_at":"2025-05-05T00:12:21.000Z","dependencies_parsed_at":"2023-07-22T13:08:40.288Z","dependency_job_id":"cf88b20c-a070-4d31-bf2e-cab22e5dd9b1","html_url":"https://github.com/orbitdb/orbitdb","commit_stats":{"total_commits":1657,"total_committers":78,"mean_commits":"21.243589743589745","dds":"0.47917923958961983","last_synced_commit":"e02a92ffc548de963bf4bc269bfb00ff598f4e6d"},"previous_names":["orbitdb/orbit-db"],"tags_count":35,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orbitdb%2Forbitdb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orbitdb%2Forbitdb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orbitdb%2Forbitdb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orbitdb%2Forbitdb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/orbitdb","download_url":"https://codeload.github.com/orbitdb/orbitdb/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252577022,"owners_count":21770721,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["crdt","database","decentralized","distributed","ipfs","libp2p","merkle-crdt","p2p","peer-to-peer"],"created_at":"2024-07-30T17:01:11.394Z","updated_at":"2025-05-05T21:13:30.493Z","avatar_url":"https://github.com/orbitdb.png","language":"JavaScript","readme":"# OrbitDB\n\n\u003cp align=\"left\"\u003e\n  \u003cimg src=\"images/orbit_db_logo_color.png\" width=\"256\" /\u003e\n\u003c/p\u003e\n\n[![Matrix](https://img.shields.io/matrix/orbit-db%3Amatrix.org)](https://app.element.io/#/room/#orbit-db:matrix.org) [![npm (scoped)](https://img.shields.io/npm/v/%40orbitdb/core)](https://www.npmjs.com/package/@orbitdb/core) [![node-current (scoped)](https://img.shields.io/node/v/%40orbitdb/core)](https://www.npmjs.com/package/@orbitdb/core)\n\nOrbitDB 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.\n\nOrbitDB provides various types of databases for different data models and use cases:\n\n- **[events](https://github.com/orbitdb/orbitdb/blob/master/API.md#orbitdblognameaddress)**: an immutable (append-only) log with traversable history. Useful for *\"latest N\"* use cases or as a message queue.\n- **[documents](https://github.com/orbitdb/orbitdb/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.\n- **[keyvalue](https://github.com/orbitdb/orbitdb/blob/master/API.md#orbitdbkeyvaluenameaddress)**: a key-value database just like your favourite key-value database.\n- **[keyvalue-indexed](https://github.com/orbitdb/orbitdb/blob/master/API.md#orbitdbkeyvaluenameaddress)**: key-value data indexed in a Level key-value database.\n\nAll databases are [implemented](https://github.com/orbitdb/orbitdb/tree/main/src/databases/) on top of OrbitDB's [OpLog](https://github.com/orbitdb/orbitdb/tree/main/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](https://github.com/orbitdb/orbitdb/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.\n\nThis is the Javascript implementation and it works both in **Browsers** and **Node.js** with support for Linux, OS X, and Windows.\n\nA 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).\n\n## Installation\n\nInstall OrbitDB and its dependencies:\n```\nnpm install @orbitdb/core helia\n```\n\n### Browser `\u003cscript\u003e` tag\n\nOrbitDB can be loaded in the browser using the distributed js file with the `\u003cscript/\u003e` tag. OrbitDB is the global namespace and all external functions are available via this namespace:\n\n`\u003cscript\u003e/path/to/orbitdb.min.js\u003c/script\u003e`\n\n## Quick Start\n\nIf you want to get up and running with OrbitDB quickly, install and follow the instructions in the [@orbitdb/quickstart](https://github.com/orbitdb/quickstart) module.\n\n## Usage\n\nIf you're using `@orbitdb/core` to develop **browser** or **Node.js** applications, use it as a module with the javascript instance of IPFS.\n\n```javascript\nimport { createHelia } from 'helia'\nimport { createOrbitDB } from '@orbitdb/core'\nimport { gossipsub } from \"@chainsafe/libp2p-gossipsub\";\nimport { identify } from \"@libp2p/identify\";\nimport { createLibp2p } from 'libp2p'\n\nconst Libp2pOptions = {\n  services: {\n    pubsub: gossipsub({\n      // neccessary to run a single peer\n      allowPublishToZeroTopicPeers: true\n    }),\n    identify: identify()\n  }\n}\n\n;(async function () {\n  const libp2p = await createLibp2p({ ...Libp2pOptions })\n  const ipfs = await createHelia({libp2p})\n  const orbitdb = await createOrbitDB({ ipfs })\n\n  // Create / Open a database. Defaults to db type \"events\".\n  const db = await orbitdb.open(\"hello\")\n  \n  const address = db.address\n  console.log(address)\n  // \"/orbitdb/zdpuAkstgbTVGHQmMi5TC84auhJ8rL5qoaNEtXo2d5PHXs2To\"\n  // The above address can be used on another peer to open the same database\n\n  // Listen for updates from peers\n  db.events.on(\"update\", async entry =\u003e {\n    console.log(entry)\n    const all = await db.all()\n    console.log(all)\n  })\n\n  // Add an entry\n  const hash = await db.add(\"world\")\n  console.log(hash)\n\n  // Query\n  for await (const record of db.iterator()) {\n    console.log(record)\n  }\n  \n  await db.close()\n  await orbitdb.stop()\n  await ipfs.stop()\n})()\n\n```\n\nTo configure your [IPFS instance](https://github.com/ipfs/helia) for persistency and [Libp2p](https://github.com/libp2p/js-libp2p) to connect to peers, see [Creating a Helia instance](https://github.com/orbitdb/quickstart/blob/main/src/index.js) and the [Default Libp2p Configurations](https://github.com/orbitdb/quickstart/blob/main/src/config/libp2p/index.js) in [@orbitdb/quickstart](https://github.com/orbitdb/quickstart/blob/main/src/config/libp2p/index.js) for examples.\n\n## Documentation\n\nUse the **[Getting Started](https://github.com/orbitdb/orbitdb/blob/main/docs/GETTING_STARTED.md)** guide for an initial introduction to OrbitDB.\n\nYou can find more advanced topics in our [docs](https://github.com/orbitdb/orbitdb/blob/main/docs) covering:\n- [Databases](https://github.com/orbitdb/orbitdb/blob/main/docs/DATABASES.md)\n- [Storage](https://github.com/orbitdb/orbitdb/blob/main/docs/STORAGE.md)\n- [Identities](https://github.com/orbitdb/orbitdb/blob/main/docs/IDENTITIES.md)\n- [Access Controllers](https://github.com/orbitdb/orbitdb/blob/main/docs/ACCESS_CONTROLLERS.md)\n- [Connecting Peers](https://github.com/orbitdb/orbitdb/blob/main/docs/CONNECTING_PEERS.md)\n- [Replication](https://github.com/orbitdb/orbitdb/blob/main/docs/REPLICATION.md)\n- [Oplog](https://github.com/orbitdb/orbitdb/blob/main/docs/OPLOG.md)\n\n### API\n\nSee [https://api.orbitdb.org](https://api.orbitdb.org) for the full API documentation.\n\n## Development\n\n### Run Tests\n```sh\nnpm run test\n```\n\n### Build\n```sh\nnpm run build\n```\n\n### Benchmark\n```sh\nnode benchmarks/orbitdb-events.js\n```\n\nSee [benchmarks/](https://github.com/orbitdb/orbitdb/tree/master/benchmarks) for more benchmarks.\n\n### API\n\nTo build the API documentation, run:\n\n```sh\nnpm run build:docs\n```\n\nDocumentation is output to ./docs/api.\n\n## Other implementations\n\n- Golang: [berty/go-orbit-db](https://github.com/berty/go-orbit-db)\n- Python: [orbitdb/py-orbit-db-http-client](https://github.com/orbitdb/py-orbit-db-http-client)\n\nIf you know of any other repos that ought to be included in this section, please open a PR and add them.\n\n## Contributing\n\n**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.\n\nIf you want to code but don't know where to start, check out the issues labelled [\"help wanted\"](https://github.com/orbitdb/orbitdb/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22+sort%3Areactions-%2B1-desc).\n\n## Sponsors\n\nThe development of OrbitDB has been sponsored by:\n\n* [Protocol Labs](https://protocol.ai/)\n* [Haja Networks](https://haja.io)\n* [Maintainer Mountaineer](https://maintainer.io)\n* [OrbitDB Open Collective](https://opencollective.com/orbitdb)\n\nIf you want to sponsor developers to work on OrbitDB, please donate to our [OrbitDB Open Collective](https://opencollective.com/orbitdb) or reach out to [@haadcode](https://github.com/haadcode).\n\n## License\n\n[MIT](LICENSE) © 2015-2023 Protocol Labs Inc., Haja Networks Oy, OrbitDB Community\n","funding_links":["https://opencollective.com/orbitdb","https://github.com/orbitdb/funding"],"categories":["JavaScript","数据库管理系统","database","p2p"],"sub_categories":["网络服务_其他"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Forbitdb%2Forbitdb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Forbitdb%2Forbitdb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Forbitdb%2Forbitdb/lists"}