Libraries for mockup mode, i.e., the implementation of
--mode mockup flags.
There are 3 libraries in this directory (see
This library defines a mockup implementation of RPCs that are handled locally
in mockup mode while they are executed on a node by vanilla clients.
Mockup-specific services (e.g., baking RPCs) are implemented in
The mockup RPC layer is itself in
Higher-level mockup interaction is located in
persistence.ml, in particular to
handle mockup states (creation, modification, etc.).
Tezos mockup registration
This library defines the interface that is expected to be implemented by
the protocol. This then allows to register a protocol and support it in
mockup mode. See for example
mockup_args.ml handles mockup (dummy) chain ids.
Tezos mockup commands
Mockup commands that are independent from the protocol (one of
list mockup protocols) are implemented here. Currently, there is only one such command
list mockup protocols indeed). All other mockup client commands are the same as for
vanilla clients, except for the additional
--mode mockup switch.
Protocol-specific mockup commands are implemented in the respective
src/proto_*/lib_client_commands/client_proto_mockup_commands.ml. For example,
alpha, this is done in
create mockup is an example of such a command.
All mockup commands are used in
src/lib_client_base_unix/client_config.ml. More precisely, there is a
dedicated mockup context object in
src/lib_client_base_unix/client_context_unix.ml, delegating its RPC calls to
the local mockup implementation
Tests for mockup mode use both the
pytest and the
tezt testing frameworks.
For the former kind of tests, run at toplevel:
(cd tests_python && poetry run pytest tests_alpha/test_mockup.py)
tests_008 if needed.
Run at toplevel
dune exec tezt/tests/main.exe -- mockup