Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose RequestMetadata method on graphsync client #373

Open
Tracked by #371 ...
hannahhoward opened this issue Mar 29, 2022 · 0 comments
Open
Tracked by #371 ...

Expose RequestMetadata method on graphsync client #373

hannahhoward opened this issue Mar 29, 2022 · 0 comments

Comments

@hannahhoward
Copy link
Collaborator

hannahhoward commented Mar 29, 2022

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.

@hannahhoward hannahhoward changed the title On the requestor side, we expose a new method that simply returns a stream of metadata, skipping the verification process. Expose RequestMetadata method on graphsync client Mar 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant