holepunchto / hyperdrive

Hyperdrive is a secure, real time distributed file system
Apache License 2.0
1.86k stars 135 forks source link

Set the Header in the metadata feed to `hyperdrive` #294

Closed RangerMauve closed 3 years ago

RangerMauve commented 4 years ago

Currently, it looks like there's no way to differentiate between a Hyperdrive, regular Hypertrie, or some sort of MountableHypertrie.

This could make things hard for dynamic logic based on the type of a hypercore in stuff like pinning services.

I propose modifying the setMetadata method in hypertrie and mountable-hypertrie to accept an additional type parameter which we could use to pass the type into.

I think this will also help for when we have additional datastructures built on top of hypertrie in the ecosystem.

Alternately, would it make sense to add a subtype to the header to specify the additional type that's building on top of the hypertrie?

Refs: