Flexmasa.Mavryk_client
Wrapper around the main "mavkit-client"
application.
type t = {
id : Internal_pervasives.string;
port : Internal_pervasives.int;
exec : Mavryk_executable.t;
}
type client = t
val of_node : exec:Mavryk_executable.t -> Mavryk_node.t -> t
Create a client which is meant to communicate with a given node.
val no_node_client : exec:Mavryk_executable.t -> t
Create a client not connected to a node (e.g. for ledger interaction).
val base_dir : t -> state:< paths : Paths.t.. > -> Internal_pervasives.string
Get the path to the "--base-dir"
option of the client.
val client_call :
?wait:Internal_pervasives.string ->
< paths : Paths.t.. > ->
client ->
Internal_pervasives.string Internal_pervasives.list ->
Internal_pervasives.string Internal_pervasives.list
Build the arguments for a given default mavkit-client (not including the executable).
val client_command :
?wait:Internal_pervasives.string ->
< env_config : Environment_configuration.t ; paths : Paths.t.. > ->
client ->
Internal_pervasives.string Internal_pervasives.list ->
Internal_pervasives.unit Genspio.Language.t
Build a mavkit-client command, the default ?wait
is "none"
.
val wait_for_node_bootstrap :
< application_name : Internal_pervasives.string
; console : Console.t
; paths : Paths.t
; runner : Running_processes.State.t
; env_config : Environment_configuration.t.. > ->
client ->
(Internal_pervasives.unit,
[> Internal_pervasives.System_error.t
| Internal_pervasives.Process_result.Error.t ])
Internal_pervasives.Asynchronous_result.t
Wait for the node to be bootstrapped.
val import_secret_key :
< application_name : Internal_pervasives.string
; console : Console.t
; paths : Paths.t
; runner : Running_processes.State.t
; env_config : Environment_configuration.t.. > ->
client ->
name:Internal_pervasives.string ->
key:Internal_pervasives.string ->
(Internal_pervasives.unit,
[> Internal_pervasives.System_error.t
| Internal_pervasives.Process_result.Error.t ])
Internal_pervasives.Asynchronous_result.t
val register_as_delegate :
< application_name : Internal_pervasives.string
; console : Console.t
; paths : Paths.t
; runner : Running_processes.State.t
; env_config : Environment_configuration.t.. > ->
client ->
key_name:Internal_pervasives.string ->
(Internal_pervasives.unit,
[> Internal_pervasives.System_error.t
| Internal_pervasives.Process_result.Error.t ])
Internal_pervasives.Asynchronous_result.t
val activate_protocol :
< application_name : Internal_pervasives.string
; console : Console.t
; paths : Paths.t
; runner : Running_processes.State.t
; env_config : Environment_configuration.t.. > ->
client ->
Mavryk_protocol.t ->
(Internal_pervasives.unit,
[> Internal_pervasives.System_error.t
| Internal_pervasives.Process_result.Error.t ])
Internal_pervasives.Asynchronous_result.t
val client_cmd :
?id_prefix:Internal_pervasives.string ->
?verbose:Internal_pervasives.bool ->
?wait:Internal_pervasives.string ->
< application_name : Internal_pervasives.string
; console : Console.t
; paths : Paths.t
; env_config : Environment_configuration.t
; runner : Running_processes.State.t.. > ->
client:client ->
Internal_pervasives.string Internal_pervasives.list ->
(Internal_pervasives.bool * Internal_pervasives.Process_result.t,
[> Internal_pervasives.System_error.t ])
Internal_pervasives.Asynchronous_result.t
val successful_client_cmd :
?id_prefix:Internal_pervasives.string ->
?verbose:Internal_pervasives.bool ->
?wait:Internal_pervasives.string ->
< application_name : Internal_pervasives.string
; console : Console.t
; paths : Paths.t
; runner : Running_processes.State.t
; env_config : Environment_configuration.t.. >
Internal_pervasives.Base_state.t ->
client:t ->
Internal_pervasives.string Internal_pervasives.list ->
(< err : Internal_pervasives.string Internal_pervasives.list
; out : Internal_pervasives.string Internal_pervasives.list
; status : Unix.process_status >,
[> Internal_pervasives.Process_result.Error.t
| Internal_pervasives.System_error.t ])
Internal_pervasives.Asynchronous_result.t
val rpc :
< application_name : Internal_pervasives.string
; console : Console.t
; paths : Paths.t
; runner : Running_processes.State.t
; env_config : Environment_configuration.t.. >
Internal_pervasives.Base_state.t ->
client:t ->
[< `Get | `Post of Internal_pervasives.string ] ->
path:Internal_pervasives.string ->
(Ezjsonm.value,
[> Internal_pervasives.Process_result.Error.t
| Internal_pervasives.System_error.t ])
Internal_pervasives.Asynchronous_result.t
val find_applied_in_mempool :
< application_name : Internal_pervasives.string
; console : Console.t
; paths : Paths.t
; env_config : Environment_configuration.t
; runner : Running_processes.State.t.. > ->
client:client ->
f:(Ezjsonm.value -> Internal_pervasives.bool) ->
(Ezjsonm.value Internal_pervasives.option,
[> Internal_pervasives.Process_result.Error.t
| Internal_pervasives.System_error.t ])
Internal_pervasives.Asynchronous_result.t
Use RPCs to find an operation matching ~f
in the node's mempool.
val mempool_has_operation :
< application_name : Internal_pervasives.string
; console : Console.t
; paths : Paths.t
; runner : Running_processes.State.t
; env_config : Environment_configuration.t.. > ->
client:t ->
kind:Internal_pervasives.string ->
(Internal_pervasives.bool,
[> Internal_pervasives.Process_result.Error.t
| Internal_pervasives.System_error.t ])
Internal_pervasives.Asynchronous_result.t
Use RPCs to find an operation of kind ~kind
in the node's mempool.
val block_has_operation :
< application_name : Internal_pervasives.string
; console : Console.t
; env_config : Environment_configuration.t
; paths : Paths.t
; runner : Running_processes.State.t.. > ->
client:t ->
level:Internal_pervasives.int ->
kind:Internal_pervasives.string ->
(Internal_pervasives.bool,
[> Internal_pervasives.Process_result.Error.t
| Internal_pervasives.System_error.t ])
Internal_pervasives.Asynchronous_result.t
Use RPCs to find an operation of kind ~kind
in the node's chain at a given level.
val get_block_header :
< application_name : Internal_pervasives.string
; console : Console.t
; paths : Paths.t
; env_config : Environment_configuration.t
; runner : Running_processes.State.t.. > ->
client:t ->
[ `Head | `Level of Internal_pervasives.int ] ->
(Ezjsonm.value,
[> Internal_pervasives.Process_result.Error.t
| Internal_pervasives.System_error.t ])
Internal_pervasives.Asynchronous_result.t
Call the RPC "/chains/main/blocks/<block>/header"
.
val list_known_addresses :
< application_name : Internal_pervasives.string
; console : Console.t
; paths : Paths.t
; env_config : Environment_configuration.t
; runner : Running_processes.State.t.. > ->
client:t ->
((Internal_pervasives.string * Internal_pervasives.string)
Internal_pervasives.list,
[> Internal_pervasives.Process_result.Error.t
| Internal_pervasives.System_error.t ])
Internal_pervasives.Asynchronous_result.t
val prefix_from_list :
prefix:Internal_pervasives.string ->
Internal_pervasives.string Internal_pervasives.list ->
Internal_pervasives.string Internal_pervasives.option
val parse_account :
name:Internal_pervasives.string ->
lines:Internal_pervasives.string Internal_pervasives.list ->
Mavryk_protocol.Account.t Internal_pervasives.option
Parse Account from client output of the form: * Hash: mv1LkuVrpuEYCjZqTM93ri8aKYNtqFoYeACk * Public Key: edpkuTpUWcNgn4QYcBVGDLy6rmpJ3WSTSV2bdiJFwyoDk5fSwxyV5k * Secret Key: unencrypted:edsk3RFgDiCt7tWB2oe96w1eRw72iYiiqZPLu9nnEY23MYRp2d8Kkx
val get_account :
< application_name : Internal_pervasives.string
; console : Console.t
; paths : Paths.t
; env_config : Environment_configuration.t
; runner : Running_processes.State.t.. > ->
client:t ->
name:Internal_pervasives.string ->
(Mavryk_protocol.Account.t Internal_pervasives.option,
[> Internal_pervasives.Process_result.Error.t
| Internal_pervasives.System_error.t ])
Internal_pervasives.Asynchronous_result.t
val show_known_contract :
< application_name : Internal_pervasives.string
; console : Console.t
; paths : Paths.t
; env_config : Environment_configuration.t
; runner : Running_processes.State.t.. > ->
t ->
name:Internal_pervasives.string ->
(Internal_pervasives.string,
[> Internal_pervasives.Process_result.Error.t
| Internal_pervasives.System_error.t ])
Internal_pervasives.Asynchronous_result.t
val deploy_multisig :
?counter:Internal_pervasives.int ->
< application_name : Internal_pervasives.string
; console : Console.t
; paths : Paths.t
; env_config : Environment_configuration.t
; runner : Running_processes.State.t.. > ->
t ->
name:Internal_pervasives.string ->
amt:Internal_pervasives.float ->
from_acct:Internal_pervasives.string ->
threshold:Internal_pervasives.int ->
signer_names:Internal_pervasives.string Internal_pervasives.list ->
burn_cap:Internal_pervasives.float ->
(Internal_pervasives.unit, [> Internal_pervasives.System_error.t ])
Internal_pervasives.Asynchronous_result.t
Deploy the general multisig contract
val sign_multisig :
< application_name : Internal_pervasives.string
; console : Console.t
; paths : Paths.t
; env_config : Environment_configuration.t
; runner : Running_processes.State.t.. > ->
t ->
contract:Internal_pervasives.string ->
amt:Internal_pervasives.float ->
to_acct:Internal_pervasives.string ->
signer_name:Internal_pervasives.string ->
(Internal_pervasives.string, [> Internal_pervasives.System_error.t ])
Internal_pervasives.Asynchronous_result.t
sign a multisig contract
val transfer_from_multisig :
?counter:Internal_pervasives.int ->
< application_name : Internal_pervasives.string
; console : Console.t
; paths : Paths.t
; env_config : Environment_configuration.t
; runner : Running_processes.State.t.. > ->
t ->
name:Internal_pervasives.string ->
amt:Internal_pervasives.float ->
to_acct:Internal_pervasives.string ->
on_behalf_acct:Internal_pervasives.string ->
signatures:Internal_pervasives.string Internal_pervasives.list ->
burn_cap:Internal_pervasives.float ->
(Internal_pervasives.unit, [> Internal_pervasives.System_error.t ])
Internal_pervasives.Asynchronous_result.t
Submit a Transfer transaction using the fully-signed multisig contract
val hash_data :
< application_name : Internal_pervasives.string
; env_config : Environment_configuration.t
; console : Console.t
; paths : Paths.t
; runner : Running_processes.State.t.. > ->
?gas:Internal_pervasives.int ->
t ->
data_to_hash:Internal_pervasives.string ->
data_type:Internal_pervasives.string ->
(Internal_pervasives.string,
[> Internal_pervasives.Process_result.Error.t
| Internal_pervasives.System_error.t ])
Internal_pervasives.Asynchronous_result.t
val multisig_storage_counter :
< application_name : Internal_pervasives.string
; console : Console.t
; env_config : Environment_configuration.t
; paths : Paths.t
; runner : Running_processes.State.t.. > ->
t ->
Internal_pervasives.string ->
(Internal_pervasives.int,
[> Internal_pervasives.Process_result.Error.t
| `System_error of [ `Fatal ] * Internal_pervasives.System_error.static ])
Internal_pervasives.Asynchronous_result.t
module Ledger : sig ... end
module Keyed : sig ... end