{"id":19294569,"url":"https://github.com/web3-storage/gendex","last_synced_at":"2026-04-18T03:32:36.181Z","repository":{"id":168691869,"uuid":"644450307","full_name":"web3-storage/gendex","owner":"web3-storage","description":"🗂️ Cloudflare worker to generate indexes for a given root CID","archived":false,"fork":false,"pushed_at":"2023-06-27T10:35:10.000Z","size":9621,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-02-24T00:28:07.200Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/web3-storage.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","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":"2023-05-23T14:38:45.000Z","updated_at":"2023-06-21T18:58:12.000Z","dependencies_parsed_at":null,"dependency_job_id":"fba66c45-56d6-4949-ae38-6a2590196e2e","html_url":"https://github.com/web3-storage/gendex","commit_stats":null,"previous_names":["web3-storage/gendex"],"tags_count":18,"template":false,"template_full_name":null,"purl":"pkg:github/web3-storage/gendex","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/web3-storage%2Fgendex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/web3-storage%2Fgendex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/web3-storage%2Fgendex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/web3-storage%2Fgendex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/web3-storage","download_url":"https://codeload.github.com/web3-storage/gendex/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/web3-storage%2Fgendex/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31955712,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T00:39:45.007Z","status":"online","status_checked_at":"2026-04-18T02:00:07.018Z","response_time":103,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-11-09T22:38:44.237Z","updated_at":"2026-04-18T03:32:36.143Z","avatar_url":"https://github.com/web3-storage.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gendex\n\n\u003cp\u003e\n  \u003ca href=\"https://github.com/web3-storage/gendex/actions/workflows/release.yml\"\u003e\u003cimg alt=\"GitHub Workflow Status\" src=\"https://img.shields.io/github/actions/workflow/status/web3-storage/gendex/test.yml?branch=main\u0026style=for-the-badge\" /\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/web3-storage/gendex/blob/main/LICENSE.md\"\u003e\u003cimg alt=\"License: Apache-2.0 OR MIT\" src=\"https://img.shields.io/badge/LICENSE-Apache--2.0%20OR%20MIT-yellow?style=for-the-badge\" /\u003e\u003c/a\u003e\n\u003c/p\u003e\n\nCloudflare worker to generate indexes for a given root CID. The CAR CID should already exist in CARPARK.\n\n## Usage\n\n* [`POST /shard/:root-cid/:car-cid`](#post-shardroot-cidcar-cid) - Build a CAR index.\n* [`POST /indexes/generate`](#post-indexes-generate) - Get blockly index data for blocks in the passed CAR shards.\n* [`POST /indexes`](#post-indexes) - Write block indexes.\n* [`PUT /block/:cid`](#put-blockcid) - Write a block index.\n\n### `POST /shard/:root-cid/:car-cid`\n\nBuild a CAR index in SATNAV for `:car-cid` and add an entry in DUDEWHERE for the CAR for the root `:root-cid`.\n\nExample:\n\n```sh\ncurl -X POST https://gendex.worker/shard/bafybeia7yvvioltmupfxvkcfef75htxqbyylpot5ddxuzla5zaokjyrvfu/bagbaierai3ot5krlbplbapqbym5immraoercsqwz2v226i77dcxnxrfaazbq\n```\n\nNote: if a DAG exists in multiple CARs, you'll need to send multiple requests with the same root CID for each CAR CID.\n\nResponse:\n\n```json\n{\n  \"shard\": {\n    \"/\": \"bagbaierai3ot5krlbplbapqbym5immraoercsqwz2v226i77dcxnxrfaazbq\"\n  },\n  \"shard_size\": 980242,\n  \"index_size\": 110,\n  \"shards\": [\n    {\n      \"/\": \"bagbaiera5etmvuesawkbpt7wdcrahsy43rr7mpux5iki2asggb4ps27ovyta\"\n    },\n    {\n      \"/\": \"bagbaiera5rsd3yrhibnsmmeq4vertwiguu5prjpj54kvpo3turtxdm2mpp3q\"\n    },\n    {\n      \"/\": \"bagbaiera6awehe5enzflfj3dssk3g7pv6xwawcxlglbn5muveo6lu7fb2yrq\"\n    }\n  ],\n  \"root\": {\n    \"/\": \"bafybeia7yvvioltmupfxvkcfef75htxqbyylpot5ddxuzla5zaokjyrvfu\"\n  }\n}\n```\n\n### `POST /indexes`\n\nGet blockly indexes for the blocks in the passed CAR shards in the request body.\n\nExample:\n\n```sh\ncurl -X POST https://gendex.worker/index\n# TODO: example needs body data\n```\n\nReturns an nddagjson response:\n\n```js\n{\n  shard: CID(bagbaieradoadc65goax2aehjn73oevbx6cbxjl5xp7k4vii24635mxkki42q)\n  block: CID(bafybeifsspna7evg6wtxfluwbt36c3e4yapq6vze3vaut2izwl72ombxrm),\n  offset: 862398,\n  length: 831,\n  links: [\n    {\n      shard: CID(bagbaieradoadc65goax2aehjn73oevbx6cbxjl5xp7k4vii24635mxkki42q),\n      block: CID(bafkreibwp3p5adaxnk2y5ecqliqq3sqmwe66j2cxcmykn3tnxewdc47hie),\n      offset: 21,\n      length: 60033\n    },\n    {\n      shard: CID(bagbaieradoadc65goax2aehjn73oevbx6cbxjl5xp7k4vii24635mxkki42q),\n      block: CID(bafkreidqychd3wyw4rixs2avqdkvlp6q7is4w3c6q2ef5h4hx77rkmm6xa),\n      offset: 60057,\n      length: 54154\n    },\n    {\n      shard: CID(bagbaieradoadc65goax2aehjn73oevbx6cbxjl5xp7k4vii24635mxkki42q),\n      block: CID(bafkreicpfqmunngoi5vixmfhbngefx5sdpo4tqbtbbdxdrgyuosohbki3i),\n      offset: 114214,\n      length: 45056\n    }\n  ]\n}\n```\n\n### `PUT /block/:cid`\n\nPut a block index for `:cid`.\n\nThe request body should be a [multi-index index](https://github.com/alanshaw/cardex#multi-index-index) with the index information for the block AND it's links.\n\nThe index is written to `\u003cbase58(block-multihash)\u003e/\u003cbase58(index-multihash)\u003e.idx`\n\nNote: block indexes are keyed by base58btc multibase encoded multihash. They are [multi-index indexes](https://github.com/alanshaw/cardex#multi-index-index) that index the block _as well as_ it's links.\n\nA \"symlink\" is written to `\u003cbase58(block-multihash)\u003e/.idx`. The file contains the multihash of an index for the block.\n\nExample:\n\n```sh\ncurl -X PUT https://gendex.worker/block/bafybeifvf4imqksp7d5tkbf6hsxx7bg5kexbpdojfrl7ibrpi3mzaws3b4\n# TODO: example needs body data\n```\n\n## Contributing\n\nFeel free to join in. All welcome. Please [open an issue](https://github.com/web3-storage/gendex/issues)!\n\n## License\n\nDual-licensed under [MIT + Apache 2.0](https://github.com/web3-storage/gendex/blob/main/LICENSE.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fweb3-storage%2Fgendex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fweb3-storage%2Fgendex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fweb3-storage%2Fgendex/lists"}