22std::string get_avm_schema_as_json()
31 CLI::App app{
"aztec-avm: Standalone AVM simulator server" };
32 app.require_subcommand(1);
37 CLI::App* msgpack_command = app.add_subcommand(
"msgpack",
"Msgpack API interface.");
40 CLI::App* msgpack_schema_command =
41 msgpack_command->add_subcommand(
"schema",
"Output a msgpack schema encoded as JSON to stdout.");
44 CLI::App* msgpack_run_command = msgpack_command->add_subcommand(
"run",
"Start the AVM simulator IPC server.");
46 std::string input_path;
47 msgpack_run_command->add_option(
"-i,--input", input_path,
"IPC socket path (.sock)")->required();
49 std::string wsdb_path;
50 msgpack_run_command->add_option(
"--wsdb", wsdb_path,
"WSDB server socket path")->required();
53 msgpack_run_command->add_option(
"--cdb", cdb_path,
"CDB server socket path")->required();
57 app.parse(argc, argv);
58 }
catch (
const CLI::ParseError& e) {
63 if (msgpack_schema_command->parsed()) {
68 if (msgpack_run_command->parsed()) {
71 }
catch (
const std::exception& e) {
72 std::cerr <<
"Error: " << e.what() <<
'\n';
AvmCommandResponse responses
AvmCommand NamedUnion, AvmRequest context, and dispatch function.
#define SERIALIZATION_FIELDS(...)
NamedUnion< AvmErrorResponse, AvmSimulate::Response, AvmSimulateWithHints::Response, AvmShutdown::Response > AvmCommandResponse
Union of all AVM response types.
int execute_avm_server(const std::string &input_path, const std::string &wsdb_path, const std::string &cdb_path)
Start the aztec-avm IPC server.
int parse_and_run_avm(int argc, char *argv[])
NamedUnion< AvmSimulate, AvmSimulateWithHints, AvmShutdown > AvmCommand
Union of all AVM commands (request types).
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
std::string msgpack_schema_to_string(const auto &obj)
Print's an object's derived msgpack schema as a string.