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. *)
|
|
|
|
(* *)
|
|
|
|
(**************************************************************************)
|
|
|
|
|
|
|
|
val string_of_errors: error list -> string
|
2016-12-03 16:05:02 +04:00
|
|
|
val handle_error: Client_commands.context -> 'a tzresult -> 'a Lwt.t
|
2016-09-08 21:13:10 +04:00
|
|
|
|
|
|
|
type block = [
|
|
|
|
| `Genesis
|
|
|
|
| `Head of int | `Prevalidation
|
|
|
|
| `Test_head of int | `Test_prevalidation
|
|
|
|
| `Hash of Block_hash.t
|
|
|
|
]
|
|
|
|
|
|
|
|
module Constants : sig
|
2016-12-03 16:05:02 +04:00
|
|
|
val errors:
|
|
|
|
Client_commands.context ->
|
|
|
|
block -> Json_schema.schema Lwt.t
|
|
|
|
val cycle_length:
|
|
|
|
Client_commands.context ->
|
|
|
|
block -> int32 tzresult Lwt.t
|
|
|
|
val voting_period_length:
|
|
|
|
Client_commands.context ->
|
|
|
|
block -> int32 tzresult Lwt.t
|
|
|
|
val time_before_reward:
|
|
|
|
Client_commands.context ->
|
|
|
|
block -> Period.t tzresult Lwt.t
|
2017-02-24 21:32:30 +04:00
|
|
|
val slot_durations:
|
2016-12-03 16:05:02 +04:00
|
|
|
Client_commands.context ->
|
2017-02-24 21:32:30 +04:00
|
|
|
block -> (Period.t list) tzresult Lwt.t
|
2016-12-03 16:05:02 +04:00
|
|
|
val first_free_mining_slot:
|
|
|
|
Client_commands.context ->
|
|
|
|
block -> int32 tzresult Lwt.t
|
|
|
|
val max_signing_slot:
|
|
|
|
Client_commands.context ->
|
|
|
|
block -> int tzresult Lwt.t
|
|
|
|
val instructions_per_transaction:
|
|
|
|
Client_commands.context ->
|
|
|
|
block -> int tzresult Lwt.t
|
|
|
|
val stamp_threshold:
|
|
|
|
Client_commands.context ->
|
|
|
|
block -> int64 tzresult Lwt.t
|
2016-09-08 21:13:10 +04:00
|
|
|
end
|
|
|
|
|
|
|
|
module Context : sig
|
2016-12-03 16:05:02 +04:00
|
|
|
val level:
|
|
|
|
Client_commands.context ->
|
|
|
|
block -> Level.t tzresult Lwt.t
|
2017-03-08 21:47:01 +04:00
|
|
|
(** [level cctxt blk] returns the (protocol view of the) level of
|
|
|
|
[blk]. *)
|
|
|
|
|
2016-12-03 16:05:02 +04:00
|
|
|
val next_level:
|
|
|
|
Client_commands.context ->
|
|
|
|
block -> Level.t tzresult Lwt.t
|
2017-03-08 21:47:01 +04:00
|
|
|
(** [next_level cctxt blk] returns the (protocol view of the) level
|
|
|
|
of the successor of [blk]. *)
|
|
|
|
|
2016-09-08 21:13:10 +04:00
|
|
|
module Nonce : sig
|
2016-12-03 16:05:02 +04:00
|
|
|
val hash:
|
|
|
|
Client_commands.context ->
|
|
|
|
block -> Nonce_hash.t tzresult Lwt.t
|
2016-09-08 21:13:10 +04:00
|
|
|
type nonce_info =
|
|
|
|
| Revealed of Nonce.t
|
|
|
|
| Missing of Nonce_hash.t
|
|
|
|
| Forgotten
|
2016-12-03 16:05:02 +04:00
|
|
|
val get:
|
|
|
|
Client_commands.context ->
|
|
|
|
block -> Raw_level.t -> nonce_info tzresult Lwt.t
|
2016-09-08 21:13:10 +04:00
|
|
|
end
|
|
|
|
module Key : sig
|
|
|
|
val get :
|
2016-12-03 16:05:02 +04:00
|
|
|
Client_commands.context ->
|
2016-09-08 21:13:10 +04:00
|
|
|
block ->
|
|
|
|
public_key_hash -> (public_key_hash * public_key) tzresult Lwt.t
|
|
|
|
val list :
|
2016-12-03 16:05:02 +04:00
|
|
|
Client_commands.context ->
|
2016-09-08 21:13:10 +04:00
|
|
|
block ->
|
|
|
|
((public_key_hash * public_key) list) tzresult Lwt.t
|
|
|
|
end
|
|
|
|
module Contract : sig
|
2016-12-03 16:05:02 +04:00
|
|
|
val list:
|
|
|
|
Client_commands.context ->
|
|
|
|
block -> Contract.t list tzresult Lwt.t
|
2016-09-08 21:13:10 +04:00
|
|
|
type info = {
|
|
|
|
manager: public_key_hash ;
|
|
|
|
balance: Tez.t ;
|
|
|
|
spendable: bool ;
|
|
|
|
delegate: bool * public_key_hash option ;
|
2017-03-09 22:17:13 +04:00
|
|
|
script: Script.t option ;
|
2016-09-08 21:13:10 +04:00
|
|
|
assets: Asset.Map.t ;
|
|
|
|
counter: int32 ;
|
|
|
|
}
|
2016-12-03 16:05:02 +04:00
|
|
|
val get:
|
|
|
|
Client_commands.context ->
|
|
|
|
block -> Contract.t -> info tzresult Lwt.t
|
2016-09-08 21:13:10 +04:00
|
|
|
val balance:
|
2016-12-03 16:05:02 +04:00
|
|
|
Client_commands.context ->
|
2016-09-08 21:13:10 +04:00
|
|
|
block -> Contract.t ->
|
|
|
|
Tez.t tzresult Lwt.t
|
|
|
|
val manager:
|
2016-12-03 16:05:02 +04:00
|
|
|
Client_commands.context ->
|
2016-09-08 21:13:10 +04:00
|
|
|
block -> Contract.t ->
|
|
|
|
public_key_hash tzresult Lwt.t
|
|
|
|
val delegate:
|
2016-12-03 16:05:02 +04:00
|
|
|
Client_commands.context ->
|
2016-09-08 21:13:10 +04:00
|
|
|
block -> Contract.t ->
|
|
|
|
public_key_hash option tzresult Lwt.t
|
|
|
|
val counter:
|
2016-12-03 16:05:02 +04:00
|
|
|
Client_commands.context ->
|
2016-09-08 21:13:10 +04:00
|
|
|
block -> Contract.t ->
|
|
|
|
int32 tzresult Lwt.t
|
|
|
|
val spendable:
|
2016-12-03 16:05:02 +04:00
|
|
|
Client_commands.context ->
|
2016-09-08 21:13:10 +04:00
|
|
|
block -> Contract.t ->
|
|
|
|
bool tzresult Lwt.t
|
|
|
|
val delegatable:
|
2016-12-03 16:05:02 +04:00
|
|
|
Client_commands.context ->
|
2016-09-08 21:13:10 +04:00
|
|
|
block -> Contract.t ->
|
|
|
|
bool tzresult Lwt.t
|
|
|
|
val script:
|
2016-12-03 16:05:02 +04:00
|
|
|
Client_commands.context ->
|
2017-03-09 22:17:13 +04:00
|
|
|
block -> Contract.t -> Script.t option tzresult Lwt.t
|
2016-09-08 21:13:10 +04:00
|
|
|
val assets:
|
2016-12-03 16:05:02 +04:00
|
|
|
Client_commands.context ->
|
2016-09-08 21:13:10 +04:00
|
|
|
block -> Contract.t ->
|
|
|
|
Asset.Map.t tzresult Lwt.t
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
module Helpers : sig
|
|
|
|
val minimal_time:
|
2016-12-03 16:05:02 +04:00
|
|
|
Client_commands.context ->
|
2016-09-08 21:13:10 +04:00
|
|
|
block -> ?prio:int -> unit -> Time.t tzresult Lwt.t
|
2017-03-08 21:47:01 +04:00
|
|
|
(** [minimal_time cctxt blk ?prio ()] is the minimal acceptable
|
|
|
|
timestamp for the successor of [blk]. [?prio] defaults to
|
|
|
|
[0]. *)
|
|
|
|
|
2017-02-16 22:01:35 +04:00
|
|
|
val apply_operation:
|
|
|
|
Client_commands.context ->
|
|
|
|
block -> Block_hash.t -> Operation_hash.t -> MBytes.t -> MBytes.t option ->
|
|
|
|
(Contract.t list) tzresult Lwt.t
|
2016-12-03 16:05:02 +04:00
|
|
|
val run_code:
|
|
|
|
Client_commands.context ->
|
|
|
|
block -> Script.code ->
|
2016-11-15 18:58:18 +04:00
|
|
|
(Script.expr * Script.expr) ->
|
|
|
|
(Script.expr * Script.expr) tzresult Lwt.t
|
2016-12-03 16:05:02 +04:00
|
|
|
val trace_code:
|
|
|
|
Client_commands.context ->
|
|
|
|
block -> Script.code ->
|
2016-11-16 18:05:02 +04:00
|
|
|
(Script.expr * Script.expr) ->
|
|
|
|
(Script.expr * Script.expr *
|
|
|
|
(Script.location * int * Script.expr list) list) tzresult Lwt.t
|
2016-12-03 16:05:02 +04:00
|
|
|
val typecheck_code:
|
|
|
|
Client_commands.context ->
|
|
|
|
block -> Script.code -> Script_ir_translator.type_map tzresult Lwt.t
|
2017-01-11 20:42:54 +04:00
|
|
|
val typecheck_data:
|
2016-12-03 16:05:02 +04:00
|
|
|
Client_commands.context ->
|
|
|
|
block -> Script.expr * Script.expr -> unit tzresult Lwt.t
|
|
|
|
val hash_data:
|
|
|
|
Client_commands.context ->
|
|
|
|
block -> Script.expr -> string tzresult Lwt.t
|
|
|
|
val level:
|
|
|
|
Client_commands.context ->
|
|
|
|
block -> ?offset:int32 -> Raw_level.t -> Level.t tzresult Lwt.t
|
|
|
|
val levels:
|
|
|
|
Client_commands.context ->
|
2017-02-16 00:18:48 +04:00
|
|
|
block -> Cycle.t -> (Raw_level.t * Raw_level.t) tzresult Lwt.t
|
2016-09-08 21:13:10 +04:00
|
|
|
|
|
|
|
module Rights : sig
|
2017-03-14 19:32:01 +04:00
|
|
|
type mining_slot = Raw_level.t * int * Time.t
|
|
|
|
type endorsement_slot = Raw_level.t * int
|
2016-09-08 21:13:10 +04:00
|
|
|
val mining_rights_for_delegate:
|
2016-12-03 16:05:02 +04:00
|
|
|
Client_commands.context ->
|
2016-09-08 21:13:10 +04:00
|
|
|
block -> public_key_hash ->
|
|
|
|
?max_priority:int -> ?first_level:Raw_level.t ->
|
|
|
|
?last_level:Raw_level.t -> unit ->
|
2017-03-14 19:32:01 +04:00
|
|
|
(mining_slot list) tzresult Lwt.t
|
2016-09-08 21:13:10 +04:00
|
|
|
val endorsement_rights_for_delegate:
|
2016-12-03 16:05:02 +04:00
|
|
|
Client_commands.context ->
|
2016-09-08 21:13:10 +04:00
|
|
|
block -> public_key_hash ->
|
|
|
|
?max_priority:int -> ?first_level:Raw_level.t -> ?last_level:Raw_level.t -> unit ->
|
2017-03-14 19:32:01 +04:00
|
|
|
(endorsement_slot list) tzresult Lwt.t
|
2016-09-08 21:13:10 +04:00
|
|
|
end
|
|
|
|
|
|
|
|
module Forge : sig
|
|
|
|
module Manager : sig
|
|
|
|
val operations:
|
2016-12-03 16:05:02 +04:00
|
|
|
Client_commands.context ->
|
2016-09-08 21:13:10 +04:00
|
|
|
block ->
|
2017-02-24 20:17:53 +04:00
|
|
|
net:Updater.Net_id.t ->
|
2016-09-08 21:13:10 +04:00
|
|
|
source:Contract.t ->
|
|
|
|
?sourcePubKey:public_key ->
|
|
|
|
counter:int32 ->
|
|
|
|
fee:Tez.t ->
|
|
|
|
manager_operation list ->
|
2017-02-16 22:01:35 +04:00
|
|
|
MBytes.t tzresult Lwt.t
|
2016-09-08 21:13:10 +04:00
|
|
|
val transaction:
|
2016-12-03 16:05:02 +04:00
|
|
|
Client_commands.context ->
|
2016-09-08 21:13:10 +04:00
|
|
|
block ->
|
2017-02-24 20:17:53 +04:00
|
|
|
net:Updater.Net_id.t ->
|
2016-09-08 21:13:10 +04:00
|
|
|
source:Contract.t ->
|
|
|
|
?sourcePubKey:public_key ->
|
|
|
|
counter:int32 ->
|
|
|
|
amount:Tez.t ->
|
|
|
|
destination:Contract.t ->
|
|
|
|
?parameters:Script.expr ->
|
|
|
|
fee:Tez.t ->
|
|
|
|
unit -> MBytes.t tzresult Lwt.t
|
|
|
|
val origination:
|
2016-12-03 16:05:02 +04:00
|
|
|
Client_commands.context ->
|
2016-09-08 21:13:10 +04:00
|
|
|
block ->
|
2017-02-24 20:17:53 +04:00
|
|
|
net:Updater.Net_id.t ->
|
2016-09-08 21:13:10 +04:00
|
|
|
source:Contract.t ->
|
|
|
|
?sourcePubKey:public_key ->
|
|
|
|
counter:int32 ->
|
|
|
|
managerPubKey:public_key_hash ->
|
|
|
|
balance:Tez.t ->
|
|
|
|
?spendable:bool ->
|
|
|
|
?delegatable:bool ->
|
|
|
|
?delegatePubKey: public_key_hash ->
|
2017-03-09 22:17:13 +04:00
|
|
|
?script:Script.t ->
|
2016-09-08 21:13:10 +04:00
|
|
|
fee:Tez.t->
|
|
|
|
unit ->
|
2017-02-16 22:01:35 +04:00
|
|
|
MBytes.t tzresult Lwt.t
|
2016-09-08 21:13:10 +04:00
|
|
|
val issuance:
|
2016-12-03 16:05:02 +04:00
|
|
|
Client_commands.context ->
|
2016-09-08 21:13:10 +04:00
|
|
|
block ->
|
2017-02-24 20:17:53 +04:00
|
|
|
net:Updater.Net_id.t ->
|
2016-09-08 21:13:10 +04:00
|
|
|
source:Contract.t ->
|
|
|
|
?sourcePubKey:public_key ->
|
|
|
|
counter:int32 ->
|
|
|
|
assetType:(Asset.t * public_key_hash) ->
|
|
|
|
quantity:Tez.t ->
|
|
|
|
fee:Tez.t ->
|
|
|
|
unit -> MBytes.t tzresult Lwt.t
|
|
|
|
val delegation:
|
2016-12-03 16:05:02 +04:00
|
|
|
Client_commands.context ->
|
2016-09-08 21:13:10 +04:00
|
|
|
block ->
|
2017-02-24 20:17:53 +04:00
|
|
|
net:Updater.Net_id.t ->
|
2016-09-08 21:13:10 +04:00
|
|
|
source:Contract.t ->
|
|
|
|
?sourcePubKey:public_key ->
|
|
|
|
counter:int32 ->
|
|
|
|
fee:Tez.t ->
|
|
|
|
public_key_hash option ->
|
|
|
|
MBytes.t tzresult Lwt.t
|
|
|
|
end
|
2017-02-27 21:24:26 +04:00
|
|
|
module Dictator : sig
|
|
|
|
val operation:
|
|
|
|
Client_commands.context ->
|
|
|
|
block ->
|
|
|
|
net:Updater.Net_id.t ->
|
|
|
|
dictator_operation ->
|
|
|
|
MBytes.t tzresult Lwt.t
|
|
|
|
val activate:
|
|
|
|
Client_commands.context ->
|
|
|
|
block ->
|
|
|
|
net:Updater.Net_id.t ->
|
|
|
|
Protocol_hash.t ->
|
|
|
|
MBytes.t tzresult Lwt.t
|
|
|
|
val activate_testnet:
|
|
|
|
Client_commands.context ->
|
|
|
|
block ->
|
|
|
|
net:Updater.Net_id.t ->
|
|
|
|
Protocol_hash.t ->
|
|
|
|
MBytes.t tzresult Lwt.t
|
|
|
|
end
|
2016-09-08 21:13:10 +04:00
|
|
|
module Delegate : sig
|
|
|
|
val operations:
|
2016-12-03 16:05:02 +04:00
|
|
|
Client_commands.context ->
|
2016-09-08 21:13:10 +04:00
|
|
|
block ->
|
2017-02-24 20:17:53 +04:00
|
|
|
net:Updater.Net_id.t ->
|
2016-09-08 21:13:10 +04:00
|
|
|
source:public_key ->
|
|
|
|
delegate_operation list ->
|
|
|
|
MBytes.t tzresult Lwt.t
|
|
|
|
val endorsement:
|
2016-12-03 16:05:02 +04:00
|
|
|
Client_commands.context ->
|
2016-09-08 21:13:10 +04:00
|
|
|
block ->
|
2017-02-24 20:17:53 +04:00
|
|
|
net:Updater.Net_id.t ->
|
2016-09-08 21:13:10 +04:00
|
|
|
source:public_key ->
|
|
|
|
block:Block_hash.t ->
|
|
|
|
slot:int ->
|
|
|
|
unit -> MBytes.t tzresult Lwt.t
|
|
|
|
end
|
|
|
|
module Anonymous : sig
|
|
|
|
val operations:
|
2016-12-03 16:05:02 +04:00
|
|
|
Client_commands.context ->
|
2016-09-08 21:13:10 +04:00
|
|
|
block ->
|
2017-02-24 20:17:53 +04:00
|
|
|
net:Updater.Net_id.t ->
|
2016-09-08 21:13:10 +04:00
|
|
|
anonymous_operation list ->
|
|
|
|
MBytes.t tzresult Lwt.t
|
|
|
|
val seed_nonce_revelation:
|
2016-12-03 16:05:02 +04:00
|
|
|
Client_commands.context ->
|
2016-09-08 21:13:10 +04:00
|
|
|
block ->
|
2017-02-24 20:17:53 +04:00
|
|
|
net:Updater.Net_id.t ->
|
2016-09-08 21:13:10 +04:00
|
|
|
level:Raw_level.t ->
|
|
|
|
nonce:Nonce.t ->
|
|
|
|
unit -> MBytes.t tzresult Lwt.t
|
2017-02-28 05:48:51 +04:00
|
|
|
val faucet:
|
|
|
|
Client_commands.context ->
|
|
|
|
block ->
|
|
|
|
net:Updater.Net_id.t ->
|
|
|
|
id:public_key_hash ->
|
|
|
|
unit -> MBytes.t tzresult Lwt.t
|
2016-09-08 21:13:10 +04:00
|
|
|
end
|
2016-10-19 22:47:04 +04:00
|
|
|
val block:
|
2016-12-03 16:05:02 +04:00
|
|
|
Client_commands.context ->
|
2016-09-08 21:13:10 +04:00
|
|
|
block ->
|
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.t ->
|
|
|
|
operations:Operation_hash.t list ->
|
|
|
|
level:Raw_level.t ->
|
|
|
|
priority:int ->
|
|
|
|
seed_nonce_hash:Nonce_hash.t ->
|
|
|
|
proof_of_work_nonce:MBytes.t ->
|
|
|
|
unit -> MBytes.t tzresult Lwt.t
|
2017-03-08 21:47:01 +04:00
|
|
|
(** [block cctxt root ~net ~predecessor ~timestamp ~fitness
|
|
|
|
~operations ~level ~priority ~seed_nonce_hash
|
|
|
|
~proof_of_work_nonce ()] returns the binary serialization of
|
|
|
|
a block header (comprising the shell and protocol-specific
|
|
|
|
part), rooted at [root], belonging to [net], with
|
|
|
|
predecessor [predecessor], [timestamp], [fitness],
|
|
|
|
associated operations [operations], level [level] (the
|
|
|
|
protocol cannot deduce it from [predecessor] on its own),
|
|
|
|
priority [priority] (the priority of this miner in the
|
|
|
|
mining queue associated to [level]), [seed_nonce_hash] (the
|
|
|
|
chosen seed that we will reveal in the next cycle). *)
|
2016-09-08 21:13:10 +04:00
|
|
|
end
|
|
|
|
|
|
|
|
module Parse : sig
|
2017-03-21 20:23:06 +04:00
|
|
|
val operation:
|
2016-12-03 16:05:02 +04:00
|
|
|
Client_commands.context ->
|
2016-09-08 21:13:10 +04:00
|
|
|
block -> ?check:bool -> Updater.shell_operation -> MBytes.t ->
|
|
|
|
proto_operation tzresult Lwt.t
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|