Skip to content

feat: return providing peer(s) in bitswap:want-block:block event #586

@SgtPooki

Description

@SgtPooki

Question

Using Helia, when I download the contents of a CID, could I easily see which node I ultimately retrieved the data from? How would I do that?

Answer

This could be added to bitswap - the hasBlock method here would need the id of the providing peer added as an argument, then the bitswap:want-block:block event could hold both the CID of the incoming block and the providing peer when it's emitted here.

It's worth noting that if the DAG referenced by a CID is made from multiple blocks, these blocks could come from different peers, so it'd be more like "which node(s)" rather than "which node".

This question came across in ip-js channel on slack: https://filecoinproject.slack.com/archives/C046HDAHA13/p1689877647075909

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Medium: Good to have, but can wait until someone steps upeffort/hoursEstimated to take one or several hoursexp/beginnerCan be confidently tackled by newcomersgood first issueGood issue for new contributorshelp wantedSeeking public contribution on this issuekind/enhancementA net-new feature or improvement to an existing featurestatus/readyReady to be worked

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions