https://github.com/rangermauve/resolve-hyper-structure
Library for resolving a `hyper://` URL to a hypercore-protocol based data structure
https://github.com/rangermauve/resolve-hyper-structure
Last synced: 9 days ago
JSON representation
Library for resolving a `hyper://` URL to a hypercore-protocol based data structure
- Host: GitHub
- URL: https://github.com/rangermauve/resolve-hyper-structure
- Owner: RangerMauve
- License: agpl-3.0
- Created: 2020-08-24T16:57:22.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-08-26T23:32:57.000Z (over 4 years ago)
- Last Synced: 2025-04-01T01:51:45.161Z (about 2 months ago)
- Language: JavaScript
- Size: 16.6 KB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# resolve-hyper-structure
Library for resolving a `hyper://` URL to a hypercore-protocol based data structure## How it will work (TODO)
- Check for a hypercore header in the `0` index.
- If the `length` is `0`, wait for a peer to get some data? (MAYBE)
- If you get some data and `0` isn't a header, assume it's a regular hypercore
- Try to map the header to the datastructure and pass in the hypercore
- Assume that `hypertrie` with a `metadata` of 64 bytes is a Hyperdrive
- Try to get [this](https://github.com/hypercore-protocol/hyperdrive/issues/294) merged to make life easier.-## API
```js
const resolveHyperStrucutre = require('resolve-hyper-structure')const {type, metadata} = await resolveHyperStrucutre(hypercore)
```