ipfs / ipfs/js-ipfs-bitswap

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

Open
#586 1 comment 1 reaction 0 assignees View on GitHub
effort/hours exp/beginner good first issue help wanted kind/enhancement P2 status/ready
Dominant language
TypeScript
Stars
75
Forks
43
PR merge metrics
No merged PRs in 30d

Description

### 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?
> - @TheDiscordian

### Answer

> This could be added to bitswap - the hasBlock method [here](https://github.com/ipfs/js-ipfs-bitswap/blob/79974a5b165d84b878f25bb11ac63639d4e3e093/src/notifications.ts#L34C3-L38) 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](https://github.com/ipfs/js-ipfs-bitswap/blob/79974a5b165d84b878f25bb11ac63639d4e3e093/src/notifications.ts#L67).
>
> 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".
> - @achingbrain

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

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.