Active peers last advertized head RPC
This MR aims to bring a new RPC that display, for each active peers connected to the node, its peer_id and block_hash+block_level of the last adevrtized head.
It should display something like
$curl -s http://127.0.0.1:8732/chains/main/active_peers_heads | jq
{
"active_peers_heads": [
{
"peer_id": "idts56eVgbK6gjvcrW9jdFSL9fcj4d",
"block_hash": "BLgiEgr4LFUBdB5e6mvHSVhDbewBPPhPnBm35ARvfgLjuuRuAHR",
"block_level": 1725631
},
{
"peer_id": "idsorXP8nfvSi6kr57CqqpX7URe2tB",
"block_hash": "BLgiEgr4LFUBdB5e6mvHSVhDbewBPPhPnBm35ARvfgLjuuRuAHR",
"block_level": 1725631
},
{
"peer_id": "idt6U1SmJGPFEZy11GS1JqQtufFDFW",
"block_hash": "BLgiEgr4LFUBdB5e6mvHSVhDbewBPPhPnBm35ARvfgLjuuRuAHR",
"block_level": 1725631
},
{
"peer_id": "idsZkDkQusT1qYYXZ8Dz1EgEhXyNJT",
"block_hash": "BLgiEgr4LFUBdB5e6mvHSVhDbewBPPhPnBm35ARvfgLjuuRuAHR",
"block_level": 1725631
}
]
}
Manually testing the MR
Run the RPC against a node and enjoy.
Checklist
-
Document the interface of any function added or modified (see the coding guidelines) -
Document any change to the user interface, including configuration parameters (see node configuration) -
Provide automatic testing (see the testing guide). -
For new features and bug fixes, add an item in the appropriate changelog ( docs/protocols/alpha.rstfor the protocol and the environment,CHANGES.rstat the root of the repository for everything else). -
Select suitable reviewers using the Reviewersfield below. -
Select as Assigneethe next person who should take action on that MR