2018-01-26 16:07:49 +04:00
|
|
|
(**************************************************************************)
|
|
|
|
(* *)
|
2018-02-06 00:17:03 +04:00
|
|
|
(* Copyright (c) 2014 - 2018. *)
|
2018-01-26 16:07:49 +04:00
|
|
|
(* Dynamic Ledger Solutions, Inc. <contact@tezos.com> *)
|
|
|
|
(* *)
|
|
|
|
(* All rights reserved. No warranty, explicit or implicit, provided. *)
|
|
|
|
(* *)
|
|
|
|
(**************************************************************************)
|
|
|
|
|
|
|
|
type block = [
|
|
|
|
| `Genesis
|
|
|
|
| `Head of int | `Prevalidation
|
|
|
|
| `Test_head of int | `Test_prevalidation
|
|
|
|
| `Hash of Block_hash.t
|
|
|
|
]
|
|
|
|
|
2018-02-11 22:17:39 +04:00
|
|
|
val last_baked_block:
|
|
|
|
block -> [>
|
|
|
|
| `Genesis
|
|
|
|
| `Head of int
|
|
|
|
| `Test_head of int
|
|
|
|
| `Hash of Block_hash.t
|
|
|
|
]
|
2018-01-26 16:07:49 +04:00
|
|
|
val parse_block: string -> (block, string) result
|
|
|
|
val to_string: block -> string
|
|
|
|
|
|
|
|
type block_info = {
|
|
|
|
hash: Block_hash.t ;
|
|
|
|
net_id: Net_id.t ;
|
|
|
|
level: Int32.t ;
|
|
|
|
proto_level: int ; (* uint8 *)
|
|
|
|
predecessor: Block_hash.t ;
|
|
|
|
timestamp: Time.t ;
|
|
|
|
validation_passes: int ; (* uint8 *)
|
|
|
|
operations_hash: Operation_list_list_hash.t ;
|
|
|
|
fitness: MBytes.t list ;
|
|
|
|
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 ;
|
|
|
|
}
|
|
|
|
|
2018-02-08 13:51:02 +04:00
|
|
|
type preapply_result = {
|
|
|
|
shell_header: Block_header.shell_header ;
|
|
|
|
operations: error Preapply_result.t list ;
|
|
|
|
}
|
|
|
|
|
|
|
|
open RPC_context
|
|
|
|
|
2018-01-26 16:07:49 +04:00
|
|
|
val net_id:
|
2018-02-08 13:51:02 +04:00
|
|
|
#simple -> block -> Net_id.t tzresult Lwt.t
|
2018-01-26 16:07:49 +04:00
|
|
|
val level:
|
2018-02-08 13:51:02 +04:00
|
|
|
#simple -> block -> Int32.t tzresult Lwt.t
|
2018-01-26 16:07:49 +04:00
|
|
|
val predecessor:
|
2018-02-08 13:51:02 +04:00
|
|
|
#simple -> block -> Block_hash.t tzresult Lwt.t
|
2018-01-26 16:07:49 +04:00
|
|
|
val predecessors:
|
2018-02-08 13:51:02 +04:00
|
|
|
#simple -> block -> int -> Block_hash.t list tzresult Lwt.t
|
2018-01-26 16:07:49 +04:00
|
|
|
val hash:
|
2018-02-08 13:51:02 +04:00
|
|
|
#simple -> block -> Block_hash.t tzresult Lwt.t
|
2018-01-26 16:07:49 +04:00
|
|
|
val timestamp:
|
2018-02-08 13:51:02 +04:00
|
|
|
#simple -> block -> Time.t tzresult Lwt.t
|
2018-01-26 16:07:49 +04:00
|
|
|
val fitness:
|
2018-02-08 13:51:02 +04:00
|
|
|
#simple -> block -> MBytes.t list tzresult Lwt.t
|
2018-01-26 16:07:49 +04:00
|
|
|
val operations:
|
2018-02-08 13:51:02 +04:00
|
|
|
#simple -> ?contents:bool ->
|
|
|
|
block -> (Operation_hash.t * Operation.t option) list list tzresult Lwt.t
|
2018-01-26 16:07:49 +04:00
|
|
|
val protocol:
|
2018-02-08 13:51:02 +04:00
|
|
|
#simple -> block -> Protocol_hash.t tzresult Lwt.t
|
2018-01-26 16:07:49 +04:00
|
|
|
val test_network:
|
2018-02-08 13:51:02 +04:00
|
|
|
#simple -> block -> Test_network_status.t tzresult Lwt.t
|
|
|
|
|
2018-01-26 16:07:49 +04:00
|
|
|
val pending_operations:
|
2018-02-08 13:51:02 +04:00
|
|
|
#simple -> block ->
|
|
|
|
(error Preapply_result.t * Operation.t Operation_hash.Map.t) tzresult Lwt.t
|
2018-01-26 16:07:49 +04:00
|
|
|
|
2018-02-08 13:51:02 +04:00
|
|
|
val info:
|
|
|
|
#simple ->
|
|
|
|
?include_ops:bool -> block -> block_info tzresult Lwt.t
|
2018-01-26 16:07:49 +04:00
|
|
|
|
2018-02-08 13:51:02 +04:00
|
|
|
val list:
|
|
|
|
?include_ops:bool -> ?length:int -> ?heads:Block_hash.t list ->
|
|
|
|
?delay:int -> ?min_date:Time.t -> ?min_heads:int ->
|
|
|
|
#simple ->
|
|
|
|
block_info list list tzresult Lwt.t
|
2018-01-26 16:07:49 +04:00
|
|
|
|
2018-02-08 13:51:02 +04:00
|
|
|
val monitor:
|
|
|
|
?include_ops:bool -> ?length:int -> ?heads:Block_hash.t list ->
|
|
|
|
?delay:int -> ?min_date:Time.t -> ?min_heads:int ->
|
|
|
|
#streamed ->
|
|
|
|
(block_info list list Lwt_stream.t * stopper) tzresult Lwt.t
|
2018-01-26 16:07:49 +04:00
|
|
|
|
|
|
|
val preapply:
|
2018-02-08 13:51:02 +04:00
|
|
|
#simple -> block ->
|
|
|
|
?timestamp:Time.t ->
|
|
|
|
?sort:bool ->
|
|
|
|
proto_header:MBytes.t ->
|
|
|
|
Operation.t list list -> preapply_result tzresult Lwt.t
|
2018-01-26 16:07:49 +04:00
|
|
|
|
|
|
|
val complete:
|
2018-02-08 13:51:02 +04:00
|
|
|
#simple -> block -> string -> string list tzresult Lwt.t
|
|
|
|
|
|
|
|
val monitor_prevalidated_operations:
|
|
|
|
?contents:bool ->
|
|
|
|
#streamed ->
|
|
|
|
((Operation_hash.t * Operation.t option) list list Lwt_stream.t * stopper) tzresult Lwt.t
|
|
|
|
|
|
|
|
val unmark_invalid:
|
|
|
|
#simple -> Block_hash.t -> unit Error_monad.tzresult Lwt.t
|
|
|
|
val list_invalid:
|
|
|
|
#simple -> (Block_hash.t * int32 * error list) list tzresult Lwt.t
|
|
|
|
|
|
|
|
|
|
|
|
module S : sig
|
|
|
|
|
|
|
|
val blocks_arg : block RPC_arg.arg
|
|
|
|
|
|
|
|
val info:
|
|
|
|
([ `POST ], unit,
|
|
|
|
unit * block, unit, bool,
|
|
|
|
block_info) RPC_service.t
|
|
|
|
val net_id:
|
|
|
|
([ `POST ], unit,
|
|
|
|
unit * block, unit, unit,
|
|
|
|
Net_id.t) RPC_service.t
|
|
|
|
val level:
|
|
|
|
([ `POST ], unit,
|
|
|
|
unit * block, unit, unit,
|
|
|
|
Int32.t) RPC_service.t
|
|
|
|
val predecessor:
|
|
|
|
([ `POST ], unit,
|
|
|
|
unit * block, unit, unit,
|
|
|
|
Block_hash.t) RPC_service.t
|
|
|
|
val predecessors:
|
|
|
|
([ `POST ], unit,
|
|
|
|
unit * block , unit, int,
|
|
|
|
Block_hash.t list) RPC_service.t
|
|
|
|
val hash:
|
|
|
|
([ `POST ], unit,
|
|
|
|
unit * block, unit, unit,
|
|
|
|
Block_hash.t) RPC_service.t
|
|
|
|
val timestamp:
|
|
|
|
([ `POST ], unit,
|
|
|
|
unit * block, unit, unit,
|
|
|
|
Time.t) RPC_service.t
|
|
|
|
val fitness:
|
|
|
|
([ `POST ], unit,
|
|
|
|
unit * block, unit, unit,
|
|
|
|
MBytes.t list) RPC_service.t
|
|
|
|
val context:
|
|
|
|
([ `POST ], unit,
|
|
|
|
unit * block, unit, unit,
|
|
|
|
Context_hash.t) RPC_service.t
|
|
|
|
|
|
|
|
type operations_param = {
|
|
|
|
contents: bool ;
|
|
|
|
monitor: bool ;
|
|
|
|
}
|
|
|
|
val operations:
|
|
|
|
([ `POST ], unit,
|
|
|
|
unit * block, unit, operations_param,
|
|
|
|
(Operation_hash.t * Operation.t option) list list) RPC_service.t
|
|
|
|
|
|
|
|
val protocol:
|
|
|
|
([ `POST ], unit,
|
|
|
|
unit * block, unit, unit,
|
|
|
|
Protocol_hash.t) RPC_service.t
|
|
|
|
val test_network:
|
|
|
|
([ `POST ], unit,
|
|
|
|
unit * block, unit, unit,
|
|
|
|
Test_network_status.t) RPC_service.t
|
|
|
|
val pending_operations:
|
|
|
|
([ `POST ], unit,
|
|
|
|
unit * block, unit, unit,
|
|
|
|
error Preapply_result.t * Operation.t Operation_hash.Map.t) RPC_service.t
|
|
|
|
|
|
|
|
type list_param = {
|
|
|
|
include_ops: bool ;
|
|
|
|
length: int option ;
|
|
|
|
heads: Block_hash.t list option ;
|
|
|
|
monitor: bool option ;
|
|
|
|
delay: int option ;
|
|
|
|
min_date: Time.t option;
|
|
|
|
min_heads: int option;
|
|
|
|
}
|
|
|
|
val list:
|
|
|
|
([ `POST ], unit,
|
|
|
|
unit, unit, list_param,
|
|
|
|
block_info list list) RPC_service.t
|
|
|
|
|
|
|
|
val list_invalid:
|
|
|
|
([ `POST ], unit,
|
|
|
|
unit, unit, unit,
|
|
|
|
(Block_hash.t * int32 * error list) list) RPC_service.t
|
|
|
|
|
|
|
|
val unmark_invalid:
|
|
|
|
([ `POST ], unit,
|
|
|
|
unit * Block_hash.t, unit, unit,
|
2018-02-11 22:17:39 +04:00
|
|
|
unit) RPC_service.t
|
2018-02-08 13:51:02 +04:00
|
|
|
|
|
|
|
type preapply_param = {
|
|
|
|
timestamp: Time.t ;
|
|
|
|
proto_header: MBytes.t ;
|
|
|
|
operations: Operation.t list list ;
|
|
|
|
sort_operations: bool ;
|
|
|
|
}
|
|
|
|
|
|
|
|
val preapply:
|
|
|
|
([ `POST ], unit,
|
|
|
|
unit * block, unit, preapply_param,
|
2018-02-11 22:17:39 +04:00
|
|
|
preapply_result) RPC_service.t
|
2018-02-08 13:51:02 +04:00
|
|
|
|
|
|
|
val complete:
|
|
|
|
([ `POST ], unit,
|
|
|
|
(unit * block) * string, unit, unit,
|
|
|
|
string list) RPC_service.t
|
|
|
|
|
2018-02-11 22:17:40 +04:00
|
|
|
val proto_path: unit -> ('a, 'a * block) RPC_path.path
|
2018-01-26 16:07:49 +04:00
|
|
|
|
2018-02-08 13:51:02 +04:00
|
|
|
end
|