1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
use crate::{CKBAppConfig, MemoryTrackerConfig, MinerConfig};
use ckb_chain_spec::consensus::Consensus;
use ckb_jsonrpc_types::ScriptHashType;
use ckb_pow::PowEngine;
use std::path::PathBuf;
use std::sync::Arc;

pub struct ExportArgs {
    pub config: Box<CKBAppConfig>,
    pub consensus: Consensus,
    pub target: PathBuf,
}

pub struct ImportArgs {
    pub config: Box<CKBAppConfig>,
    pub consensus: Consensus,
    pub source: PathBuf,
}

pub struct RunArgs {
    pub config: Box<CKBAppConfig>,
    pub consensus: Consensus,
    pub block_assembler_advanced: bool,
}

pub type ProfileArgs = Option<(Option<u64>, Option<u64>)>;
pub struct ReplayArgs {
    pub config: Box<CKBAppConfig>,
    pub consensus: Consensus,
    pub tmp_target: PathBuf,
    pub profile: ProfileArgs,
    pub sanity_check: bool,
    pub full_verfication: bool,
}

pub struct MinerArgs {
    pub config: MinerConfig,
    pub pow_engine: Arc<dyn PowEngine>,
    pub memory_tracker: MemoryTrackerConfig,
    pub limit: u128,
}

pub struct StatsArgs {
    pub config: Box<CKBAppConfig>,
    pub consensus: Consensus,
    pub from: Option<u64>,
    pub to: Option<u64>,
}

pub struct InitArgs {
    pub interactive: bool,
    pub root_dir: PathBuf,
    pub chain: String,
    pub rpc_port: String,
    pub p2p_port: String,
    pub log_to_file: bool,
    pub log_to_stdout: bool,
    pub list_chains: bool,
    pub force: bool,
    pub block_assembler_code_hash: Option<String>,
    pub block_assembler_args: Vec<String>,
    pub block_assembler_hash_type: ScriptHashType,
    pub block_assembler_message: Option<String>,
    pub import_spec: Option<String>,
}

pub struct ResetDataArgs {
    pub force: bool,
    pub all: bool,
    pub database: bool,
    pub indexer: bool,
    pub network: bool,
    pub network_peer_store: bool,
    pub network_secret_key: bool,
    pub logs: bool,
    pub data_dir: PathBuf,
    pub db_path: PathBuf,
    pub indexer_db_path: PathBuf,
    pub network_dir: PathBuf,
    pub network_peer_store_path: PathBuf,
    pub network_secret_key_path: PathBuf,
    pub logs_dir: Option<PathBuf>,
}

pub struct PeerIDArgs {
    pub peer_id: secio::PeerId,
}