ligo/lib_node_services/node_rpc_services.mli

286 lines
7.3 KiB
OCaml
Raw Normal View History

2016-09-08 21:13:10 +04:00
(**************************************************************************)
(* *)
2017-11-14 03:36:14 +04:00
(* Copyright (c) 2014 - 2017. *)
2016-09-08 21:13:10 +04:00
(* Dynamic Ledger Solutions, Inc. <contact@tezos.com> *)
(* *)
(* All rights reserved. No warranty, explicit or implicit, provided. *)
(* *)
(**************************************************************************)
module Error : sig
val service:
2017-12-09 06:51:58 +04:00
([ `POST ], unit, unit, unit, unit, Json_schema.schema, unit) RPC_service.t
val encoding: error list Data_encoding.t
val wrap: 'a Data_encoding.t -> 'a tzresult Data_encoding.encoding
end
2016-09-08 21:13:10 +04:00
module Blocks : sig
type block = [
| `Genesis
| `Head of int | `Prevalidation
| `Test_head of int | `Test_prevalidation
| `Hash of Block_hash.t
]
2017-12-09 06:51:58 +04:00
val blocks_arg : block RPC_arg.arg
2016-09-08 21:13:10 +04:00
val parse_block: string -> (block, string) result
val to_string: block -> string
2016-09-08 21:13:10 +04:00
type block_info = {
hash: Block_hash.t ;
net_id: Net_id.t ;
level: Int32.t ;
proto_level: int ; (* uint8 *)
2016-09-08 21:13:10 +04:00
predecessor: Block_hash.t ;
timestamp: Time.t ;
validation_passes: int ; (* uint8 *)
operations_hash: Operation_list_list_hash.t ;
fitness: MBytes.t list ;
2017-12-05 18:19:22 +04:00
context: Context_hash.t ;
data: MBytes.t ;
operations: (Operation_hash.t * Operation.t) list list option ;
protocol: Protocol_hash.t ;
test_network: Test_network_status.t ;
2016-09-08 21:13:10 +04:00
}
val info:
([ `POST ], unit,
unit * block, unit, bool,
2017-12-09 06:51:58 +04:00
block_info, unit) RPC_service.t
2017-04-20 10:26:43 +04:00
val net_id:
([ `POST ], unit,
unit * block, unit, unit,
2017-12-09 06:51:58 +04:00
Net_id.t, unit) RPC_service.t
val level:
([ `POST ], unit,
unit * block, unit, unit,
2017-12-09 06:51:58 +04:00
Int32.t, unit) RPC_service.t
2016-09-08 21:13:10 +04:00
val predecessor:
([ `POST ], unit,
unit * block, unit, unit,
2017-12-09 06:51:58 +04:00
Block_hash.t, unit) RPC_service.t
val predecessors:
([ `POST ], unit,
unit * block , unit, int,
2017-12-09 06:51:58 +04:00
Block_hash.t list, unit) RPC_service.t
2016-09-08 21:13:10 +04:00
val hash:
([ `POST ], unit,
unit * block, unit, unit,
2017-12-09 06:51:58 +04:00
Block_hash.t, unit) RPC_service.t
2016-09-08 21:13:10 +04:00
val timestamp:
([ `POST ], unit,
unit * block, unit, unit,
2017-12-09 06:51:58 +04:00
Time.t, unit) RPC_service.t
2016-09-08 21:13:10 +04:00
val fitness:
([ `POST ], unit,
unit * block, unit, unit,
2017-12-09 06:51:58 +04:00
MBytes.t list, unit) RPC_service.t
2017-12-05 18:19:22 +04:00
val context:
([ `POST ], unit,
unit * block, unit, unit,
Context_hash.t, unit) RPC_service.t
type operations_param = {
contents: bool ;
monitor: bool ;
}
2016-09-08 21:13:10 +04:00
val operations:
([ `POST ], unit,
unit * block, unit, operations_param,
2017-12-09 06:51:58 +04:00
(Operation_hash.t * Operation.t option) list list, unit) RPC_service.t
2016-09-08 21:13:10 +04:00
val protocol:
([ `POST ], unit,
unit * block, unit, unit,
2017-12-09 06:51:58 +04:00
Protocol_hash.t, unit) RPC_service.t
2016-09-08 21:13:10 +04:00
val test_network:
([ `POST ], unit,
unit * block, unit, unit,
2017-12-09 06:51:58 +04:00
Test_network_status.t, unit) RPC_service.t
2016-09-08 21:13:10 +04:00
val pending_operations:
([ `POST ], unit,
unit * block, unit, unit,
2017-12-09 06:51:58 +04:00
error Preapply_result.t * Operation.t Operation_hash.Map.t, unit) RPC_service.t
2016-09-08 21:13:10 +04:00
type list_param = {
include_ops: bool ;
2016-09-08 21:13:10 +04:00
length: int option ;
heads: Block_hash.t list option ;
monitor: bool option ;
delay: int option ;
2016-09-21 18:22:43 +04:00
min_date: Time.t option;
min_heads: int option;
2016-09-08 21:13:10 +04:00
}
val list:
([ `POST ], unit,
unit, unit, list_param,
2017-12-09 06:51:58 +04:00
block_info list list, unit) RPC_service.t
2016-09-08 21:13:10 +04:00
2017-11-27 01:21:56 +04:00
val list_invalid:
([ `POST ], unit,
unit, unit, unit,
2017-12-09 06:51:58 +04:00
(Block_hash.t * int32 * error list) list, unit) RPC_service.t
2017-11-27 01:21:56 +04:00
2016-09-08 21:13:10 +04:00
type preapply_param = {
timestamp: Time.t ;
proto_header: MBytes.t ;
operations: Operation.t list list ;
sort_operations: bool ;
2016-09-08 21:13:10 +04:00
}
2016-09-08 21:13:10 +04:00
type preapply_result = {
shell_header: Block_header.shell_header ;
operations: error Preapply_result.t list ;
2016-09-08 21:13:10 +04:00
}
val preapply:
([ `POST ], unit,
unit * block, unit, preapply_param,
2017-12-09 06:51:58 +04:00
preapply_result tzresult, unit) RPC_service.t
2016-09-08 21:13:10 +04:00
val complete:
([ `POST ], unit,
(unit * block) * string, unit, unit,
2017-12-09 06:51:58 +04:00
string list, unit) RPC_service.t
2017-12-09 06:51:58 +04:00
val proto_path: (unit, unit * block) RPC_path.path
2016-09-08 21:13:10 +04:00
2016-09-08 21:13:10 +04:00
end
2016-10-21 16:01:20 +04:00
module Protocols : sig
2017-03-30 16:31:16 +04:00
val contents:
([ `POST ], unit,
unit * Protocol_hash.t, unit, unit,
2017-12-09 06:51:58 +04:00
Protocol.t, unit) RPC_service.t
2017-03-30 16:31:16 +04:00
2016-10-21 16:01:20 +04:00
type list_param = {
contents: bool option ;
monitor: bool option ;
}
2017-03-30 16:31:16 +04:00
2016-10-21 16:01:20 +04:00
val list:
([ `POST ], unit,
unit, unit, list_param,
2017-12-09 06:51:58 +04:00
(Protocol_hash.t * Protocol.t option) list, unit) RPC_service.t
2017-03-30 16:31:16 +04:00
2016-10-21 16:01:20 +04:00
end
module Network : sig
val stat :
([ `POST ], unit,
unit, unit, unit,
2017-12-09 06:51:58 +04:00
P2p_types.Stat.t, unit) RPC_service.t
val versions :
([ `POST ], unit,
unit, unit, unit,
2017-12-09 06:51:58 +04:00
P2p_types.Version.t list, unit) RPC_service.t
val events :
([ `POST ], unit,
unit, unit, unit,
2017-12-09 06:51:58 +04:00
P2p_types.Connection_pool_log_event.t, unit) RPC_service.t
val connect :
([ `POST ], unit,
unit * P2p_types.Point.t, unit, float,
2017-12-09 06:51:58 +04:00
unit tzresult, unit) RPC_service.t
module Connection : sig
val list :
([ `POST ], unit,
unit, unit, unit,
2017-12-09 06:51:58 +04:00
P2p_types.Connection_info.t list, unit) RPC_service.t
val info :
([ `POST ], unit,
unit * P2p_types.Peer_id.t, unit, unit,
2017-12-09 06:51:58 +04:00
P2p_types.Connection_info.t option, unit) RPC_service.t
val kick :
([ `POST ], unit,
unit * P2p_types.Peer_id.t, unit, bool,
2017-12-09 06:51:58 +04:00
unit, unit) RPC_service.t
end
module Point : sig
2017-03-02 18:39:36 +04:00
val list :
([ `POST ], unit,
unit, unit, P2p_types.Point_state.t list,
2017-12-09 06:51:58 +04:00
(P2p_types.Point.t * P2p_types.Point_info.t) list, unit) RPC_service.t
val info :
([ `POST ], unit,
unit * P2p_types.Point.t, unit, unit,
2017-12-09 06:51:58 +04:00
P2p_types.Point_info.t option, unit) RPC_service.t
val events :
([ `POST ], unit,
unit * P2p_types.Point.t, unit, bool,
2017-12-09 06:51:58 +04:00
P2p_connection_pool_types.Point_info.Event.t list, unit) RPC_service.t
end
2017-02-24 06:50:33 +04:00
module Peer_id : sig
2017-03-02 18:39:36 +04:00
val list :
([ `POST ], unit,
unit, unit, P2p_types.Peer_state.t list,
2017-12-09 06:51:58 +04:00
(P2p_types.Peer_id.t * P2p_types.Peer_info.t) list, unit) RPC_service.t
val info :
([ `POST ], unit,
unit * P2p_types.Peer_id.t, unit, unit,
2017-12-09 06:51:58 +04:00
P2p_types.Peer_info.t option, unit) RPC_service.t
val events :
([ `POST ], unit,
unit * P2p_types.Peer_id.t, unit, bool,
2017-12-09 06:51:58 +04:00
P2p_connection_pool_types.Peer_info.Event.t list, unit) RPC_service.t
end
end
val forge_block_header:
([ `POST ], unit,
unit, unit, Block_header.t,
2017-12-09 06:51:58 +04:00
MBytes.t, unit) RPC_service.t
2016-09-08 21:13:10 +04:00
type inject_block_param = {
raw: MBytes.t ;
blocking: bool ;
force: bool ;
net_id: Net_id.t option ;
operations: Operation.t list list ;
}
2016-09-08 21:13:10 +04:00
val inject_block:
([ `POST ], unit,
unit, unit, inject_block_param,
2017-12-09 06:51:58 +04:00
Block_hash.t tzresult, unit) RPC_service.t
2016-09-08 21:13:10 +04:00
val inject_operation:
([ `POST ], unit,
unit, unit, (MBytes.t * bool * Net_id.t option * bool option),
2017-12-09 06:51:58 +04:00
Operation_hash.t tzresult, unit) RPC_service.t
2016-09-08 21:13:10 +04:00
2016-10-21 16:01:20 +04:00
val inject_protocol:
([ `POST ], unit,
unit, unit, (Protocol.t * bool * bool option),
2017-12-09 06:51:58 +04:00
Protocol_hash.t tzresult, unit) RPC_service.t
val bootstrapped:
([ `POST ], unit,
unit, unit, unit,
2017-12-09 06:51:58 +04:00
Block_hash.t * Time.t, unit) RPC_service.t
val complete:
([ `POST ], unit,
unit * string, unit, unit,
2017-12-09 06:51:58 +04:00
string list, unit) RPC_service.t
2016-10-16 23:57:56 +04:00
2017-12-09 06:51:58 +04:00
val describe: (unit, unit) RPC_service.description_service