{"id":38014086,"url":"https://github.com/ipni/caskadht","last_synced_at":"2026-01-16T19:23:29.433Z","repository":{"id":65950302,"uuid":"593590415","full_name":"ipni/caskadht","owner":"ipni","description":":knot: Cascades lookups to the IPFS Kademlia DHT","archived":false,"fork":false,"pushed_at":"2024-12-12T09:52:03.000Z","size":374,"stargazers_count":6,"open_issues_count":3,"forks_count":0,"subscribers_count":7,"default_branch":"main","last_synced_at":"2024-12-12T10:30:48.565Z","etag":null,"topics":["cascade","dht","lookup"],"latest_commit_sha":null,"homepage":"","language":"Go","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/ipni.png","metadata":{"files":{"readme":"README.md","changelog":null,"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-01-26T11:47:18.000Z","updated_at":"2024-12-12T09:52:06.000Z","dependencies_parsed_at":"2023-12-19T09:59:55.822Z","dependency_job_id":"1f4368c4-a0e3-4ac0-8a6c-dcf128c86f97","html_url":"https://github.com/ipni/caskadht","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/ipni/caskadht","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ipni%2Fcaskadht","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ipni%2Fcaskadht/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ipni%2Fcaskadht/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ipni%2Fcaskadht/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ipni","download_url":"https://codeload.github.com/ipni/caskadht/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ipni%2Fcaskadht/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28481680,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T11:59:17.896Z","status":"ssl_error","status_checked_at":"2026-01-16T11:55:55.838Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["cascade","dht","lookup"],"created_at":"2026-01-16T19:23:29.329Z","updated_at":"2026-01-16T19:23:29.419Z","avatar_url":"https://github.com/ipni.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# :knot: caskadht\n\n`caskadht`, pronounced \"Cascade-DHT\", is a service that:\n\n* exposes:\n    * `GET /routing/v1/providers/\u003ccid\u003e` compatible with\n      IPFS [HTTP delegated routing](https://github.com/ipfs/specs/pull/337), and\n    * `GET /multihash/\u003cmultihash\u003e` compatible\n      with [IPNI HTTP query API](https://github.com/ipni/specs/blob/main/IPNI.md#get-multihashmultihash)\n* cascades lookup requests over the IPFS Kademlia DHT,\n* uses the accelerated DHT client when possible, and\n* steams the results back over `ndjson` whenever the request `Accept` header permits it, or\n  non-streaming JSON otherwise.\n\n## Install\n\nTo install `caskadht` CLI directly via Golang, run:\n\n```shell\n$ go install github.com/ipni/caskadht/cmd/caskadht@latest\n```\n\n## Usage\n\n```shell\n$ caskadht \nUsage of caskadht:\n  -httpListenAddr string\n        The caskadht HTTP server listen address in address:port format. (default \"0.0.0.0:40080\")\n  -httpResponsePreferJson\n        Whether to prefer responding with JSON instead of NDJSON when Accept header is set to \"*/*\".\n  -ipniCascadeLabel string\n        The IPNI cascade label associated to this instance. (default \"ipfs-dht\")\n  -ipniRequireQueryParam\n        Weather to require IPNI \"cascade\" query parameter with matching label in order to respond to HTTP lookup requests. Not required by default.\n  -libp2pIdentityPath string\n        The path to the marshalled libp2p host identity. If unspecified a random identity is generated.\n  -libp2pListenAddrs string\n        The comma separated libp2p host listen multiaddrs. If unspecified the default listen multiaddrs are used at ephemeral port.\n  -logLevel string\n        The logging level. Only applied if GOLOG_LOG_LEVEL environment variable is unset. (default \"info\")\n  -useAcceleratedDHT\n        Weather to use accelerated DHT client when possible. (default true)\n```\n\n### Run Server Locally\n\nTo run the `caskadht` HTTP server locally, execute:\n\n```shell\n$ go run cmd/caskadht/main.go\n```\n\nThe above command starts the HTTP API exposed on default listen address: `http://localhost:40080`.\nYou can then start looking up multihashes, which would cascade onto the DHT.\n\nTo shutdown the server, interrupt the terminal by pressing `Ctrl + C`\n\n#### Example IPNI `ndjson` response:\n\n```text\n$ curl http://localhost:40080/multihash/QmfQJymEUXsGNzHMmpGYmUcFiAtGw2ia97EXNDVDZbZjgm -v --max-time 1\n*   Trying 127.0.0.1:40080...\n* Connected to localhost (127.0.0.1) port 40080 (#0)\n\u003e GET /multihash/QmfQJymEUXsGNzHMmpGYmUcFiAtGw2ia97EXNDVDZbZjgm HTTP/1.1\n\u003e Host: localhost:40080\n\u003e User-Agent: curl/7.86.0\n\u003e Accept: */*\n\u003e \n* Mark bundle as not supporting multiuse\n\u003c HTTP/1.1 200 OK\n\u003c Connection: Keep-Alive\n\u003c Content-Type: application/x-ndjson\n\u003c X-Content-Type-Options: nosniff\n\u003c Date: Sat, 28 Jan 2023 18:06:44 GMT\n\u003c Transfer-Encoding: chunked\n\u003c \n{\"ContextID\":\"aXBmcy1kaHQtY2FzY2FkZQ==\",\"Metadata\":\"gBI=\",\"Provider\":{\"ID\":\"12D3KooWSnniGsyAF663gvHdqhyfJMCjWJv54cGSzcPiEMAfanvU\",\"Addrs\":[\"/ip6/2604:1380:45f1:8400::1/tcp/4002/ws\",\"/ip4/145.40.89.195/tcp/4002/ws\",\"/ip6/2604:1380:45f1:8400::1/tcp/4001\",\"/ip4/145.40.89.195/tcp/4001\"]}}\n{\"ContextID\":\"aXBmcy1kaHQtY2FzY2FkZQ==\",\"Metadata\":\"gBI=\",\"Provider\":{\"ID\":\"12D3KooWEDMw7oRqQkdCJbyeqS5mUmWGwTp8JJ2tjCzTkHboF6wK\",\"Addrs\":[\"/ip6/2604:1380:45e1:2700::3/tcp/4001\",\"/ip6/2604:1380:45e1:2700::3/tcp/4002/ws\",\"/ip4/139.178.68.91/tcp/4001\",\"/ip4/139.178.68.91/tcp/4002/ws\"]}}\n{\"ContextID\":\"aXBmcy1kaHQtY2FzY2FkZQ==\",\"Metadata\":\"gBI=\",\"Provider\":{\"ID\":\"12D3KooWRgXWwnZQJgdW1GHW7hJ5UvZ8MLp7HBCSWS596PypAs8M\",\"Addrs\":[\"/ip4/147.75.49.91/tcp/4002/ws\",\"/ip6/2604:1380:45e1:2700::b/tcp/4001\",\"/ip6/2604:1380:45e1:2700::b/tcp/4002/ws\",\"/ip4/147.75.49.91/tcp/4001\"]}}\n* Operation timed out after 1005 milliseconds with 1890 bytes received\n* Closing connection 0\ncurl: (28) Operation timed out after 1005 milliseconds with 1890 bytes received\n```\n\n#### Example IPFS Delegated Routing `ndjson` Response\n\n```text\n$ curl  http://localhost:40080/routing/v1/providers/QmfQJymEUXsGNzHMmpGYmUcFiAtGw2ia97EXNDVDZbZjgm -v --max-time 1\n*   Trying 127.0.0.1:40080...\n* Connected to localhost (127.0.0.1) port 40080 (#0)\n\u003e GET /routing/v1/providers/QmfQJymEUXsGNzHMmpGYmUcFiAtGw2ia97EXNDVDZbZjgm HTTP/1.1\n\u003e Host: localhost:40080\n\u003e User-Agent: curl/7.86.0\n\u003e Accept: */*\n\u003e \n* Mark bundle as not supporting multiuse\n\u003c HTTP/1.1 200 OK\n\u003c Connection: Keep-Alive\n\u003c Content-Type: application/x-ndjson\n\u003c X-Content-Type-Options: nosniff\n\u003c Date: Sat, 28 Jan 2023 18:07:40 GMT\n\u003c Transfer-Encoding: chunked\n\u003c \n{\"Protocol\":\"transport-bitswap\",\"Schema\":\"bitswap\",\"ID\":\"12D3KooWHVXoJnv2ifmr9K6LWwJPXxkfvzZRHzjiTZMvybeTnwPy\",\"Addrs\":[\"/ip4/145.40.89.101/tcp/4001\",\"/ip4/145.40.89.101/tcp/4002/ws\",\"/ip4/145.40.89.101/udp/4001/quic\",\"/ip6/2604:1380:45f1:d800::1/tcp/4001\",\"/ip6/2604:1380:45f1:d800::1/tcp/4002/ws\",\"/ip6/2604:1380:45f1:d800::1/udp/4001/quic\"]}\n{\"Protocol\":\"transport-bitswap\",\"Schema\":\"bitswap\",\"ID\":\"12D3KooWDpp7U7W9Q8feMZPPEpPP5FKXTUakLgnVLbavfjb9mzrT\",\"Addrs\":[\"/ip4/147.75.80.75/tcp/4001\",\"/ip4/147.75.80.75/tcp/4002/ws\",\"/ip4/147.75.80.75/udp/4001/quic\",\"/ip6/2604:1380:4601:f600::5/tcp/4001\",\"/ip6/2604:1380:4601:f600::5/tcp/4002/ws\",\"/ip6/2604:1380:4601:f600::5/udp/4001/quic\"]}\n{\"Protocol\":\"transport-bitswap\",\"Schema\":\"bitswap\",\"ID\":\"12D3KooWCrBiagtZMzpZePCr1tfBbrZTh4BRQf7JurRqNMRi8YHF\",\"Addrs\":[\"/ip4/147.75.87.65/tcp/4001\",\"/ip4/147.75.87.65/tcp/4002/ws\",\"/ip4/147.75.87.65/udp/4001/quic\",\"/ip6/2604:1380:4601:f600::1/tcp/4001\",\"/ip6/2604:1380:4601:f600::1/tcp/4002/ws\",\"/ip6/2604:1380:4601:f600::1/udp/4001/quic\"]}\n{\"Protocol\":\"transport-bitswap\",\"Schema\":\"bitswap\",\"ID\":\"12D3KooWRNijznEQoXrxBeNLb2TqbSFm8gG8jKtfEsbC1C9nPqce\",\"Addrs\":[\"/ip4/147.75.87.211/tcp/4001\",\"/ip4/147.75.87.211/tcp/4002/ws\",\"/ip4/147.75.87.211/udp/4001/quic\",\"/ip6/2604:1380:4601:f600::3/tcp/4001\",\"/ip6/2604:1380:4601:f600::3/tcp/4002/ws\",\"/ip6/2604:1380:4601:f600::3/udp/4001/quic\"]}\n* Operation timed out after 1001 milliseconds with 1378 bytes received\n* Closing connection 0\ncurl: (28) Operation timed out after 1001 milliseconds with 1378 bytes received\n```\n\n## License\n\n[SPDX-License-Identifier: Apache-2.0 OR MIT](LICENSE.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fipni%2Fcaskadht","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fipni%2Fcaskadht","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fipni%2Fcaskadht/lists"}