{"id":14483699,"url":"https://github.com/ipfs/js-dag-service","last_synced_at":"2025-04-09T16:03:02.117Z","repository":{"id":37964274,"uuid":"217971054","full_name":"ipfs/js-dag-service","owner":"ipfs","description":"Library for storing and replicating hash-linked data over the IPFS network.","archived":false,"fork":false,"pushed_at":"2025-01-24T10:07:00.000Z","size":1209,"stargazers_count":93,"open_issues_count":57,"forks_count":17,"subscribers_count":19,"default_branch":"default","last_synced_at":"2025-04-09T16:01:49.658Z","etag":null,"topics":["dag","decentralized","distributed","ipfs","ipld","p2p","peer-to-peer"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ipfs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"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}},"created_at":"2019-10-28T05:17:14.000Z","updated_at":"2025-04-04T02:15:59.000Z","dependencies_parsed_at":"2024-01-31T19:04:04.008Z","dependency_job_id":null,"html_url":"https://github.com/ipfs/js-dag-service","commit_stats":null,"previous_names":["textileio/js-ipfs-lite"],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ipfs%2Fjs-dag-service","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ipfs%2Fjs-dag-service/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ipfs%2Fjs-dag-service/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ipfs%2Fjs-dag-service/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ipfs","download_url":"https://codeload.github.com/ipfs/js-dag-service/tar.gz/refs/heads/default","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248065289,"owners_count":21041871,"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":["dag","decentralized","distributed","ipfs","ipld","p2p","peer-to-peer"],"created_at":"2024-09-03T00:02:00.175Z","updated_at":"2025-04-09T16:03:02.076Z","avatar_url":"https://github.com/ipfs.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# DAGService\n\n[![Chat on IRC](https://img.shields.io/badge/freenode-%23ipfs-blue.svg?style=flat-square)](http://webchat.freenode.net/?channels=%23ipfs)\n[![Chat on Matrix](https://img.shields.io/badge/matrix-%23ipfs%3Amatrix.org-blue.svg?style=popout-square)](https://riot.im/app/#/room/#ipfs-dev:matrix.org)\n[![GitHub package.json version](https://img.shields.io/github/package-json/v/ipfs/js-dag-service/default.svg?style=popout-square)](./package.json)\n[![npm (scoped)](https://img.shields.io/npm/v/dag-service.svg?style=popout-square)](https://www.npmjs.com/package/dag-service)\n[![Release](https://img.shields.io/github/release/textileio/js-ipfs-lite.svg?style=flat-square)](https://github.com/ipfs/js-dag-service/releases/latest)\n[![docs](https://img.shields.io/badge/docs-master-success.svg?style=popout-square)](https://ipfs.github.io/js-dag-service/)\n[![standard-readme compliant](https://img.shields.io/badge/standard--readme-OK-green.svg?style=flat-square)](https://github.com/RichardLitt/standard-readme)\n\n\u003e DAGService is a library for storing and replicating hash-linked\n\u003e data over the IPFS network.\n\nDAGService is aiming to be a bare minimum needed for [IPLD][]-based applications\nto interact with the IPFS network by getting and putting blocks to it.\n\n**NOTE** For now, this is a highly experimental library. Use with caution.\n\n\u003e This project was originally developed under the [@textileio](https://github.com/textileio/) organization, and was contributed to the IPFS community for ongoing maintenance and development.\n\n## Table of Contents\n\n- [Background](#background)\n- [Install](#install)\n- [Usage](#usage)\n- [API](#api)\n- [Maintainers](#maintainers)\n- [Contributing](#contributing)\n- [License](#license)\n\n## Background\n\nThe goal of DAGService to provied a minimal layer between data model of [IPLD][]\nand full blown [IPFS][]. It provides bare minimum functionality for any\napplication to interact with the IPFS network (by getting and putting [IPLD][]\nblocks) without having to deal with the complexities of operating a full\nIPFS node. It is an attempt to remake core piece of IPFS node reusable on it's\nown.\n\n### Why?\n\nBecause 99% of the time, a browser or mobile (d)App only needs to be able to add and get small bits of data over the IPFS network. This library provides that, in a much smaller package (currently less than 1/2 the size of `js-ipfs` without much optimization -- we will continue to optimize further). It is also highly extensible, so developers need only include the features they _need_, keeping load times fast, and (d)Apps feeling snappy. Additionally, Textile needed a Typescript-based IPFS solution, and we think others will find the type safety useful as well. Feel free to use the [Typescript declarations](https://github.com/ipfs/js-dag-service/tree/default/src/@types) in your own projects.\n\n## Install\n\n```\nnpm install dag-service\n```\n\n## Usage\n\n```typescript\nimport { Peer, BlockStore } from \"dag-service\"\n// Use any interface-datastore compliant store\nimport { MemoryDatastore } from \"interface-datastore\"\nimport Libp2p from \"libp2p\"\n\nconst store = new BlockStore(new MemoryDatastore())\n\nconst main = async () =\u003e {\n  // Bring your own libp2p host....\n  const host = new Libp2p({ ...libp2Options })\n  const lite = new Peer(store, host)\n\n  await lite.start()\n\n  const cid = \"QmWATWQ7fVPP2EFGu71UkfnqhYXDYH566qy47CnJDgvs8u\"\n  const data = await lite.getFile(cid)\n  console.log(data.toString())\n  // Hello World\n  await lite.stop()\n}\n```\n\nThere are also several useful examples included in the tests of this repo, with tools for creating a default `libp2p` host exported by default. We've also thrown in some useful interfaces to use when building on IPFS Lite, as well as the Buffer API for use in the browser.\n\n## API\n\nSee [https://ipfs.github.io/js-dag-service/](https://ipfs.github.io/js-dag-service/)\n\n## Maintainers\n\n- [Irakli Gozalishvili](https://github.com/gozala/)\n- [Carson Farmer](https://github.com/carsonfarmer)\n\n## Contribute\n\nFeel free to dive in! [Open an issue](https://github.com/ipfs/js-dag-service/issues/new) or submit PRs.\n\nTo contribute to IPFS in general, see the [contributing guide](https://github.com/ipfs/community/blob/master/CONTRIBUTING.md).\n\n[![](https://cdn.rawgit.com/jbenet/contribute-ipfs-gif/master/img/contribute.gif)](https://github.com/ipfs/community/blob/master/CONTRIBUTING.md)\n\nProject follows the [IPFS Community Code of Conduct](https://github.com/ipfs/community/blob/master/code-of-conduct.md)\n\n## License\n\nThe js-dag-service project is dual-licensed under Apache 2.0 and MIT terms:\n\n- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)\n- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)\n\n[ipld]: https://ipld.io/\n[ipfs]: https://ipfs.io/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fipfs%2Fjs-dag-service","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fipfs%2Fjs-dag-service","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fipfs%2Fjs-dag-service/lists"}