Skip to content

feat: indexer support for cbor encoding #139

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 14 commits into from
Mar 6, 2025

Conversation

NikolasHaimerl
Copy link
Contributor

Add support for DAG-CBOR encoded entries

This PR adds support for DAG-CBOR encoded entries (CIDs starting with "bafy", codec 0x71) in addition to the existing DAG-JSON format. This enables the piece-indexer to process advertisements from providers like Curio that use DAG-CBOR encoding.

The implementation:

  • Detects entry format from CID codec (297 for DAG-JSON, 113 for DAG-CBOR)
  • Handles both encoded formats appropriately
  • Includes comprehensive tests for both formats

Closes #119

Implementation Plan: #119 (comment)
Parent Issue: #132

@NikolasHaimerl NikolasHaimerl marked this pull request as ready for review March 3, 2025 12:04
Copy link
Member

@bajtos bajtos left a comment

Choose a reason for hiding this comment

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

Great start!

@NikolasHaimerl NikolasHaimerl requested a review from bajtos March 5, 2025 09:45
Copy link
Member

@bajtos bajtos left a comment

Choose a reason for hiding this comment

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

Almost there! 💪🏻

@NikolasHaimerl NikolasHaimerl requested a review from bajtos March 5, 2025 13:19
Copy link
Member

@bajtos bajtos left a comment

Choose a reason for hiding this comment

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

I love the new version without @ts-ignores 🤩

:shipit:

Copy link
Member

@bajtos bajtos left a comment

Choose a reason for hiding this comment

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

(I meant to approve the pull request.)

@NikolasHaimerl NikolasHaimerl enabled auto-merge (squash) March 6, 2025 08:11
@NikolasHaimerl NikolasHaimerl disabled auto-merge March 6, 2025 09:08
@NikolasHaimerl NikolasHaimerl merged commit 7a42b15 into main Mar 6, 2025
10 checks passed
@NikolasHaimerl NikolasHaimerl deleted the nhaimerl-indexer-support-for-cbor-encoding branch March 6, 2025 09:19
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.

Support DAG-CBOR encoded entries
2 participants