Docs/RPC: minor RPC improvements
This commit is contained in:
parent
33ded01ae7
commit
22d20509bf
@ -9,3 +9,9 @@
|
|||||||
|
|
||||||
include Crypto_box.Public_key_hash
|
include Crypto_box.Public_key_hash
|
||||||
|
|
||||||
|
let rpc_arg =
|
||||||
|
RPC_arg.like
|
||||||
|
rpc_arg
|
||||||
|
~descr:"A cryptographic node identity (Base58Check-encoded)"
|
||||||
|
"peer_id"
|
||||||
|
|
||||||
|
@ -8,8 +8,8 @@
|
|||||||
(**************************************************************************)
|
(**************************************************************************)
|
||||||
|
|
||||||
include Blake2B.Make (Base58) (struct
|
include Blake2B.Make (Base58) (struct
|
||||||
let name = "Block_hash"
|
let name = "block_hash"
|
||||||
let title = "A Tezos block ID"
|
let title = "A block identifier"
|
||||||
let b58check_prefix = Base58.Prefix.block_hash
|
let b58check_prefix = Base58.Prefix.block_hash
|
||||||
let size = None
|
let size = None
|
||||||
end)
|
end)
|
||||||
|
@ -165,6 +165,12 @@ module Public_key_hash = struct
|
|||||||
let encoding = encoding
|
let encoding = encoding
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
let rpc_arg =
|
||||||
|
RPC_arg.like
|
||||||
|
rpc_arg
|
||||||
|
~descr:"A Secp256k1 of a Ed25519 public key hash (Base58Check-encoded)"
|
||||||
|
"pkh"
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
module Public_key = struct
|
module Public_key = struct
|
||||||
|
@ -69,16 +69,6 @@ module Peer_validators = struct
|
|||||||
|
|
||||||
module S = 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 =
|
let list =
|
||||||
RPC_service.get_service
|
RPC_service.get_service
|
||||||
~description:"Lists the peer validator workers and their status."
|
~description:"Lists the peer validator workers and their status."
|
||||||
@ -88,7 +78,7 @@ module Peer_validators = struct
|
|||||||
(obj2
|
(obj2
|
||||||
(req "peer_id" P2p_peer.Id.encoding)
|
(req "peer_id" P2p_peer.Id.encoding)
|
||||||
(req "status" (Worker_types.worker_status_encoding RPC_error.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 =
|
let state =
|
||||||
RPC_service.get_service
|
RPC_service.get_service
|
||||||
@ -99,7 +89,7 @@ module Peer_validators = struct
|
|||||||
Peer_validator_worker_state.Request.encoding
|
Peer_validator_worker_state.Request.encoding
|
||||||
Peer_validator_worker_state.Event.encoding
|
Peer_validator_worker_state.Event.encoding
|
||||||
RPC_error.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
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user