ipfs/go-graphsync

Expose RequestMetadata method on graphsync client

hannahhoward opened this issue · 0 comments

What

To support metadata only requests, we implement a new method on the graphsync TLI:

// GraphExchange is a protocol that can exchange IPLD graphs based on a selector
type GraphExchange interface {
        // ...
	// RequestMetadata initiates a new GraphSync metadata request to query a remote peer for the CIDs that make up a selector query. It returns raw responses from the other peer and does not verify results
	RequestMetadata(ctx context.Context, p peer.ID, root ipld.Link, selector ipld.Node, extensions ...ExtensionData) (<-chan ResponseData, <-chan error)
}

Suggested Implementation

Modify RequestManager so that when we execute a metadata request, we immediately send the to the other peer, but instead of feeding the responses into a selector verification, we simply past them back to the caller.