iota_graphql_rpc/
commands.rs

1// Copyright (c) Mysten Labs, Inc.
2// Modifications Copyright (c) 2024 IOTA Stiftung
3// SPDX-License-Identifier: Apache-2.0
4
5use std::path::PathBuf;
6
7use clap::*;
8
9use crate::config::{ConnectionConfig, Ide, TxExecFullNodeConfig};
10
11#[derive(Parser)]
12#[command(name = "iota-graphql-rpc", about = "IOTA GraphQL RPC", author)]
13pub enum Command {
14    /// Output a TOML config (suitable for passing into the --config parameter
15    /// of the start-server command) with all values set to their defaults.
16    GenerateConfig {
17        /// Optional path to an output file. Prints to `stdout` if not provided.
18        output: Option<PathBuf>,
19    },
20    GenerateSchema {
21        /// Path to output GraphQL schema to, in SDL format.
22        #[arg(short, long)]
23        file: Option<PathBuf>,
24    },
25    StartServer {
26        #[command(flatten)]
27        ide: Ide,
28
29        #[command(flatten)]
30        connection: ConnectionConfig,
31
32        /// Path to TOML file containing configuration for service.
33        #[arg(short, long)]
34        config: Option<PathBuf>,
35
36        #[command(flatten)]
37        tx_exec_full_node: TxExecFullNodeConfig,
38    },
39}