Skip to content

Expose RequestMetadata method on graphsync client #373

@hannahhoward

Description

@hannahhoward

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions