2016-09-08 21:13:10 +04:00
|
|
|
(**************************************************************************)
|
|
|
|
(* *)
|
|
|
|
(* Copyright (c) 2014 - 2016. *)
|
|
|
|
(* Dynamic Ledger Solutions, Inc. <contact@tezos.com> *)
|
|
|
|
(* *)
|
|
|
|
(* All rights reserved. No warranty, explicit or implicit, provided. *)
|
|
|
|
(* *)
|
|
|
|
(**************************************************************************)
|
|
|
|
|
2016-12-03 16:05:02 +04:00
|
|
|
val errors:
|
|
|
|
Client_commands.context ->
|
|
|
|
Json_schema.schema Lwt.t
|
|
|
|
|
2016-09-08 21:13:10 +04:00
|
|
|
val forge_block:
|
2016-12-03 16:05:02 +04:00
|
|
|
Client_commands.context ->
|
2017-02-24 20:17:53 +04:00
|
|
|
?net:Updater.Net_id.t ->
|
2016-09-08 21:13:10 +04:00
|
|
|
?predecessor:Block_hash.t ->
|
|
|
|
?timestamp:Time.t ->
|
|
|
|
Fitness.fitness ->
|
|
|
|
Operation_hash.t list ->
|
|
|
|
MBytes.t ->
|
|
|
|
MBytes.t Lwt.t
|
2017-03-08 21:47:01 +04:00
|
|
|
(** [forge_block cctxt ?net ?predecessor ?timestamp fitness ops
|
|
|
|
proto_hdr] returns the serialization of a block header with
|
|
|
|
[proto_hdr] as protocol-specific part. The arguments [?net] and
|
|
|
|
[?predecessor] are infered from the current head of main network,
|
|
|
|
and [?timestamp] defaults to [Time.now ()]. *)
|
2016-09-08 21:13:10 +04:00
|
|
|
|
2016-12-03 16:05:02 +04:00
|
|
|
val validate_block:
|
|
|
|
Client_commands.context ->
|
2017-02-24 20:17:53 +04:00
|
|
|
Updater.Net_id.t -> Block_hash.t ->
|
2016-12-03 16:05:02 +04:00
|
|
|
unit tzresult Lwt.t
|
|
|
|
|
2016-09-08 21:13:10 +04:00
|
|
|
val inject_block:
|
2016-12-03 16:05:02 +04:00
|
|
|
Client_commands.context ->
|
2017-03-30 15:08:33 +04:00
|
|
|
?async:bool -> ?force:bool ->
|
2016-12-03 16:05:02 +04:00
|
|
|
MBytes.t ->
|
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:
|
2016-12-03 16:05:02 +04:00
|
|
|
Client_commands.context ->
|
2017-03-30 15:08:33 +04:00
|
|
|
?async:bool -> ?force:bool ->
|
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:
|
2016-12-03 16:05:02 +04:00
|
|
|
Client_commands.context ->
|
2017-03-30 15:08:33 +04:00
|
|
|
?async:bool -> ?force:bool ->
|
2016-12-03 16:05:02 +04:00
|
|
|
Tezos_compiler.Protocol.t ->
|
|
|
|
Protocol_hash.t tzresult Lwt.t
|
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
|
|
|
|
]
|
|
|
|
|
2016-12-03 16:05:02 +04:00
|
|
|
val net:
|
|
|
|
Client_commands.context ->
|
2017-02-24 20:17:53 +04:00
|
|
|
block -> Updater.Net_id.t Lwt.t
|
2016-12-03 16:05:02 +04:00
|
|
|
val predecessor:
|
|
|
|
Client_commands.context ->
|
|
|
|
block -> Block_hash.t Lwt.t
|
2017-02-15 23:38:00 +04:00
|
|
|
val predecessors:
|
|
|
|
Client_commands.context ->
|
|
|
|
block -> int -> Block_hash.t list Lwt.t
|
2016-12-03 16:05:02 +04:00
|
|
|
val hash:
|
|
|
|
Client_commands.context ->
|
|
|
|
block -> Block_hash.t Lwt.t
|
|
|
|
val timestamp:
|
|
|
|
Client_commands.context ->
|
|
|
|
block -> Time.t Lwt.t
|
|
|
|
val fitness:
|
|
|
|
Client_commands.context ->
|
|
|
|
block -> MBytes.t list Lwt.t
|
|
|
|
val operations:
|
|
|
|
Client_commands.context ->
|
|
|
|
block -> Operation_hash.t list Lwt.t
|
|
|
|
val protocol:
|
|
|
|
Client_commands.context ->
|
|
|
|
block -> Protocol_hash.t Lwt.t
|
|
|
|
val test_protocol:
|
|
|
|
Client_commands.context ->
|
|
|
|
block -> Protocol_hash.t option Lwt.t
|
|
|
|
val test_network:
|
|
|
|
Client_commands.context ->
|
2017-02-24 20:17:53 +04:00
|
|
|
block -> (Updater.Net_id.t * Time.t) option Lwt.t
|
2016-09-08 21:13:10 +04:00
|
|
|
|
|
|
|
val pending_operations:
|
2016-12-03 16:05:02 +04:00
|
|
|
Client_commands.context ->
|
2017-02-24 20:17:53 +04:00
|
|
|
block -> (error Updater.preapply_result * Operation_hash.Set.t) Lwt.t
|
2016-09-08 21:13:10 +04:00
|
|
|
|
|
|
|
type block_info = {
|
|
|
|
hash: Block_hash.t ;
|
|
|
|
predecessor: Block_hash.t ;
|
|
|
|
fitness: MBytes.t list ;
|
|
|
|
timestamp: Time.t ;
|
|
|
|
protocol: Protocol_hash.t option ;
|
|
|
|
operations: Operation_hash.t list option ;
|
2017-03-22 20:21:52 +04:00
|
|
|
data: MBytes.t option ;
|
2017-02-24 20:17:53 +04:00
|
|
|
net: Updater.Net_id.t ;
|
2016-09-08 21:13:10 +04:00
|
|
|
test_protocol: Protocol_hash.t option ;
|
2017-02-24 20:17:53 +04:00
|
|
|
test_network: (Updater.Net_id.t * Time.t) option ;
|
2016-09-08 21:13:10 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
val info:
|
2016-12-03 16:05:02 +04:00
|
|
|
Client_commands.context ->
|
2017-03-22 20:21:52 +04:00
|
|
|
?operations:bool -> ?data:bool -> block -> block_info Lwt.t
|
2016-09-08 21:13:10 +04:00
|
|
|
|
|
|
|
val list:
|
2016-12-03 16:05:02 +04:00
|
|
|
Client_commands.context ->
|
2017-03-22 20:21:52 +04:00
|
|
|
?operations:bool -> ?data: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 ->
|
2016-09-08 21:13:10 +04:00
|
|
|
unit -> block_info list list Lwt.t
|
|
|
|
|
|
|
|
val monitor:
|
2016-12-03 16:05:02 +04:00
|
|
|
Client_commands.context ->
|
2017-03-22 20:21:52 +04:00
|
|
|
?operations:bool -> ?data: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 ->
|
2016-09-08 21:13:10 +04:00
|
|
|
unit -> block_info list list Lwt_stream.t Lwt.t
|
|
|
|
|
|
|
|
type preapply_result = {
|
|
|
|
operations: error Updater.preapply_result ;
|
|
|
|
fitness: MBytes.t list ;
|
|
|
|
timestamp: Time.t ;
|
|
|
|
}
|
|
|
|
|
|
|
|
val preapply:
|
2016-12-03 16:05:02 +04:00
|
|
|
Client_commands.context ->
|
2016-09-08 21:13:10 +04:00
|
|
|
block ->
|
|
|
|
?timestamp:Time.t ->
|
|
|
|
?sort:bool ->
|
|
|
|
Hash.Operation_hash.t list -> preapply_result tzresult Lwt.t
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
module Operations : sig
|
|
|
|
val monitor:
|
2016-12-03 16:05:02 +04:00
|
|
|
Client_commands.context ->
|
2016-09-08 21:13:10 +04:00
|
|
|
?contents:bool -> unit ->
|
2017-02-24 20:17:53 +04:00
|
|
|
(Operation_hash.t * Store.Operation.t option) list Lwt_stream.t Lwt.t
|
2016-09-08 21:13:10 +04:00
|
|
|
end
|
|
|
|
|
2016-10-25 21:00:03 +04:00
|
|
|
module Protocols : sig
|
|
|
|
val bytes:
|
2016-12-03 16:05:02 +04:00
|
|
|
Client_commands.context ->
|
2017-02-24 20:17:53 +04:00
|
|
|
Protocol_hash.t -> Store.Protocol.t Lwt.t
|
2016-10-25 21:00:03 +04:00
|
|
|
|
|
|
|
val list:
|
2016-12-03 16:05:02 +04:00
|
|
|
Client_commands.context ->
|
2016-10-25 21:00:03 +04:00
|
|
|
?contents:bool -> unit ->
|
2017-02-24 20:17:53 +04:00
|
|
|
(Protocol_hash.t * Store.Protocol.t option) list Lwt.t
|
2016-10-25 21:00:03 +04:00
|
|
|
end
|
|
|
|
|
2017-02-28 03:48:22 +04:00
|
|
|
val bootstrapped:
|
|
|
|
Client_commands.context -> (Block_hash.t * Time.t) Lwt_stream.t Lwt.t
|
|
|
|
|
2017-03-02 18:39:36 +04:00
|
|
|
module Network : sig
|
|
|
|
val stat:
|
|
|
|
Client_commands.context -> P2p_types.Stat.t Lwt.t
|
|
|
|
val connections:
|
|
|
|
Client_commands.context -> P2p_types.Connection_info.t list Lwt.t
|
|
|
|
val peers:
|
|
|
|
Client_commands.context -> (P2p.Peer_id.t * P2p.RPC.Peer_id.info) list Lwt.t
|
|
|
|
val points:
|
|
|
|
Client_commands.context -> (P2p.Point.t * P2p.RPC.Point.info) list Lwt.t
|
|
|
|
end
|
|
|
|
|
2016-12-03 16:05:02 +04:00
|
|
|
val complete:
|
|
|
|
Client_commands.context ->
|
|
|
|
?block:Blocks.block -> string -> string list Lwt.t
|
2016-10-16 23:57:56 +04:00
|
|
|
|
2016-12-03 16:05:02 +04:00
|
|
|
val describe:
|
|
|
|
Client_commands.context ->
|
|
|
|
?recurse:bool -> string list -> RPC.Description.directory_descr Lwt.t
|
2016-09-08 21:13:10 +04:00
|
|
|
|
|
|
|
(** Low-level *)
|
|
|
|
|
2016-12-03 16:05:02 +04:00
|
|
|
val get_json:
|
|
|
|
Client_commands.context ->
|
2016-12-11 19:34:58 +04:00
|
|
|
RPC.meth -> string list -> Data_encoding.json -> Data_encoding.json Lwt.t
|
2016-09-08 21:13:10 +04:00
|
|
|
|
|
|
|
val call_service0:
|
2016-12-03 16:05:02 +04:00
|
|
|
Client_commands.context ->
|
2016-09-08 21:13:10 +04:00
|
|
|
(unit, unit, 'i, 'o) RPC.service -> 'i -> 'o Lwt.t
|
|
|
|
val call_service1:
|
2016-12-03 16:05:02 +04:00
|
|
|
Client_commands.context ->
|
2016-09-08 21:13:10 +04:00
|
|
|
(unit, unit * 'a, 'i, 'o) RPC.service -> 'a -> 'i -> 'o Lwt.t
|
|
|
|
val call_service2:
|
2016-12-03 16:05:02 +04:00
|
|
|
Client_commands.context ->
|
2016-09-08 21:13:10 +04:00
|
|
|
(unit, (unit * 'a) * 'b, 'i, 'o) RPC.service -> 'a -> 'b -> 'i -> 'o Lwt.t
|