diff --git a/src/lib_base/p2p_peer_id.ml b/src/lib_base/p2p_peer_id.ml index 7dfb5e1df..31083d907 100644 --- a/src/lib_base/p2p_peer_id.ml +++ b/src/lib_base/p2p_peer_id.ml @@ -9,3 +9,9 @@ include Crypto_box.Public_key_hash +let rpc_arg = + RPC_arg.like + rpc_arg + ~descr:"A cryptographic node identity (Base58Check-encoded)" + "peer_id" + diff --git a/src/lib_crypto/block_hash.ml b/src/lib_crypto/block_hash.ml index 85bca9c64..5c0984ce2 100644 --- a/src/lib_crypto/block_hash.ml +++ b/src/lib_crypto/block_hash.ml @@ -8,8 +8,8 @@ (**************************************************************************) include Blake2B.Make (Base58) (struct - let name = "Block_hash" - let title = "A Tezos block ID" + let name = "block_hash" + let title = "A block identifier" let b58check_prefix = Base58.Prefix.block_hash let size = None end) diff --git a/src/lib_crypto/signature.ml b/src/lib_crypto/signature.ml index fb53e0e90..ecded70d8 100644 --- a/src/lib_crypto/signature.ml +++ b/src/lib_crypto/signature.ml @@ -165,6 +165,12 @@ module Public_key_hash = struct let encoding = encoding end) + let rpc_arg = + RPC_arg.like + rpc_arg + ~descr:"A Secp256k1 of a Ed25519 public key hash (Base58Check-encoded)" + "pkh" + end module Public_key = struct diff --git a/src/lib_shell_services/worker_services.ml b/src/lib_shell_services/worker_services.ml index c57b0185d..0e72cc8b0 100644 --- a/src/lib_shell_services/worker_services.ml +++ b/src/lib_shell_services/worker_services.ml @@ -69,16 +69,6 @@ module Peer_validators = struct module S = struct - let (peer_id_arg : P2p_peer.Id.t RPC_arg.t) = - RPC_arg.make - ~name:"peer_id" - ~descr:"The peer identifier of whom the prevalidator is responsible." - ~destruct:(fun s -> try - Ok (P2p_peer.Id.of_b58check_exn s) - with Failure msg -> Error msg) - ~construct:P2p_peer.Id.to_b58check - () - let list = RPC_service.get_service ~description:"Lists the peer validator workers and their status." @@ -88,7 +78,7 @@ module Peer_validators = struct (obj2 (req "peer_id" P2p_peer.Id.encoding) (req "status" (Worker_types.worker_status_encoding RPC_error.encoding)))) - RPC_path.(root / "workers" / "peer_validators" /: Chain_services.chain_arg) + RPC_path.(root / "workers" / "chain_validators" /: Chain_services.chain_arg / "peers_validators" ) let state = RPC_service.get_service @@ -99,7 +89,7 @@ module Peer_validators = struct Peer_validator_worker_state.Request.encoding Peer_validator_worker_state.Event.encoding RPC_error.encoding) - RPC_path.(root / "workers" / "peer_validators" /: Chain_services.chain_arg /: peer_id_arg) + RPC_path.(root / "workers" / "chain_validators" /: Chain_services.chain_arg / "peers_validators" /: P2p_peer.Id.rpc_arg) end