ligo/src/client/client_node_rpcs.mli

207 lines
5.4 KiB
OCaml
Raw Normal View History

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. *)
(* *)
(**************************************************************************)
open Client_rpcs
val errors:
config -> Json_schema.schema tzresult Lwt.t
2016-09-08 21:13:10 +04:00
val forge_block:
config ->
2017-03-31 15:04:05 +04:00
?net:Net_id.t ->
?level:Int32.t ->
2016-09-08 21:13:10 +04:00
?predecessor:Block_hash.t ->
?timestamp:Time.t ->
Fitness.fitness ->
Operation_list_list_hash.t ->
2016-09-08 21:13:10 +04:00
MBytes.t ->
MBytes.t tzresult 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
val validate_block:
config ->
2017-03-31 15:04:05 +04:00
Net_id.t -> Block_hash.t ->
unit tzresult Lwt.t
2016-09-08 21:13:10 +04:00
val inject_block:
config ->
2017-03-30 15:08:33 +04:00
?async:bool -> ?force:bool ->
MBytes.t -> Operation_hash.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-09-08 21:13:10 +04:00
val inject_operation:
config ->
2017-03-30 15:08:33 +04:00
?async:bool -> ?force:bool ->
MBytes.t ->
Operation_hash.t tzresult Lwt.t
2016-10-21 16:01:20 +04:00
val inject_protocol:
config ->
2017-03-30 15:08:33 +04:00
?async:bool -> ?force:bool ->
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
]
val net:
config ->
block -> Net_id.t tzresult Lwt.t
val level:
config ->
block -> Int32.t tzresult Lwt.t
val predecessor:
config ->
block -> Block_hash.t tzresult Lwt.t
val predecessors:
config ->
block -> int -> Block_hash.t list tzresult Lwt.t
val hash:
config ->
block -> Block_hash.t tzresult Lwt.t
val timestamp:
config ->
block -> Time.t tzresult Lwt.t
val fitness:
config ->
block -> MBytes.t list tzresult Lwt.t
val operations:
config ->
block -> Operation_hash.t list list tzresult Lwt.t
val protocol:
config ->
block -> Protocol_hash.t tzresult Lwt.t
val test_protocol:
config ->
block -> Protocol_hash.t option tzresult Lwt.t
val test_network:
config ->
block -> (Net_id.t * Time.t) option tzresult Lwt.t
2016-09-08 21:13:10 +04:00
val pending_operations:
config ->
block ->
(error Prevalidation.preapply_result * Operation_hash.Set.t) tzresult Lwt.t
2016-09-08 21:13:10 +04:00
type block_info = {
hash: Block_hash.t ;
level: Int32.t ;
2016-09-08 21:13:10 +04:00
predecessor: Block_hash.t ;
fitness: MBytes.t list ;
timestamp: Time.t ;
protocol: Protocol_hash.t option ;
operations_hash: Operation_list_list_hash.t ;
operations: Operation_hash.t list list option ;
data: MBytes.t option ;
2017-03-31 15:04:05 +04:00
net: Net_id.t ;
2016-09-08 21:13:10 +04:00
test_protocol: Protocol_hash.t option ;
2017-03-31 15:04:05 +04:00
test_network: (Net_id.t * Time.t) option ;
2016-09-08 21:13:10 +04:00
}
val info:
config ->
?operations:bool -> ?data:bool -> block -> block_info tzresult Lwt.t
2016-09-08 21:13:10 +04:00
val list:
config ->
?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 ->
unit -> block_info list list tzresult Lwt.t
2016-09-08 21:13:10 +04:00
val monitor:
config ->
?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 ->
unit -> block_info list list tzresult Lwt_stream.t tzresult Lwt.t
2016-09-08 21:13:10 +04:00
type preapply_result = {
operations: error Prevalidation.preapply_result ;
2016-09-08 21:13:10 +04:00
fitness: MBytes.t list ;
timestamp: Time.t ;
}
val preapply:
config ->
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
2017-03-30 16:31:16 +04:00
val contents:
config ->
Operation_hash.t list -> Store.Operation.t list tzresult Lwt.t
2017-03-30 16:31:16 +04:00
2016-09-08 21:13:10 +04:00
val monitor:
config ->
2016-09-08 21:13:10 +04:00
?contents:bool -> unit ->
(Operation_hash.t * Store.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:
config ->
Protocol_hash.t -> Store.Protocol.t tzresult Lwt.t
2016-10-25 21:00:03 +04:00
val list:
config ->
2016-10-25 21:00:03 +04:00
?contents:bool -> unit ->
(Protocol_hash.t * Store.Protocol.t option) list tzresult Lwt.t
2017-03-30 16:31:16 +04:00
2016-10-25 21:00:03 +04:00
end
val bootstrapped:
config -> (Block_hash.t * Time.t) tzresult Lwt_stream.t tzresult Lwt.t
2017-03-02 18:39:36 +04:00
module Network : sig
2017-03-02 18:39:36 +04:00
val stat:
config -> P2p_types.Stat.t tzresult Lwt.t
2017-03-02 18:39:36 +04:00
val connections:
config -> P2p_types.Connection_info.t list tzresult Lwt.t
2017-03-02 18:39:36 +04:00
val peers:
config -> (P2p.Peer_id.t * P2p.RPC.Peer_id.info) list tzresult Lwt.t
2017-03-02 18:39:36 +04:00
val points:
config -> (P2p.Point.t * P2p.RPC.Point.info) list tzresult Lwt.t
2017-03-02 18:39:36 +04:00
end
val complete:
config ->
?block:Blocks.block -> string -> string list tzresult Lwt.t
2016-10-16 23:57:56 +04:00
val describe:
config ->
?recurse:bool -> string list ->
RPC.Description.directory_descr tzresult Lwt.t