2016-09-08 21:13:10 +04:00
|
|
|
(**************************************************************************)
|
|
|
|
(* *)
|
2018-02-06 00:17:03 +04:00
|
|
|
(* Copyright (c) 2014 - 2018. *)
|
2016-09-08 21:13:10 +04:00
|
|
|
(* Dynamic Ledger Solutions, Inc. <contact@tezos.com> *)
|
|
|
|
(* *)
|
|
|
|
(* All rights reserved. No warranty, explicit or implicit, provided. *)
|
|
|
|
(* *)
|
|
|
|
(**************************************************************************)
|
|
|
|
|
2018-02-08 13:51:02 +04:00
|
|
|
|
|
|
|
open RPC_context
|
|
|
|
|
2017-04-27 03:01:05 +04:00
|
|
|
val forge_block_header:
|
2018-02-08 13:51:02 +04:00
|
|
|
#simple ->
|
|
|
|
Block_header.t ->
|
|
|
|
MBytes.t tzresult Lwt.t
|
2017-03-30 15:16:21 +04:00
|
|
|
|
2016-09-08 21:13:10 +04:00
|
|
|
val inject_block:
|
2018-02-08 13:51:02 +04:00
|
|
|
#simple ->
|
2018-02-16 04:26:24 +04:00
|
|
|
?async:bool -> ?force:bool -> ?chain_id:Chain_id.t ->
|
2018-02-08 13:51:02 +04:00
|
|
|
MBytes.t -> Operation.t list list ->
|
|
|
|
Block_hash.t tzresult Lwt.t
|
|
|
|
(** [inject_block cctxt ?async ?force raw_block] tries to inject
|
|
|
|
[raw_block] inside the node. If [?async] is [true], [raw_block]
|
|
|
|
will be validated before the result is returned. If [?force] is
|
|
|
|
true, the block will be injected even on non strictly increasing
|
|
|
|
fitness. *)
|
2016-09-08 21:13:10 +04:00
|
|
|
|
|
|
|
val inject_operation:
|
2018-02-08 13:51:02 +04:00
|
|
|
#simple ->
|
2018-02-16 04:26:24 +04:00
|
|
|
?async:bool -> ?chain_id:Chain_id.t ->
|
2018-02-08 13:51:02 +04:00
|
|
|
MBytes.t ->
|
|
|
|
Operation_hash.t tzresult Lwt.t
|
2016-09-08 21:13:10 +04:00
|
|
|
|
2016-10-21 16:01:20 +04:00
|
|
|
val inject_protocol:
|
2018-02-08 13:51:02 +04:00
|
|
|
#simple ->
|
|
|
|
?async:bool -> ?force:bool ->
|
|
|
|
Protocol.t ->
|
|
|
|
Protocol_hash.t tzresult Lwt.t
|
2017-12-07 20:43:21 +04:00
|
|
|
|
|
|
|
val bootstrapped:
|
2018-02-08 13:51:02 +04:00
|
|
|
#streamed -> ((Block_hash.t * Time.t) Lwt_stream.t * stopper) tzresult Lwt.t
|
2017-12-07 20:43:21 +04:00
|
|
|
|
2018-04-16 02:44:24 +04:00
|
|
|
module Monitor : sig
|
|
|
|
|
|
|
|
val valid_blocks:
|
|
|
|
#streamed ->
|
|
|
|
?chains:Chain_services.chain list ->
|
|
|
|
?protocols:Protocol_hash.t list ->
|
|
|
|
?next_protocols:Protocol_hash.t list ->
|
|
|
|
unit -> ((Chain_id.t * Block_hash.t) Lwt_stream.t * stopper) tzresult Lwt.t
|
|
|
|
|
|
|
|
val heads:
|
|
|
|
#streamed ->
|
|
|
|
?next_protocols:Protocol_hash.t list ->
|
|
|
|
Chain_services.chain ->
|
|
|
|
(Block_hash.t Lwt_stream.t * stopper) tzresult Lwt.t
|
|
|
|
|
|
|
|
end
|
2018-02-08 13:51:02 +04:00
|
|
|
|
|
|
|
module S : sig
|
|
|
|
|
|
|
|
val forge_block_header:
|
|
|
|
([ `POST ], unit,
|
|
|
|
unit, unit, Block_header.t,
|
|
|
|
MBytes.t) RPC_service.t
|
|
|
|
|
|
|
|
type inject_block_param = {
|
|
|
|
raw: MBytes.t ;
|
|
|
|
blocking: bool ;
|
|
|
|
force: bool ;
|
2018-02-16 04:26:24 +04:00
|
|
|
chain_id: Chain_id.t option ;
|
2018-02-08 13:51:02 +04:00
|
|
|
operations: Operation.t list list ;
|
|
|
|
}
|
|
|
|
|
|
|
|
val inject_block:
|
|
|
|
([ `POST ], unit,
|
|
|
|
unit, unit, inject_block_param,
|
2018-02-11 22:17:39 +04:00
|
|
|
Block_hash.t) RPC_service.t
|
2018-02-08 13:51:02 +04:00
|
|
|
|
|
|
|
val inject_operation:
|
|
|
|
([ `POST ], unit,
|
2018-02-16 04:26:24 +04:00
|
|
|
unit, unit, (MBytes.t * bool * Chain_id.t option),
|
2018-02-11 22:17:39 +04:00
|
|
|
Operation_hash.t) RPC_service.t
|
2018-02-08 13:51:02 +04:00
|
|
|
|
|
|
|
val inject_protocol:
|
|
|
|
([ `POST ], unit,
|
|
|
|
unit, unit, (Protocol.t * bool * bool option),
|
2018-02-11 22:17:39 +04:00
|
|
|
Protocol_hash.t) RPC_service.t
|
2018-02-08 13:51:02 +04:00
|
|
|
|
|
|
|
val bootstrapped:
|
|
|
|
([ `POST ], unit,
|
|
|
|
unit, unit, unit,
|
|
|
|
Block_hash.t * Time.t) RPC_service.t
|
|
|
|
|
2018-04-16 02:44:24 +04:00
|
|
|
module Monitor : sig
|
|
|
|
|
|
|
|
val valid_blocks:
|
|
|
|
([ `GET ], unit,
|
|
|
|
unit, < chains : Chain_services.chain list;
|
|
|
|
next_protocols : Protocol_hash.t list;
|
|
|
|
protocols : Protocol_hash.t list >, unit,
|
|
|
|
Chain_id.t * Block_hash.t) RPC_service.t
|
|
|
|
|
|
|
|
val heads:
|
|
|
|
([ `GET ], unit,
|
|
|
|
unit * Chain_services.chain,
|
|
|
|
< next_protocols : Protocol_hash.t list >, unit,
|
|
|
|
Block_hash.t) RPC_service.t
|
|
|
|
|
|
|
|
end
|
2018-02-08 13:51:02 +04:00
|
|
|
|
|
|
|
end
|