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. *)
|
|
|
|
(* *)
|
|
|
|
(**************************************************************************)
|
|
|
|
|
2017-04-05 01:35:41 +04:00
|
|
|
open Client_rpcs
|
|
|
|
|
2016-12-03 16:05:02 +04:00
|
|
|
val errors:
|
2017-04-05 01:35:41 +04:00
|
|
|
config -> Json_schema.schema tzresult Lwt.t
|
2016-12-03 16:05:02 +04:00
|
|
|
|
2017-04-27 03:01:05 +04:00
|
|
|
val forge_block_header:
|
2017-04-05 01:35:41 +04:00
|
|
|
config ->
|
2017-04-27 03:01:05 +04:00
|
|
|
Block_header.t ->
|
2017-04-05 01:35:41 +04:00
|
|
|
MBytes.t tzresult Lwt.t
|
2016-09-08 21:13:10 +04:00
|
|
|
|
|
|
|
val inject_block:
|
2017-04-05 01:35:41 +04:00
|
|
|
config ->
|
2017-11-14 06:14:26 +04:00
|
|
|
?async:bool -> ?force:bool -> ?net_id:Net_id.t ->
|
2017-11-14 02:27:19 +04:00
|
|
|
MBytes.t -> Operation.t list list ->
|
2016-09-08 21:13:10 +04:00
|
|
|
Block_hash.t tzresult Lwt.t
|
2017-03-30 15:08:33 +04:00
|
|
|
(** [inject_block cctxt ?async ?force raw_block] tries to inject
|
|
|
|
[raw_block] inside the node. If [?async] is [true], [raw_block]
|
2017-03-08 21:47:01 +04:00
|
|
|
will be validated before the result is returned. If [?force] is
|
|
|
|
true, the block will be injected even on non strictly increasing
|
|
|
|
fitness. *)
|
2016-12-03 16:05:02 +04:00
|
|
|
|
2016-09-08 21:13:10 +04:00
|
|
|
val inject_operation:
|
2017-04-05 01:35:41 +04:00
|
|
|
config ->
|
2017-11-14 05:41:37 +04:00
|
|
|
?async:bool -> ?force:bool -> ?net_id:Net_id.t ->
|
2016-12-03 16:05:02 +04:00
|
|
|
MBytes.t ->
|
|
|
|
Operation_hash.t tzresult Lwt.t
|
|
|
|
|
2016-10-21 16:01:20 +04:00
|
|
|
val inject_protocol:
|
2017-04-05 01:35:41 +04:00
|
|
|
config ->
|
2017-03-30 15:08:33 +04:00
|
|
|
?async:bool -> ?force:bool ->
|
2017-04-19 21:21:23 +04:00
|
|
|
Protocol.t ->
|
2016-12-03 16:05:02 +04:00
|
|
|
Protocol_hash.t tzresult Lwt.t
|
2016-09-08 21:13:10 +04:00
|
|
|
|
|
|
|
module Blocks : sig
|
|
|
|
|
2017-04-20 10:49:14 +04:00
|
|
|
type block = Node_rpc_services.Blocks.block
|
2016-09-08 21:13:10 +04:00
|
|
|
|
2017-04-20 10:26:43 +04:00
|
|
|
val net_id:
|
2017-04-05 01:35:41 +04:00
|
|
|
config ->
|
|
|
|
block -> Net_id.t tzresult Lwt.t
|
2017-04-10 15:01:22 +04:00
|
|
|
val level:
|
|
|
|
config ->
|
|
|
|
block -> Int32.t tzresult Lwt.t
|
2016-12-03 16:05:02 +04:00
|
|
|
val predecessor:
|
2017-04-05 01:35:41 +04:00
|
|
|
config ->
|
|
|
|
block -> Block_hash.t tzresult Lwt.t
|
2017-02-15 23:38:00 +04:00
|
|
|
val predecessors:
|
2017-04-05 01:35:41 +04:00
|
|
|
config ->
|
|
|
|
block -> int -> Block_hash.t list tzresult Lwt.t
|
2016-12-03 16:05:02 +04:00
|
|
|
val hash:
|
2017-04-05 01:35:41 +04:00
|
|
|
config ->
|
|
|
|
block -> Block_hash.t tzresult Lwt.t
|
2016-12-03 16:05:02 +04:00
|
|
|
val timestamp:
|
2017-04-05 01:35:41 +04:00
|
|
|
config ->
|
|
|
|
block -> Time.t tzresult Lwt.t
|
2016-12-03 16:05:02 +04:00
|
|
|
val fitness:
|
2017-04-05 01:35:41 +04:00
|
|
|
config ->
|
|
|
|
block -> MBytes.t list tzresult Lwt.t
|
2016-12-03 16:05:02 +04:00
|
|
|
val operations:
|
2017-04-05 01:35:41 +04:00
|
|
|
config ->
|
2017-04-19 23:46:10 +04:00
|
|
|
?contents:bool ->
|
|
|
|
block -> (Operation_hash.t * Operation.t option) list list tzresult Lwt.t
|
2016-12-03 16:05:02 +04:00
|
|
|
val protocol:
|
2017-04-05 01:35:41 +04:00
|
|
|
config ->
|
|
|
|
block -> Protocol_hash.t tzresult Lwt.t
|
2016-12-03 16:05:02 +04:00
|
|
|
val test_network:
|
2017-04-05 01:35:41 +04:00
|
|
|
config ->
|
2017-04-10 23:14:17 +04:00
|
|
|
block -> Context.test_network tzresult Lwt.t
|
2016-09-08 21:13:10 +04:00
|
|
|
|
|
|
|
val pending_operations:
|
2017-04-05 01:35:41 +04:00
|
|
|
config ->
|
|
|
|
block ->
|
2017-11-14 02:27:19 +04:00
|
|
|
(error Prevalidation.preapply_result * Operation.t Operation_hash.Map.t) tzresult Lwt.t
|
2016-09-08 21:13:10 +04:00
|
|
|
|
|
|
|
type block_info = {
|
|
|
|
hash: Block_hash.t ;
|
2017-04-10 19:06:11 +04:00
|
|
|
net_id: Net_id.t ;
|
2017-04-10 15:01:22 +04:00
|
|
|
level: Int32.t ;
|
2017-04-12 20:22:40 +04:00
|
|
|
proto_level: int ; (* uint8 *)
|
2016-09-08 21:13:10 +04:00
|
|
|
predecessor: Block_hash.t ;
|
|
|
|
timestamp: Time.t ;
|
2017-09-29 20:43:13 +04:00
|
|
|
validation_passes: int ; (* uint8 *)
|
2017-03-30 15:16:21 +04:00
|
|
|
operations_hash: Operation_list_list_hash.t ;
|
2017-04-10 19:06:11 +04:00
|
|
|
fitness: MBytes.t list ;
|
|
|
|
data: MBytes.t ;
|
2017-11-14 02:27:19 +04:00
|
|
|
operations: (Operation_hash.t * Operation.t) list list option ;
|
2017-04-10 19:06:11 +04:00
|
|
|
protocol: Protocol_hash.t ;
|
2017-04-10 23:14:17 +04:00
|
|
|
test_network: Context.test_network;
|
2016-09-08 21:13:10 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
val info:
|
2017-04-05 01:35:41 +04:00
|
|
|
config ->
|
2017-04-10 19:06:11 +04:00
|
|
|
?include_ops:bool -> block -> block_info tzresult Lwt.t
|
2016-09-08 21:13:10 +04:00
|
|
|
|
|
|
|
val list:
|
2017-04-05 01:35:41 +04:00
|
|
|
config ->
|
2017-04-10 19:06:11 +04:00
|
|
|
?include_ops:bool -> ?length:int -> ?heads:Block_hash.t list ->
|
2016-09-21 18:22:43 +04:00
|
|
|
?delay:int -> ?min_date:Time.t -> ?min_heads:int ->
|
2017-04-05 01:35:41 +04:00
|
|
|
unit -> block_info list list tzresult Lwt.t
|
2016-09-08 21:13:10 +04:00
|
|
|
|
|
|
|
val monitor:
|
2017-04-05 01:35:41 +04:00
|
|
|
config ->
|
2017-04-10 19:06:11 +04:00
|
|
|
?include_ops:bool -> ?length:int -> ?heads:Block_hash.t list ->
|
2016-09-21 18:22:43 +04:00
|
|
|
?delay:int -> ?min_date:Time.t -> ?min_heads:int ->
|
2017-04-05 01:35:41 +04:00
|
|
|
unit -> block_info list list tzresult Lwt_stream.t tzresult Lwt.t
|
2016-09-08 21:13:10 +04:00
|
|
|
|
|
|
|
type preapply_result = {
|
2017-04-27 03:01:05 +04:00
|
|
|
shell_header: Block_header.shell_header ;
|
2016-10-20 20:54:16 +04:00
|
|
|
operations: error Prevalidation.preapply_result ;
|
2016-09-08 21:13:10 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
val preapply:
|
2017-04-05 01:35:41 +04:00
|
|
|
config ->
|
2016-09-08 21:13:10 +04:00
|
|
|
block ->
|
|
|
|
?timestamp:Time.t ->
|
|
|
|
?sort:bool ->
|
2017-04-27 03:01:05 +04:00
|
|
|
proto_header:MBytes.t ->
|
2017-11-14 02:27:19 +04:00
|
|
|
Operation.t list -> preapply_result tzresult Lwt.t
|
2016-09-08 21:13:10 +04:00
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
module Operations : sig
|
2017-03-30 16:31:16 +04:00
|
|
|
|
2016-09-08 21:13:10 +04:00
|
|
|
val monitor:
|
2017-04-05 01:35:41 +04:00
|
|
|
config ->
|
2017-04-19 23:46:10 +04:00
|
|
|
?contents:bool ->
|
|
|
|
unit ->
|
|
|
|
(Operation_hash.t * Operation.t option) list list tzresult Lwt_stream.t tzresult Lwt.t
|
2017-03-30 16:31:16 +04:00
|
|
|
|
2016-09-08 21:13:10 +04:00
|
|
|
end
|
|
|
|
|
2016-10-25 21:00:03 +04:00
|
|
|
module Protocols : sig
|
2017-03-30 16:31:16 +04:00
|
|
|
|
|
|
|
val contents:
|
2017-04-05 01:35:41 +04:00
|
|
|
config ->
|
2017-04-19 21:21:23 +04:00
|
|
|
Protocol_hash.t -> Protocol.t tzresult Lwt.t
|
2016-10-25 21:00:03 +04:00
|
|
|
|
|
|
|
val list:
|
2017-04-05 01:35:41 +04:00
|
|
|
config ->
|
2016-10-25 21:00:03 +04:00
|
|
|
?contents:bool -> unit ->
|
2017-04-19 21:21:23 +04:00
|
|
|
(Protocol_hash.t * Protocol.t option) list tzresult Lwt.t
|
2017-03-30 16:31:16 +04:00
|
|
|
|
2016-10-25 21:00:03 +04:00
|
|
|
end
|
|
|
|
|
2017-02-28 03:48:22 +04:00
|
|
|
val bootstrapped:
|
2017-04-05 01:35:41 +04:00
|
|
|
config -> (Block_hash.t * Time.t) tzresult Lwt_stream.t tzresult Lwt.t
|
2017-02-28 03:48:22 +04:00
|
|
|
|
2017-03-02 18:39:36 +04:00
|
|
|
module Network : sig
|
2017-04-05 01:35:41 +04:00
|
|
|
|
2017-03-02 18:39:36 +04:00
|
|
|
val stat:
|
2017-04-05 01:35:41 +04:00
|
|
|
config -> P2p_types.Stat.t tzresult Lwt.t
|
|
|
|
|
2017-03-02 18:39:36 +04:00
|
|
|
val connections:
|
2017-04-05 01:35:41 +04:00
|
|
|
config -> P2p_types.Connection_info.t list tzresult Lwt.t
|
|
|
|
|
2017-03-02 18:39:36 +04:00
|
|
|
val peers:
|
2017-04-05 01:35:41 +04:00
|
|
|
config -> (P2p.Peer_id.t * P2p.RPC.Peer_id.info) list tzresult Lwt.t
|
|
|
|
|
2017-03-02 18:39:36 +04:00
|
|
|
val points:
|
2017-04-05 01:35:41 +04:00
|
|
|
config -> (P2p.Point.t * P2p.RPC.Point.info) list tzresult Lwt.t
|
|
|
|
|
2017-03-02 18:39:36 +04:00
|
|
|
end
|
|
|
|
|
2016-12-03 16:05:02 +04:00
|
|
|
val complete:
|
2017-04-05 01:35:41 +04:00
|
|
|
config ->
|
|
|
|
?block:Blocks.block -> string -> string list tzresult Lwt.t
|
2016-10-16 23:57:56 +04:00
|
|
|
|
2016-12-03 16:05:02 +04:00
|
|
|
val describe:
|
2017-04-05 01:35:41 +04:00
|
|
|
config ->
|
|
|
|
?recurse:bool -> string list ->
|
2017-11-27 09:13:12 +04:00
|
|
|
Data_encoding.json_schema RPC.Description.directory tzresult Lwt.t
|