GRPC Documentation - Legacy PeerService
Table of Contents
peer_api.proto
Package peer_api defines the gRPC service interface for legacy peer management compatible with Bitcoin RPC interfaces.
BanPeerRequest
Represents a request to ban a peer.
| Field | Type | Label | Description |
|---|---|---|---|
| addr | string | The address of the peer to ban | |
| until | int64 | Unix timestamp indicating when the ban expires |
BanPeerResponse
Represents the response from banning a peer.
| Field | Type | Label | Description |
|---|---|---|---|
| ok | bool | Indicates whether the ban operation succeeded |
ClearBannedResponse
Represents the response from clearing all banned peers.
| Field | Type | Label | Description |
|---|---|---|---|
| ok | bool | Indicates whether the clear operation succeeded |
GetPeerCountResponse
Represents the response containing the count of connected peers.
| Field | Type | Label | Description |
|---|---|---|---|
| count | int32 | The number of currently connected peers |
GetPeersResponse
Represents the response containing all connected peers.
| Field | Type | Label | Description |
|---|---|---|---|
| peers | Peer | repeated | List of all connected peers |
IsBannedRequest
Represents a request to check if an IP or subnet is banned.
| Field | Type | Label | Description |
|---|---|---|---|
| ipOrSubnet | string | The IP address or subnet to check |
IsBannedResponse
Represents the response indicating whether an IP or subnet is banned.
| Field | Type | Label | Description |
|---|---|---|---|
| isBanned | bool | Indicates whether the IP or subnet is banned |
ListBannedResponse
Represents the response containing all banned addresses.
| Field | Type | Label | Description |
|---|---|---|---|
| banned | string | repeated | List of all banned IP addresses or subnets |
Peer
Represents detailed information about a connected peer compatible with Bitcoin RPC format.
| Field | Type | Label | Description |
|---|---|---|---|
| id | int32 | Peer identifier | |
| addr | string | Remote address (host:port) | |
| addrLocal | string | Local address used for this connection | |
| services | string | Services supported by the peer | |
| lastSend | int64 | Time of last message sent (seconds since epoch) | |
| lastRecv | int64 | Time of last message received (seconds since epoch) | |
| sendSize | int64 | Size of send buffer | |
| recvSize | int64 | Size of receive buffer | |
| sendMemory | int64 | Memory used by send buffer | |
| pauseSend | bool | Whether sending is paused | |
| unpauseSend | bool | Whether sending is unpaused | |
| bytesSent | uint64 | Total bytes sent to this peer | |
| bytesReceived | uint64 | Total bytes received from this peer | |
| avgRecvBandwidth | int64 | Average receive bandwidth | |
| assocId | string | Association identifier | |
| streamPolicy | string | Stream policy used for this connection (e.g., "BlockPriority") | |
| inbound | bool | Whether this is an inbound connection | |
| connTime | int64 | Connection time (seconds since epoch) | |
| pingTime | int64 | Last ping time in microseconds | |
| timeOffset | int64 | Time offset from this peer | |
| version | uint32 | Protocol version of the peer | |
| subVer | string | User agent string of the peer | |
| startingHeight | int32 | Block height when connection was established | |
| currentHeight | int32 | Current block height of the peer | |
| banscore | int32 | Ban score of this peer | |
| whitelisted | bool | Whether this peer is whitelisted | |
| feeFilter | int64 | Minimum fee filter for transactions |
UnbanPeerRequest
Represents a request to unban a peer.
| Field | Type | Label | Description |
|---|---|---|---|
| addr | string | The address of the peer to unban |
UnbanPeerResponse
Represents the response from unbanning a peer.
| Field | Type | Label | Description |
|---|---|---|---|
| ok | bool | Indicates whether the unban operation succeeded |
PeerService
Service provides legacy peer management methods compatible with Bitcoin RPC interfaces.
| Method Name | Request Type | Response Type | Description |
|---|---|---|---|
| GetPeers | .google.protobuf.Empty | GetPeersResponse | Retrieves a list of all connected peers with their detailed information. |
| BanPeer | BanPeerRequest | BanPeerResponse | Bans a peer by address until the specified time. |
| UnbanPeer | UnbanPeerRequest | UnbanPeerResponse | Removes a ban for a peer address. |
| IsBanned | IsBannedRequest | IsBannedResponse | Checks if an IP address or subnet is currently banned. |
| ListBanned | .google.protobuf.Empty | ListBannedResponse | Lists all currently banned addresses. |
| ClearBanned | .google.protobuf.Empty | ClearBannedResponse | Clears all banned addresses. |
| GetPeerCount | .google.protobuf.Empty | GetPeerCountResponse | Returns the count of currently connected peers. |