How do you query the ledger to get to know what’s the very last block index?
Found following in NNS-dapp but it does not exist in the public API I think - i.e. there is not call with protobuf.
pub async fn tip_of_chain() -> Result<BlockIndex, String> {
let response: TipOfChainResponsePb =
dfn_core::call(LEDGER_CANISTER_ID, "tip_of_chain_pb", protobuf, TipOfChainRequestPb {})
.await
.map_err(|e| e.1)?;
Ok(response.chain_length.map(|c| c.height).unwrap_or_default())
}