diff --git a/src/lib_p2p/p2p.ml b/src/lib_p2p/p2p.ml index c297346f2..1bd17b4c8 100644 --- a/src/lib_p2p/p2p.ml +++ b/src/lib_p2p/p2p.ml @@ -579,7 +579,7 @@ let build_rpc_directory net = end in let dir = - RPC_directory.register0 dir P2p_services.S.identity begin fun () () -> + RPC_directory.register0 dir P2p_services.S.self begin fun () () -> match net.pool with | None -> failwith "The P2P layer is disabled." | Some pool -> return (P2p_pool.config pool).identity.peer_id diff --git a/src/lib_shell_services/p2p_services.ml b/src/lib_shell_services/p2p_services.ml index 78e2dc867..85fbf40d5 100644 --- a/src/lib_shell_services/p2p_services.ml +++ b/src/lib_shell_services/p2p_services.ml @@ -49,12 +49,12 @@ let timeout_query = module S = struct - let identity = + let self = RPC_service.get_service - ~description:"Return the node's identity" + ~description:"Return the node's peer id" ~query: RPC_query.empty ~output: P2p_peer.Id.encoding - RPC_path.(root / "network" / "identity") + RPC_path.(root / "network" / "self") let versions = RPC_service.get_service @@ -88,7 +88,7 @@ module S = struct end open RPC_context -let identity ctxt = make_call S.identity ctxt () () () +let self ctxt = make_call S.self ctxt () () () let stat ctxt = make_call S.stat ctxt () () () let versions ctxt = make_call S.versions ctxt () () () let events ctxt = make_streamed_call S.events ctxt () () () diff --git a/src/lib_shell_services/p2p_services.mli b/src/lib_shell_services/p2p_services.mli index ef93c7335..46267520d 100644 --- a/src/lib_shell_services/p2p_services.mli +++ b/src/lib_shell_services/p2p_services.mli @@ -25,7 +25,7 @@ open RPC_context -val identity: #simple -> P2p_peer.Id.t tzresult Lwt.t +val self: #simple -> P2p_peer.Id.t tzresult Lwt.t val stat: #simple -> P2p_stat.t tzresult Lwt.t @@ -38,7 +38,7 @@ val connect: #simple -> timeout:float -> P2p_point.Id.t -> unit tzresult Lwt.t module S : sig - val identity : + val self : ([ `GET ], unit, unit, unit, unit, P2p_peer.Id.t) RPC_service.t