https://github.com/martinheidegger/hyper-dns
DNS lookup for dat/hyper archives
https://github.com/martinheidegger/hyper-dns
cabal dat dns-lookup hyper-dns hypercore-protocol
Last synced: 19 days ago
JSON representation
DNS lookup for dat/hyper archives
- Host: GitHub
- URL: https://github.com/martinheidegger/hyper-dns
- Owner: martinheidegger
- License: mit
- Created: 2021-03-29T19:09:13.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2021-09-16T00:03:37.000Z (over 3 years ago)
- Last Synced: 2025-04-09T07:49:12.970Z (about 1 month ago)
- Topics: cabal, dat, dns-lookup, hyper-dns, hypercore-protocol
- Language: JavaScript
- Homepage:
- Size: 268 KB
- Stars: 13
- Watchers: 4
- Forks: 3
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- Contributing: docs/contributing.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: docs/code_of_conduct.md
Awesome Lists containing this project
README
# hyper-dns
Advanced resolving of decentralized web links using different name systems such as DNS Txt entries and `.well-known` https lookups locations.
It implements various naming systems such as [dat][], [hyper][] and [cabal][] but is extensible to support other systems as well.[hyper]: https://hypercore-protocol.org/
[dat]: https://www.datprotocol.com/deps/0005-dns/
[cabal]: https://cabal.chat/
[ara]: https://ara.one/## π Basic API
After installing it through [npm][hyper-dns-npm], you can simply run it like this:
```js
const { resolveProtocol, resolve, resolveURL } = require('hyper-dns')
const protocol = 'dat'
const domain = 'dat-ecosystem.org'
const key = await resolveProtocol(protocol, domain)
```> Note: You may need to wrap it in a `async` function until [top level async/await][] lands.
That's it! π - in the `key` variable you will get the `dat` key or `null`, if it can't be found.
[hyper-dns-npm]: https://npmjs.com/package/hyper-dns
[top level async/await]: https://github.com/tc39/proposal-top-level-await## π§ββοΈ What is this magic?
Different decentralized web systems have different means to resolve _"names"_ to a decentralized document.
`hyper-dns` contains a variety of implementations. Many are using [DNS TXT records][] that contain a key of specified pattern, but other means are possible as well. β (more in the [Protocol Guide][])
The power of `hyper-dns` in comparison to other, protocol-specific implementations is that it has a shared cache for all protocols, it works in he browser and does a list of things well. β (more in the [Architecture Overview][])
[DNS TXT records]: https://en.wikipedia.org/wiki/TXT_record
## π©βπ Further reading
- [Architecture Overview][] _β¦to learn how caching and other things work._ π΅οΈββοΈ
- [API documentation][] _β¦for getting to know the API in detail._ π§βπ»
- [Contribution Guide][] _β¦because help is always welcome._ π₯³
- [Protocol Guide][] _β¦for current protocols and adding new ones._ π€[Architecture Overview]: ./docs/architecture.md
[API documentation]: ./docs/api.md
[Contribution Guide]: ./docs/contributing.md
[Protocol Guide]: ./docs/protocol.md## π License
[MIT License](./LICENSE)