Skip to content

feat: add republish signed ipns records #745

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 15 commits into from
Mar 12, 2025
Merged

feat: add republish signed ipns records #745

merged 15 commits into from
Mar 12, 2025

Conversation

2color
Copy link
Member

@2color 2color commented Feb 24, 2025

What

Fixes #744

Change checklist

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation if necessary (this includes comments as well)
  • I have added tests that prove my fix is effective or that my feature works

@2color 2color requested a review from a team as a code owner February 24, 2025 12:46
@2color 2color requested a review from achingbrain February 25, 2025 11:07
Copy link
Member

@achingbrain achingbrain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - just needs @SgtPooki's comments addressing and it's ready.

@2color 2color requested a review from achingbrain March 11, 2025 12:15
@2color
Copy link
Member Author

2color commented Mar 11, 2025

I've made some changes to address @achingbrain's feedback from #745 (comment), taking in a key first and the value second. I also added the ability to pass in a string

@2color 2color requested a review from SgtPooki March 11, 2025 12:26
Copy link
Member

@achingbrain achingbrain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good, final few nits

if (typeof key === 'string') {
// Convert string key to MultihashDigest
try {
mh = this.#getPeerIdFromString(key).toMultihash()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we require string keys to be fully qualified? E.g. /ipns/...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mmmmm. According to the spec that's good practice but not required. I'd rather not, since the current APIs don't expect it, so this would be a bit contrived.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably strip any leading /ipns/ from the key then?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do in a follow up PR

@2color 2color requested a review from achingbrain March 11, 2025 13:09
Copy link
Member

@SgtPooki SgtPooki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 lgtm...

/**
* Convert a string to a PeerId
*/
#getPeerIdFromString (peerIdString: string): PeerId {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once libp2p/js-libp2p#3042 is released, we can just use peerIdFromString

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It has shipped

@2color 2color dismissed achingbrain’s stale review March 12, 2025 12:32

addressed feedback

@2color 2color changed the title feat: add republish record to ipns feat: add republish signed ipns records Mar 12, 2025
@2color 2color merged commit 91880b0 into main Mar 12, 2025
19 checks passed
@2color 2color deleted the republish-record branch March 12, 2025 15:09
@achingbrain achingbrain mentioned this pull request Mar 12, 2025
2color added a commit that referenced this pull request Mar 13, 2025
* origin/main:
  chore: use peer id parsing function from libp2p (#762)
  feat: add republish signed ipns records (#745)
  fix: use bytestream methods to add byte streams (#758)
  chore: bump codecov/codecov-action from 5.3.1 to 5.4.0 (#752)
  feat: allow modifying trustless-gateway fetch (#751)
  fix: align implicit default ttl with specs (#749)
  docs: add spell checker to ci (#743)
  chore: Update FUNDING.json for Optimism RPF (#746)
achingbrain pushed a commit that referenced this pull request Mar 13, 2025
Fixes #745 (comment)

---------

Co-authored-by: Daniel N <2color@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add ability to republish IPNS records without private key
3 participants