Evm_node_lib_dev.Evm_directory
module EndpointMap :
Tezos_base.TzPervasives.Map.S with type key = Cohttp.Code.meth * string
type resto_dir = {
dir : unit Tezos_rpc.Directory.t;
extra : (Cohttp_lwt_unix.Server.conn ->
Cohttp.Request.t ->
Cohttp_lwt.Body.t ->
Cohttp_lwt_unix.Server.response_action Lwt.t)
EndpointMap.t;
}
type t = private
| Resto of resto_dir
A Resto directory
*)| Dream of Dream.route Tezos_base.TzPervasives.trace
A list of Dream routes
*)The type of RPC directory for EVM node depending on the chosen RPC server backend.
val empty : Evm_node_config.Configuration.rpc_server -> t
An empty directory depending on the RPC server backend.
val init_from_resto_directory : unit Tezos_rpc.Directory.t -> t
A directory initialised with a resto directory. Will produce a Resto
value, so not compatible with Dream.
val register :
t ->
([< Resto.meth ], unit, 'params, 'query, 'input, 'output) Tezos_rpc.Service.t ->
('params ->
'query ->
'input ->
'output Tezos_base.TzPervasives.tzresult Lwt.t) ->
t
Register a new service with it's handler.
val opt_register :
t ->
([< Resto.meth ], unit, 'params, 'query, 'input, 'output) Tezos_rpc.Service.t ->
('params ->
'query ->
'input ->
'output option Tezos_base.TzPervasives.tzresult Lwt.t) ->
t
Register a new service with it's handler. The server answers with 404 Not_Found if the handler returns None
.
val lwt_register :
t ->
([< Resto.meth ], unit, 'params, 'query, 'input, 'output) Tezos_rpc.Service.t ->
('params -> 'query -> 'input -> 'output Lwt.t) ->
t
Register a new service with it's handler.
val streamed_register :
t ->
([< Resto.meth ], unit, 'params, 'query, 'input, 'output) Tezos_rpc.Service.t ->
('params ->
'query ->
'input ->
('output Lwt_stream.t * (unit -> unit)) Lwt.t) ->
t
Register a new streamed service. The handler should produce output elements in a stream.
val jsonrpc_websocket_register :
?monitor:Evm_node_config.Configuration.monitor_websocket_heartbeat ->
max_message_length:int ->
t ->
string ->
Rpc_encodings.websocket_handler ->
t
Register a new websocket service. The handler should return an initial JSONRPC response and optionally produce output elements in a stream for subscription services. Requests above max_message_length
will be rejected and the connection closed (only for Resto
directories). If monitor
is provided, the websocket connection is monitored with the given parameters (only for Resto
directories).
Registers a /describe
service for a Resto directory. No effect for a Dream directory.
val register0 :
t ->
([< Resto.meth ], unit, unit, 'query, 'input, 'output) Tezos_rpc.Service.t ->
('query -> 'input -> 'output Tezos_base.TzPervasives.tzresult Lwt.t) ->
t
val register1 :
t ->
([< Resto.meth ], unit, unit * 'a, 'query, 'input, 'output)
Tezos_rpc.Service.t ->
('a -> 'query -> 'input -> 'output Tezos_base.TzPervasives.tzresult Lwt.t) ->
t
val register2 :
t ->
([< Resto.meth ], unit, (unit * 'a) * 'b, 'query, 'input, 'output)
Tezos_rpc.Service.t ->
('a ->
'b ->
'query ->
'input ->
'output Tezos_base.TzPervasives.tzresult Lwt.t) ->
t
val opt_register0 :
t ->
([< Resto.meth ], unit, unit, 'query, 'input, 'output) Tezos_rpc.Service.t ->
('query -> 'input -> 'output option Tezos_base.TzPervasives.tzresult Lwt.t) ->
t
val opt_register1 :
t ->
([< Resto.meth ], unit, unit * 'a, 'query, 'input, 'output)
Tezos_rpc.Service.t ->
('a ->
'query ->
'input ->
'output option Tezos_base.TzPervasives.tzresult Lwt.t) ->
t
val opt_register2 :
t ->
([< Resto.meth ], unit, (unit * 'a) * 'b, 'query, 'input, 'output)
Tezos_rpc.Service.t ->
('a ->
'b ->
'query ->
'input ->
'output option Tezos_base.TzPervasives.tzresult Lwt.t) ->
t
val lwt_register0 :
t ->
([< Resto.meth ], unit, unit, 'query, 'input, 'output) Tezos_rpc.Service.t ->
('query -> 'input -> 'output Lwt.t) ->
t
val lwt_register1 :
t ->
([< Resto.meth ], unit, unit * 'a, 'query, 'input, 'output)
Tezos_rpc.Service.t ->
('a -> 'query -> 'input -> 'output Lwt.t) ->
t
val lwt_register2 :
t ->
([< Resto.meth ], unit, (unit * 'a) * 'b, 'query, 'input, 'output)
Tezos_rpc.Service.t ->
('a -> 'b -> 'query -> 'input -> 'output Lwt.t) ->
t
val streamed_register0 :
t ->
([< Resto.meth ], unit, unit, 'query, 'input, 'output) Tezos_rpc.Service.t ->
('query -> 'input -> ('output Lwt_stream.t * (unit -> unit)) Lwt.t) ->
t
val streamed_register1 :
t ->
([< Resto.meth ], unit, unit * 'a, 'query, 'input, 'output)
Tezos_rpc.Service.t ->
('a -> 'query -> 'input -> ('output Lwt_stream.t * (unit -> unit)) Lwt.t) ->
t
val streamed_register2 :
t ->
([< Resto.meth ], unit, (unit * 'a) * 'b, 'query, 'input, 'output)
Tezos_rpc.Service.t ->
('a ->
'b ->
'query ->
'input ->
('output Lwt_stream.t * (unit -> unit)) Lwt.t) ->
t