You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We want to get an on-demand close look into what is going on for a given graphsync peer. We'll probably use this initially to build an admin endpoint in Estuary to see what we can learn about a given peer.
Sample API (feel free to modify though this should be a good shape to start from):
in root graphsync.go
typeRequestStateuint64const (
QueuedRequestState=iotaRunningPaused
)
typePeerRequestinterface {
RequestDataState() RequestState
}
// PeerStats describes the state of graphsync for a giventypePeerStatsstruct {
// OutgoingRequestsOutgoingRequests []PeerRequest// IncomingRequestsIncomingRequests []PeerRequest
}
// GraphExchange is a protocol that can exchange IPLD graphs based on a selectortypeGraphExchangeinterface {
// ...// existing methods// ...// PeerStats produces insight on the current state of a given peerPeerStats(p peer.ID) PeerStats
}
Implementation
What we probably want is a new method on RequestManager and ResponseManager, which will need a new message into the system, that will result in a new server method on each that assembles the data from the inProgressStatus map. Unfortunately, this map is not sorted by peer id for the moment so we'll probably need to loop through the whole thing (sad face). We won't be calling this very much though so I'm not so worried.
For discussion
I am getting anxious about the amount of methods on the "GraphsyncExchange" interface. I am thinking we may want to start exposing some of these only on the impl/Graphsync struct, which is public, but folks will have to feature detect for that. I'm particularly concerned about methods like these, that we may or may not want to live by forever. I don't want to keep publishing them in places that indicate they should be used a lot. It seems like only putting them on impl/Graphsync and then having priviliged consumers (i.e. Estuary) to the check might make sense for now.
The text was updated successfully, but these errors were encountered:
What
We want to get an on-demand close look into what is going on for a given graphsync peer. We'll probably use this initially to build an admin endpoint in Estuary to see what we can learn about a given peer.
Sample API (feel free to modify though this should be a good shape to start from):
in root
graphsync.go
Implementation
What we probably want is a new method on RequestManager and ResponseManager, which will need a new message into the system, that will result in a new server method on each that assembles the data from the inProgressStatus map. Unfortunately, this map is not sorted by peer id for the moment so we'll probably need to loop through the whole thing (sad face). We won't be calling this very much though so I'm not so worried.
For discussion
I am getting anxious about the amount of methods on the "GraphsyncExchange" interface. I am thinking we may want to start exposing some of these only on the impl/Graphsync struct, which is public, but folks will have to feature detect for that. I'm particularly concerned about methods like these, that we may or may not want to live by forever. I don't want to keep publishing them in places that indicate they should be used a lot. It seems like only putting them on impl/Graphsync and then having priviliged consumers (i.e. Estuary) to the check might make sense for now.
The text was updated successfully, but these errors were encountered: