23 CLI::App app{
"aztec-wsdb: Standalone world state database server" };
24 app.require_subcommand(1);
29 CLI::App* msgpack_command = app.add_subcommand(
"msgpack",
"Msgpack API interface.");
32 CLI::App* msgpack_run_command =
33 msgpack_command->add_subcommand(
"run",
"Start the world state database IPC server.");
35 std::string input_path;
36 msgpack_run_command->add_option(
37 "-i,--input", input_path,
"IPC socket/shm path (.sock for UDS, .shm for shared memory)");
40 msgpack_run_command->add_option(
"-d,--data-dir", data_dir,
"Data directory for LMDB stores")->required();
43 std::string tree_heights_json;
44 msgpack_run_command->add_option(
"--tree-heights", tree_heights_json,
"Tree heights as JSON: {0:40,1:32,...}");
47 std::string tree_prefill_json;
48 msgpack_run_command->add_option(
49 "--tree-prefill", tree_prefill_json,
"Tree prefill sizes as JSON: {0:128,2:128,...}");
52 std::string map_sizes_json;
53 msgpack_run_command->add_option(
"--map-sizes", map_sizes_json,
"LMDB map sizes in KB as JSON: {0:1024,...}");
55 uint32_t threads = 16;
56 msgpack_run_command->add_option(
"-t,--threads", threads,
"Thread pool size (default: 16)")
57 ->check(CLI::PositiveNumber);
59 uint32_t initial_header_generator_point = 0;
60 msgpack_run_command->add_option(
61 "--initial-header-generator-point", initial_header_generator_point,
"Header generator point (default: 0)");
64 std::string prefilled_public_data_json;
65 msgpack_run_command->add_option(
66 "--prefilled-public-data", prefilled_public_data_json,
"Prefilled public data as JSON array");
68 uint64_t genesis_timestamp = 0;
69 msgpack_run_command->add_option(
"--genesis-timestamp", genesis_timestamp,
"Genesis block timestamp (default: 0)");
71 size_t request_ring_size = 1024 * 1024;
74 "--request-ring-size", request_ring_size,
"Request ring buffer size for shared memory IPC (default: 1MB)")
75 ->check(CLI::PositiveNumber);
77 size_t response_ring_size = 1024 * 1024;
79 ->add_option(
"--response-ring-size",
81 "Response ring buffer size for shared memory IPC (default: 1MB)")
82 ->check(CLI::PositiveNumber);
86 app.parse(argc, argv);
87 }
catch (
const CLI::ParseError& e) {
92 if (msgpack_run_command->parsed()) {
99 initial_header_generator_point,
100 prefilled_public_data_json,
105 }
catch (
const std::exception& e) {
106 std::cerr <<
"Error: " << e.what() <<
'\n';