Lighthouse REST API: /network

The /network endpoints provide information about the p2p network that Lighthouse uses to communicate with other beacon nodes.

Endpoints

HTTP PathDescription
/network/enrGet the local node's ENR as base64 .
/network/peer_countGet the count of connected peers.
/network/peer_idGet a node's libp2p PeerId.
/network/peersList a node's connected peers (as PeerIds).
/network/listen_portGet a node's libp2p listening port.
/network/listen_addressesGet a list of libp2p multiaddr the node is listening on.

network/enr

Requests the beacon node for its listening ENR address.

HTTP Specification

PropertySpecification
Path/network/enr
MethodGET
JSON EncodingString (base64)
Query ParametersNone
Typical Responses200

Example Response

"-IW4QPYyGkXJSuJ2Eji8b-m4PTNrW4YMdBsNOBrYAdCk8NLMJcddAiQlpcv6G_hdNjiLACOPTkqTBhUjnC0wtIIhyQkEgmlwhKwqAPqDdGNwgiMog3VkcIIjKIlzZWNwMjU2azGhA1sBKo0yCfw4Z_jbggwflNfftjwKACu-a-CoFAQHJnrm"

/network/peer_count

Requests the count of peers connected to the client.

HTTP Specification

PropertySpecification
Path/network/peer_count
MethodGET
JSON EncodingNumber
Query ParametersNone
Typical Responses200

Example Response

5

/network/peer_id

Requests the beacon node's local PeerId.

HTTP Specification

PropertySpecification
Path/network/peer_id
MethodGET
JSON EncodingString (base58)
Query ParametersNone
Typical Responses200

Example Response

"QmVFcULBYZecPdCKgGmpEYDqJLqvMecfhJadVBtB371Avd"

/network/peers

Requests one MultiAddr for each peer connected to the beacon node.

HTTP Specification

PropertySpecification
Path/network/peers
MethodGET
JSON Encoding[String] (base58)
Query ParametersNone
Typical Responses200

Example Response

[
	"QmaPGeXcfKFMU13d8VgbnnpeTxcvoFoD9bUpnRGMUJ1L9w",
	"QmZt47cP8V96MgiS35WzHKpPbKVBMqr1eoBNTLhQPqpP3m"
]

/network/listen_port

Requests the TCP port that the client's libp2p service is listening on.

HTTP Specification

PropertySpecification
Path/network/listen_port
MethodGET
JSON EncodingNumber
Query ParametersNone
Typical Responses200

Example Response

9000

/network/listen_addresses

Requests the list of multiaddr that the client's libp2p service is listening on.

HTTP Specification

PropertySpecification
Path/network/listen_addresses
MethodGET
JSON EncodingArray
Query ParametersNone
Typical Responses200

Example Response

[
    "/ip4/127.0.0.1/tcp/9000",
    "/ip4/192.168.31.115/tcp/9000",
    "/ip4/172.24.0.1/tcp/9000",
    "/ip4/172.21.0.1/tcp/9000",
    "/ip4/172.17.0.1/tcp/9000",
    "/ip4/172.18.0.1/tcp/9000",
    "/ip4/172.19.0.1/tcp/9000",
    "/ip4/172.42.0.1/tcp/9000",
    "/ip6/::1/tcp/9000"
]