{"id":22270161,"url":"https://github.com/retrieval-markets-lab/js-graphsync","last_synced_at":"2026-03-08T21:38:08.720Z","repository":{"id":42386171,"uuid":"476812491","full_name":"retrieval-markets-lab/js-graphsync","owner":"retrieval-markets-lab","description":"Implementation of the GraphSync wire protocol in Typescript","archived":false,"fork":false,"pushed_at":"2023-09-01T09:06:55.000Z","size":135,"stargazers_count":21,"open_issues_count":1,"forks_count":6,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-11-19T16:44:01.882Z","etag":null,"topics":["filecoin","graphsync","ipfs","ipld","libp2p","unixfs"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/retrieval-markets-lab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"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":"2022-04-01T17:30:24.000Z","updated_at":"2024-09-19T09:39:45.000Z","dependencies_parsed_at":"2024-10-23T03:01:16.785Z","dependency_job_id":null,"html_url":"https://github.com/retrieval-markets-lab/js-graphsync","commit_stats":{"total_commits":22,"total_committers":1,"mean_commits":22.0,"dds":0.0,"last_synced_commit":"d5949f1806b0bdc7d80bf8bcdd5d984041886589"},"previous_names":["myelnet/js-graphsync"],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/retrieval-markets-lab%2Fjs-graphsync","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/retrieval-markets-lab%2Fjs-graphsync/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/retrieval-markets-lab%2Fjs-graphsync/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/retrieval-markets-lab%2Fjs-graphsync/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/retrieval-markets-lab","download_url":"https://codeload.github.com/retrieval-markets-lab/js-graphsync/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227914258,"owners_count":17839245,"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":["filecoin","graphsync","ipfs","ipld","libp2p","unixfs"],"created_at":"2024-12-03T12:07:30.160Z","updated_at":"2026-03-08T21:38:03.684Z","avatar_url":"https://github.com/retrieval-markets-lab.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GraphSync\n\n![](https://img.shields.io/badge/made%20by-Myel-blue)\n![](https://img.shields.io/github/license/myelnet/js-graphsync?color=green)\n\n\u003e JS implementation of the GraphSync v2 wire protocol.\n\n## Background\n\nGraphSync is an IPFS data transfer protocol used across the IPFS and Web3 ecosystem for exchanging\nIPLD data. It is used by Filecoin for syncing the blockchain and transfering DAGified content\nin a trustless fashion.\n\n## Install\n\n```\nnpm install @dcdn/graphsync\n```\n\n## Usage\n\nIt is recommended to use with the [WebTransport](https://github.com/libp2p/js-libp2p-webtransport) transport for best performance.\n\n```ts\nimport {createLibp2p} from \"libp2p\";\nimport {Noise} from \"@chainsafe/libp2p-noise\";\nimport {webTransport} from \"@libp2p/webtransport\";\nimport {MemoryBlockstore} from \"blockstore-core/memory\";\nimport {GraphSync, unixfsPathSelector, getPeer} from \"@dcdn/graphsync\";\n\nconst blocks = new MemoryBlockstore();\n\nconst libp2p = await createLibp2p({\n  transports: [webTransport()],\n  connectionEncryption: [() =\u003e new Noise()],\n});\nawait libp2p.start();\n    \nconst exchange = new GraphSync(libp2p, blocks);\n\nconst provider = getPeer(\"/ip4/127.0.0.1/tcp/41505/ws/p2p/12D3KooWCYiNWNDoprcW74NVCEKaMhSbrfMvY4JEMfWrV1JamSsA\");\nlibp2p.peerStore.addressBook.add(provider.id, provider.multiaddrs);\nconst [cid, selector] = unixfsPathSelector(\"bafyreiakhbtbs4tducqx5tcw36kdwodl6fdg43wnqaxmm64acckxhakeua/Cat.jpg\");\n\nconst request = exchange.request(cid, selector);\nrequest.open(provider.id);\n// Save the blocks into the store;\nawait request.drain();\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fretrieval-markets-lab%2Fjs-graphsync","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fretrieval-markets-lab%2Fjs-graphsync","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fretrieval-markets-lab%2Fjs-graphsync/lists"}