Skip to content
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

feat!: support paths in @helia/ipns #410

Merged
merged 5 commits into from
Jan 31, 2024

Conversation

SgtPooki
Copy link
Member

@SgtPooki SgtPooki commented Jan 30, 2024

fixes #402

We will likely want to add support for publishing with paths as well,

async publish (key: PeerId, value: CID | PeerId, options: PublishOptions = {}): Promise<IPNSRecord> {
but I may need to understand nuance to implement that

BREAKING CHANGE: @helia/ipns resolve now supports paths, so the return type is now { path: string, cid: CID } instead of just CID

Before

const cidFromPeerId = await ipns.resolve(peerId)
const cidFromDnsLink = await ipns.resolve(domainName)

After

const { cid, path } = await ipns.resolve(peerId)
const { cid, path } = await ipns.resolve(domainName)

BREAKING CHANGE: ipns resolve now supports paths, so the return type is
now `{ path: string, cid: CID }` instead of just `CID`

\#### Before

\```typescript
const cidFromPeerId = await ipns.resolve(peerId)
const cidFromDnsLink = await ipns.resolve(domainName)
\```

\#### After

\```typescript
const { cid, path } = await ipns.resolve(peerId)
const { cid, path } = await ipns.resolve(domainName)
\```
@SgtPooki SgtPooki requested a review from a team as a code owner January 30, 2024 20:09
@SgtPooki SgtPooki linked an issue Jan 30, 2024 that may be closed by this pull request
@SgtPooki SgtPooki changed the title feat!: supports paths feat!: @helia/ipns supports paths Jan 30, 2024
@achingbrain achingbrain changed the title feat!: @helia/ipns supports paths feat!: support paths in @helia/ipns Jan 31, 2024
@achingbrain achingbrain merged commit ca8d5eb into main Jan 31, 2024
19 checks passed
@achingbrain achingbrain deleted the 402-bug-heliaipns-should-allow-dnslink-paths branch January 31, 2024 16:49
@achingbrain achingbrain mentioned this pull request Jan 31, 2024
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.

bug: @helia/ipns should allow dnslink paths.
2 participants