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 try our best to define gRPC APIs as much as possible close to the Bitcoin JSON-RPC APIs. It looks the GetNetworkInfo and GetPeerInfo in our proto file are not well defined.
GetNetworkInfo
In Bitcoin, getnetworkinfo is designed to "Returns an object containing various state info regarding P2P networking".
For example, here is the result of calling getnetworkinfo in my local machine.
GetNetworkInfo in our proto returns the list of peers info. It is not compatible with the getnetworkinfo. So we need to redefine the GetNetworkInfoResponse properly.
We should be able to get information about the network from libp2p. We can do it in another PR, but it should be accessible in this gRPC call.
GetPeerInfo
In Bitcoin, getpeerinfo is designed to "Returns data about each connected network node as a json array of objects.".
For example, here is the result of calling getpeerinfo in my local machine.
It should return the list of connected peers to our local node. The PeerInfo struct can be used here, but not for GetNetworkInfo. They might have some common fields like version, but they are not the same.
The text was updated successfully, but these errors were encountered:
b00f
changed the title
gRPC: GetPeerInfo and GetNetworkInfo are not well defined
grpc: GetPeerInfo and GetNetworkInfo are not well defined
Nov 19, 2022
We try our best to define gRPC APIs as much as possible close to the Bitcoin JSON-RPC APIs. It looks the
GetNetworkInfo
andGetPeerInfo
in our proto file are not well defined.GetNetworkInfo
In Bitcoin, getnetworkinfo is designed to "Returns an object containing various state info regarding P2P networking".
For example, here is the result of calling
getnetworkinfo
in my local machine.GetNetworkInfo in our proto returns the list of peers info. It is not compatible with the
getnetworkinfo
. So we need to redefine theGetNetworkInfoResponse
properly.We should be able to get information about the network from libp2p. We can do it in another PR, but it should be accessible in this gRPC call.
GetPeerInfo
In Bitcoin, getpeerinfo is designed to "Returns data about each connected network node as a json array of objects.".
For example, here is the result of calling
getpeerinfo
in my local machine.GetPeerInfo in our proto returns our local node info. It is not compatible with the
getpeerinfo
. So we need to redefine theGetPeerInfoResponse
like:It should return the list of connected peers to our local node. The
PeerInfo
struct can be used here, but not forGetNetworkInfo
. They might have some common fields like version, but they are not the same.The text was updated successfully, but these errors were encountered: