{"id":15152955,"url":"https://github.com/orbitdb-archive/ipfs-log","last_synced_at":"2025-09-30T01:32:11.781Z","repository":{"id":5861693,"uuid":"54105920","full_name":"orbitdb-archive/ipfs-log","owner":"orbitdb-archive","description":"Append-only log CRDT on IPFS","archived":true,"fork":false,"pushed_at":"2023-02-13T14:05:31.000Z","size":14674,"stargazers_count":398,"open_issues_count":23,"forks_count":55,"subscribers_count":22,"default_branch":"main","last_synced_at":"2024-09-18T02:12:44.385Z","etag":null,"topics":["crdt","data-structure","ipfs","ipfs-log","log-db","orbit","orbit-db","p2p"],"latest_commit_sha":null,"homepage":"https://orbitdb.github.io/ipfs-log/","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-archive.png","metadata":{"files":{"readme":"README.md","changelog":null,"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},"funding":{"github":null,"patreon":null,"open_collective":"orbitdb","ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2016-03-17T09:35:56.000Z","updated_at":"2024-09-08T16:34:52.000Z","dependencies_parsed_at":"2023-02-16T11:16:08.833Z","dependency_job_id":null,"html_url":"https://github.com/orbitdb-archive/ipfs-log","commit_stats":{"total_commits":739,"total_committers":26,"mean_commits":"28.423076923076923","dds":0.7050067658998647,"last_synced_commit":"d75ac9cb186178e89e7768b5d824cf55840d0c27"},"previous_names":["orbitdb-archive/ipfs-log","orbitdb/ipfs-log"],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orbitdb-archive%2Fipfs-log","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orbitdb-archive%2Fipfs-log/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orbitdb-archive%2Fipfs-log/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orbitdb-archive%2Fipfs-log/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/orbitdb-archive","download_url":"https://codeload.github.com/orbitdb-archive/ipfs-log/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219865579,"owners_count":16554163,"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","data-structure","ipfs","ipfs-log","log-db","orbit","orbit-db","p2p"],"created_at":"2024-09-26T16:42:14.637Z","updated_at":"2025-09-30T01:32:06.410Z","avatar_url":"https://github.com/orbitdb-archive.png","language":"JavaScript","funding_links":["https://opencollective.com/orbitdb"],"categories":[],"sub_categories":[],"readme":"# ipfs-log\n\n[![npm](https://img.shields.io/npm/v/ipfs-log.svg)](https://www.npmjs.com/package/ipfs-log)\n[![CircleCI Status](https://circleci.com/gh/orbitdb/ipfs-log.svg?style=shield)](https://circleci.com/gh/orbitdb/ipfs-log)\n[![Gitter](https://img.shields.io/gitter/room/nwjs/nw.js.svg)](https://gitter.im/orbitdb/Lobby) [![Matrix](https://img.shields.io/badge/matrix-%23orbitdb%3Apermaweb.io-blue.svg)](https://riot.permaweb.io/#/room/#orbitdb:permaweb.io) \n\n\n\u003e An append-only log on IPFS.\n\n`ipfs-log` is an immutable, operation-based conflict-free replicated data structure ([CRDT](https://en.wikipedia.org/wiki/Conflict-free_replicated_data_type)) for distributed systems. It's an append-only log that can be used to model a mutable, shared state between peers in p2p applications.\n\nEvery entry in the log is saved in IPFS and each points to a hash of previous entry(ies) forming a graph. Logs can be forked and joined back together.\n\nThe module works in **Node.js** and **Browsers**.\n\n```\n           Log A                Log B\n             |                    |\n     logA.append(\"one\")   logB.append(\"hello\")\n             |                    |\n             v                    v\n          +-----+             +-------+\n          |\"one\"|             |\"hello\"|\n          +-----+             +-------+\n             |                    |\n     logA.append(\"two\")   logB.append(\"world\")\n             |                    |\n             v                    v\n       +-----------+       +---------------+\n       |\"one\",\"two\"|       |\"hello\",\"world\"|\n       +-----------+       +---------------+\n             |                    |\n             |                    |\n       logA.join(logB) \u003c----------+\n             |\n             v\n+---------------------------+\n|\"one\",\"hello\",\"two\",\"world\"|\n+---------------------------+\n```\n\n\n## Table of Contents\n\n- [Background](#background)\n- [Install](#install)\n- [Usage](#usage)\n- [API](#api)\n- [Tests](#tests)\n- [Benchmarking](#benchmarking)\n- [Build](#build)\n- [Contribute](#contribute)\n- [License](#license)\n\n## Background\n\nIPFS Log has a few use cases:\n\n- CRDTs\n- Database operations log\n- Feed of data\n- Track a version of a file\n- Messaging\n\nIt was originally created for, and currently used in, [orbit-db](https://github.com/orbitdb/orbit-db) - a distributed peer-to-peer database on [IPFS](https://github.com/ipfs/ipfs).\n\n## Requirements\n\n- Node.js v8.6.0 or newer (uses `...` spread syntax)\n- Preferably you should use an LTS version of node.js (even numbered 8, 10, etc)\n\n## Install\n\nThis project uses [npm](http://npmjs.com/) and [nodejs](https://nodejs.org/).\n\n```\nnpm install ipfs-log\n```\n\n## Usage\n\nSee the [API documentation](#api) and [examples](https://github.com/orbitdb/ipfs-log/tree/master/examples) for more details.\n\n### Quick Start\n\nInstall dependencies:\n\n```\nnpm install ipfs-log ipfs\n```\n\nRun a simple program:\n\n```javascript\n\n// For js-ipfs \u003e= 0.38\n\nimport from Log 'ipfs-log'\nimport IdentityProvider from 'orbit-db-identity-provider'\nimport * as IPFS from 'ipfs'\n\nconst start = async () =\u003e {\n  const identity = await IdentityProvider.createIdentity({ id: \"peerid\" })\n  const ipfs = await IPFS.create({ repo: \"./path-for-js-ipfs-repo\" })\n  const log = new Log(ipfs, identity)\n\n  await log.append({ some: \"data\" })\n  await log.append(\"text\")\n  console.log(log.values.map((e) =\u003e e.payload))\n}\n\nstart()\n\n// [ { some: 'data' }, 'text' ]\n```\n\n### Node.js\n\nSee [examples](https://github.com/orbitdb/ipfs-log/tree/master/examples) for details.\n\n*If your platforms requires ES5-compatible JavaScript, there's a build in `lib/es5/`.*\n\n### Browser\n\nSee [examples/browser](https://github.com/orbitdb/ipfs-log/tree/master/examples/browser) for details.\n\n*The distribution package for browsers is located in [dist/ipfslog.min.js](https://github.com/orbitdb/ipfs-log/tree/master/dist)*\n\n*If your platforms requires ES5-compatible JavaScript, there's a build in `lib/es5/`.*\n\n## API\n\nSee [API Documentation](https://github.com/orbitdb/ipfs-log/tree/master/API.md) for full details.\n\n- [Log](https://github.com/orbitdb/ipfs-log/tree/master/API.md#log)\n  - [Constructor](https://github.com/orbitdb/ipfs-log/tree/master/API.md##constructor)\n    - [new Log(ipfs, identity, [{ logId, access, entries, heads, clock, sortFn }])](https://github.com/orbitdb/ipfs-log/tree/master/API.md##new-log-ipfs-id)\n  - [Properties](https://github.com/orbitdb/ipfs-log/tree/master/API.md##properties)\n    - [id](https://github.com/orbitdb/ipfs-log/tree/master/API.md##id)\n    - [values](https://github.com/orbitdb/ipfs-log/tree/master/API.md##values)\n    - [length](https://github.com/orbitdb/ipfs-log/tree/master/API.md##length)\n    - [clock](https://github.com/orbitdb/ipfs-log/tree/master/API.md##length)\n    - [heads](https://github.com/orbitdb/ipfs-log/tree/master/API.md##heads)\n    - [tails](https://github.com/orbitdb/ipfs-log/tree/master/API.md##tails)\n  - [Methods](https://github.com/orbitdb/ipfs-log/tree/master/API.md##methods)\n    - [append(data)](https://github.com/orbitdb/ipfs-log/tree/master/API.md##appenddata)\n    - [join(log)](https://github.com/orbitdb/ipfs-log/tree/master/API.md##joinlog)\n    - [toMultihash()](https://github.com/orbitdb/ipfs-log/tree/master/API.md##tomultihash)\n    - [toBuffer()](https://github.com/orbitdb/ipfs-log/tree/master/API.md##tobuffer)\n    - [toString()](https://github.com/orbitdb/ipfs-log/tree/master/API.md##toString)\n  - [Static Methods](https://github.com/orbitdb/ipfs-log/tree/master/API.md##static-methods)\n    - [Log.fromEntry()]()\n    - [Log.fromEntryCid()]()\n    - [Log.fromCID()]()\n    - [Log.fromMultihash()]()\n\n## Tests\n\nRun all tests:\n```\nnpm test\n```\n\nRun tests with js-ipfs only (default):\n```\nmocha\n```\n\nRun tests with go-ipfs only:\n```\nTEST=go mocha\n```\n\n## Benchmarking\n\nTo use the benchmark runner:\n\n```JavaScript\nnode --expose-gc benchmarks/runner/index.js -r --grep append-stress --stress-limit Infinity\n```\n\nThis will run the `append-stress` benchmarks until it is canceled. For more information, see the [Benchmarking README](./benchmarks/README.md).\n\n## Build\n\nRun the following command before you commit.\n\n```\nmake rebuild\n```\n\nThis will ensure that dependencies and built files are all based on the current code base.\n\n## Benchmarks\n\nThere's a benchmark suite in [benchmarks/](https://github.com/orbitdb/ipfs-log/blob/master/benchmarks) that can be run with:\n\n```\nnode benchmarks/benchmark-append.js\nnode benchmarks/benchmark-join.js\nnode benchmarks/benchmark-expand.js\n```\n\nThere's `append` and `join` benchmarks for browsers in [benchmarks/browser/](https://github.com/orbitdb/ipfs-log/blob/master/benchmarks/browser) which you can run by opening the `.html` files in your browser.\n\n## Contribute\n\nIf you find a bug or something is broken, let us know! PRs and [issues](https://github.com/orbitdb/ipfs-log/issues) are gladly accepted too. Take a look at the open issues, too, to see if there is anything that you could do or someone else has already done. Here are some things I know I need:\n\n### TODO\n\n- Support for payload encryption\n\n## License\n\n[MIT](LICENSE) © 2016-2018 Protocol Labs Inc.,\n2016-2019 Haja Networks Oy\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Forbitdb-archive%2Fipfs-log","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Forbitdb-archive%2Fipfs-log","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Forbitdb-archive%2Fipfs-log/lists"}