mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-18 13:28:33 +00:00
Adds peers and connected_peers to lighthouse http API (#1030)
This commit is contained in:
@@ -7,6 +7,8 @@ The `/lighthouse` endpoints provide lighthouse-specific information about the be
|
||||
HTTP Path | Description |
|
||||
| --- | -- |
|
||||
[`/lighthouse/syncing`](#lighthousesyncing) | Get the node's syncing status
|
||||
[`/lighthouse/peers`](#lighthousepeers) | Get the peers info known by the beacon node
|
||||
[`/lighthouse/connected_peers`](#lighthousepeers) | Get the connected_peers known by the beacon node
|
||||
|
||||
## `/lighthouse/syncing`
|
||||
|
||||
@@ -52,3 +54,129 @@ If the node is synced
|
||||
"Synced"
|
||||
}
|
||||
```
|
||||
|
||||
## `/lighthouse/peers`
|
||||
|
||||
Get all known peers info from the beacon node.
|
||||
|
||||
### HTTP Specification
|
||||
|
||||
| Property | Specification |
|
||||
| --- |--- |
|
||||
Path | `/lighthouse/peers`
|
||||
Method | GET
|
||||
JSON Encoding | Object
|
||||
Query Parameters | None
|
||||
Typical Responses | 200
|
||||
|
||||
### Example Response
|
||||
|
||||
```json
|
||||
[
|
||||
{
|
||||
"peer_id" : "16Uiu2HAmTEinipUS3haxqucrn7d7SmCKx5XzAVbAZCiNW54ncynG",
|
||||
"peer_info" : {
|
||||
"_status" : "Healthy",
|
||||
"client" : {
|
||||
"agent_string" : "github.com/libp2p/go-libp2p",
|
||||
"kind" : "Prysm",
|
||||
"os_version" : "unknown",
|
||||
"protocol_version" : "ipfs/0.1.0",
|
||||
"version" : "unknown"
|
||||
},
|
||||
"connection_status" : {
|
||||
"Disconnected" : {
|
||||
"since" : 3
|
||||
}
|
||||
},
|
||||
"listening_addresses" : [
|
||||
"/ip4/10.3.58.241/tcp/9001",
|
||||
"/ip4/35.172.14.146/tcp/9001",
|
||||
"/ip4/35.172.14.146/tcp/9001"
|
||||
],
|
||||
"meta_data" : {
|
||||
"attnets" : "0x0000000000000000",
|
||||
"seq_number" : 0
|
||||
},
|
||||
"reputation" : 20,
|
||||
"sync_status" : {
|
||||
"Synced" : {
|
||||
"status_head_slot" : 18146
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"peer_id" : "16Uiu2HAm8XZfPv3YjktCjitSRtfS7UfHfEvpiUyHrdiX6uAD55xZ",
|
||||
"peer_info" : {
|
||||
"_status" : "Healthy",
|
||||
"client" : {
|
||||
"agent_string" : null,
|
||||
"kind" : "Unknown",
|
||||
"os_version" : "unknown",
|
||||
"protocol_version" : "unknown",
|
||||
"version" : "unknown"
|
||||
},
|
||||
"connection_status" : {
|
||||
"Disconnected" : {
|
||||
"since" : 5
|
||||
}
|
||||
},
|
||||
"listening_addresses" : [],
|
||||
"meta_data" : {
|
||||
"attnets" : "0x0900000000000000",
|
||||
"seq_number" : 0
|
||||
},
|
||||
"reputation" : 20,
|
||||
"sync_status" : "Unknown"
|
||||
}
|
||||
},
|
||||
]
|
||||
```
|
||||
|
||||
## `/lighthouse/connected_peers`
|
||||
|
||||
Get all known peers info from the beacon node.
|
||||
|
||||
### HTTP Specification
|
||||
|
||||
| Property | Specification |
|
||||
| --- |--- |
|
||||
Path | `/lighthouse/connected_peers`
|
||||
Method | GET
|
||||
JSON Encoding | Object
|
||||
Query Parameters | None
|
||||
Typical Responses | 200
|
||||
|
||||
### Example Response
|
||||
|
||||
```json
|
||||
[
|
||||
{
|
||||
"peer_id" : "16Uiu2HAm8XZfPv3YjktCjitSRtfS7UfHfEvpiUyHrdiX6uAD55xZ",
|
||||
"peer_info" : {
|
||||
"_status" : "Healthy",
|
||||
"client" : {
|
||||
"agent_string" : null,
|
||||
"kind" : "Unknown",
|
||||
"os_version" : "unknown",
|
||||
"protocol_version" : "unknown",
|
||||
"version" : "unknown"
|
||||
},
|
||||
"connection_status" : {
|
||||
"Connected" : {
|
||||
"in" : 5,
|
||||
"out" : 2
|
||||
}
|
||||
},
|
||||
"listening_addresses" : [],
|
||||
"meta_data" : {
|
||||
"attnets" : "0x0900000000000000",
|
||||
"seq_number" : 0
|
||||
},
|
||||
"reputation" : 20,
|
||||
"sync_status" : "Unknown"
|
||||
}
|
||||
},
|
||||
]
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user