Shell: RPCs to fetch protocol activation levels
What
This MR adds two RPCs:
-
GET
/chain/{chain_id}/protocolsto retrieve all protocol activations of the chain -
GET
/chain/{chain_id}/protocols/{protocol_hash}to retrieve one protocol activation by hash
Example
> curl localhost:8732/chains/main/protocols | jq
[
{
"protocol": "PtParisBxoLz5gzMmn3d9WBQNoPSZakgnkMC2VNuQ3KXfUtUQeZ",
"proto_level": 9,
"activation_block": {
"block_hash": "BLY1WnKYYDBRVF5fUNaob9eVXErc6BFi1Y4Wq6AAmUzFoaGKjRK",
"level": 6422528
}
},
{
"protocol": "PsParisCZo7KAh1Z1smVd9ZMZ1HHn5gkzbM94V3PLCpknFWhUAi",
"proto_level": 10,
"activation_block": {
"block_hash": "BMe5L4dgGGF7w1iLAZX6rJ31SaFLefKbDmSvMMSo1e2qAPAvUfS",
"level": 6729729
}
}
]
Why
This information is useful for end users and also developers (this is something that would be useful in the rollup node and the DAL node).
How
This information is readily available in the chain store. The RPCs just expose it.
Edited by Alain Mebsout