ipfs/js-ipns

feature request: support extensible data fields

tabcat opened this issue · 5 comments

I would like to add support for extensible data to this implementation of the IPNS record.

This could be done by:

  1. adding an optional extensibleData field to CreateOptions.
  2. adding an optional parameter extensibleData to createCborData.
  3. inside of createCborData, merge extensibleData the data object.
  4. add tests and documentation

It's not necessary to change types or add generics to the record type. Users of this feature would simply have to decode IPNSRecord.data to read any extensible fields.

Thank you for submitting your first issue to this repository! A maintainer will be here shortly to triage and review.
In the meantime, please double-check that you have provided all the necessary information to make this process easy! Any information that can help save additional round trips is useful! We currently aim to give initial feedback within two business days. If this does not happen, feel free to leave a comment.
Please keep an eye on how this issue will be labeled, as labels give an overview of priorities, assignments and additional actions requested by the maintainers:

  • "Priority" labels will show how urgent this is for the team.
  • "Status" labels will show if this is ready to be worked on, blocked, or in progress.
  • "Need" labels will indicate if additional input or analysis is required.

Finally, remember to use https://discuss.ipfs.io if you just need general support.

Thank you for posting this issue, I had the exact same question, and you saved me the time reading through the docs

Oh look what I found,

* extensible data

It's just waiting for a pull request

@tabcat I got a working POC of extendable for js-ipns in this pull requres

#309

@tabcat if you want to use it check my tests, https://github.com/dentropy/js-ipns/blob/main/test/extensible_data.spec.ts

You have to recast js-ipns type IPNSRecordData as any to get the data out