Skip to content

Commit

Permalink
Merge pull request #15970 from MinaProtocol/refactor/mina-rpcs
Browse files Browse the repository at this point in the history
Refactor Mina RPCs (compatible)
  • Loading branch information
mrmr1993 authored Sep 1, 2024
2 parents f159c96 + 775676c commit 7273e9b
Show file tree
Hide file tree
Showing 29 changed files with 1,867 additions and 2,315 deletions.
9 changes: 1 addition & 8 deletions src/app/cli/src/cli_entrypoint/mina_cli_entrypoint.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1290,20 +1290,13 @@ Pass one of -peer, -peer-list-file, -seed, -peer-list-url.|} ;
}
in
let net_config =
{ Mina_networking.Config.logger
; trust_system
; time_controller
; consensus_constants = precomputed_values.consensus_constants
; consensus_local_state
; genesis_ledger_hash
; constraint_constants = precomputed_values.constraint_constants
{ Mina_networking.Config.genesis_ledger_hash
; log_gossip_heard
; is_seed
; creatable_gossip_net =
Mina_networking.Gossip_net.(
Any.Creatable
((module Libp2p), Libp2p.create ~pids gossip_net_params))
; precomputed_values
}
in
let coinbase_receiver : Consensus.Coinbase_receiver.t =
Expand Down
2 changes: 1 addition & 1 deletion src/app/cli/src/init/client.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1907,7 +1907,7 @@ let node_status =
List.iter all_status_data ~f:(fun peer_status_data ->
printf "%s\n%!"
( Yojson.Safe.to_string
@@ Mina_networking.Rpcs.Get_node_status.response_to_yojson
@@ Mina_networking.Node_status.response_to_yojson
peer_status_data ) )
| Error err ->
printf "Failed to get node status: %s\n%!"
Expand Down
1 change: 0 additions & 1 deletion src/app/cli/src/init/dune
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@
genesis_constants
bash_colors
graphql_lib
node_status
o1trace_webkit_event
generated_graphql_queries
itn_crypto
Expand Down
2 changes: 1 addition & 1 deletion src/app/cli/src/init/mina_run.ml
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ let setup_local_server ?(client_trustlist = []) ?rest_server_port
; implement Daemon_rpcs.Get_trustlist.rpc (fun () () ->
return (Set.to_list !client_trustlist) )
; implement Daemon_rpcs.Get_node_status.rpc (fun () peers ->
Node_status.get_node_status_from_peers (Mina_lib.net mina) peers )
Mina_networking.get_node_status_from_peers (Mina_lib.net mina) peers )
; implement Daemon_rpcs.Get_object_lifetime_statistics.rpc (fun () () ->
return
(Yojson.Safe.pretty_to_string @@ Allocation_functor.Table.dump ()) )
Expand Down
1 change: 0 additions & 1 deletion src/dune-project
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@
(package (name network_pool))
(package (name node_addrs_and_ports))
(package (name node_error_service))
(package (name node_status))
(package (name node_status_service))
(package (name non_zero_curve_point))
(package (name o1trace))
Expand Down
4 changes: 1 addition & 3 deletions src/lib/daemon_rpcs/daemon_rpcs.ml
Original file line number Diff line number Diff line change
Expand Up @@ -330,9 +330,7 @@ end
module Get_node_status = struct
type query = Mina_net2.Multiaddr.t list option [@@deriving bin_io_unversioned]

type response =
Mina_networking.Rpcs.Get_node_status.Node_status.Stable.Latest.t Or_error.t
list
type response = Mina_networking.Node_status.Stable.Latest.t Or_error.t list
[@@deriving bin_io_unversioned]

let rpc : (query, response) Rpc.Rpc.t =
Expand Down
Loading

0 comments on commit 7273e9b

Please sign in to comment.