Goals
If we want to do accurate accounting of data received from a single peer, i.e. what I will need in order to properly implement bitswap as a transport for go-data-transfer, an external consumer needs a way to determine what peer actually gave me a block requested to exchange.Fetcher. I see two ways one can do this:
- Modify exchange.Fetcher's return values
- Provide some kind of hook/listener mechanism on receiving a block that has this information.
My gut is that the second is the simpler one to do and probably works most easily for the go-data-transfer integration anyway, plus it works well for people who want to collect metrics about who sends them stuff.