ipfs / ipfs/go-graphsync

Expose RequestMetadata method on graphsync client

Open
#373 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
103
Forks
41
PR merge metrics
No merged PRs in 30d

Description

# What

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

```golang
// 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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.