|
9 | 9 | #include "cli/node/wallet.hpp"
|
10 | 10 | #include "cli/run.hpp"
|
11 | 11 |
|
12 |
| -#define CMD(NAME, TYPE) \ |
13 |
| - { NAME, tree<TYPE>() } |
14 |
| -#define CMDS(NAME, TYPE) NAME, tree<TYPE> |
15 |
| -#define GROUP(NAME) CMDS(NAME, Group) |
| 12 | +#define CMD(NAME, TYPE, DESC, ...) \ |
| 13 | + { NAME, treeDesc<TYPE>(DESC, {__VA_ARGS__})() } |
| 14 | +#define CMDS(NAME, TYPE, DESC) NAME, treeDesc<TYPE>(DESC) |
| 15 | +#define GROUP(NAME, DESC) CMDS(NAME, Group, DESC) |
16 | 16 |
|
17 | 17 | namespace fc::cli::cli_node {
|
18 | 18 | const auto _tree{tree<Node>({
|
19 |
| - {GROUP("net")({ |
20 |
| - CMD("connect", Node_net_connect), |
21 |
| - CMD("listen", Node_net_listen), |
22 |
| - CMD("peers", Node_net_peers), |
| 19 | + {GROUP("net", "Manage P2P Network")({ |
| 20 | + CMD("connect", |
| 21 | + Node_net_connect, |
| 22 | + "Connect to a peer", |
| 23 | + "peerMultiaddr|minerActorAddress"), |
| 24 | + CMD("listen", Node_net_listen, "List listen addresses"), |
| 25 | + CMD("peers", Node_net_peers, "Print peers"), |
23 | 26 | })},
|
24 |
| - {GROUP("filplus")({ |
25 |
| - CMD("grant-datacap", Node_filplus_grantDatacap), |
26 |
| - CMD("list-notaries", Node_filplus_listNotaries), |
27 |
| - CMD("list-clients", Node_filplus_listClients), |
28 |
| - CMD("add-verifier", Node_filplus_addVerifier), |
29 |
| - CMD("check-client-datacap", Node_filplus_checkClientDataCap), |
30 |
| - CMD("check-notary-datacap", Node_filplus_checkNotaryDataCap), |
| 27 | + {GROUP("filplus", |
| 28 | + "Interact with the verified registry actor used by Filplus")({ |
| 29 | + CMD("grant-datacap", |
| 30 | + Node_filplus_grantDatacap, |
| 31 | + "Give allowance to the specified verified client address", |
| 32 | + "address", |
| 33 | + "allowance"), |
| 34 | + CMD("list-notaries", Node_filplus_listNotaries, "List all notaries"), |
| 35 | + CMD("list-clients", |
| 36 | + Node_filplus_listClients, |
| 37 | + "List all verified clients"), |
| 38 | + CMD("add-verifier", Node_filplus_addVerifier, "Add verifier address"), |
| 39 | + CMD("check-client-datacap", |
| 40 | + Node_filplus_checkClientDataCap, |
| 41 | + "Check verified client remaining bytes", |
| 42 | + "client address"), |
| 43 | + CMD("check-notary-datacap", |
| 44 | + Node_filplus_checkNotaryDataCap, |
| 45 | + "Check a notary's remaining bytes", |
| 46 | + "notary address"), |
31 | 47 | })},
|
32 |
| - {GROUP("client")({ |
33 |
| - CMD("retrieve", Node_client_retrieve), |
34 |
| - CMD("import", Node_client_importData), |
35 |
| - CMD("deal", Node_client_deal), |
36 |
| - CMD("generate-car", Node_client_generateCar), |
37 |
| - CMD("local", Node_client_local), |
38 |
| - CMD("find", Node_client_find), |
39 |
| - CMD("list-retrievals", Node_client_listRetrievals), |
40 |
| - CMD("inspect-deal", Node_client_inspectDeal), |
41 |
| - CMD("deal-stats", Node_client_dealStats), |
42 |
| - CMD("list-deals", Node_client_listDeals), |
43 |
| - CMD("balances", Node_client_balances), |
44 |
| - CMD("get-deal", Node_client_getDeal), |
| 48 | + {GROUP("client", "Make deals, store data, retrieve data")({ |
| 49 | + CMD("retrieve", |
| 50 | + Node_client_retrieve, |
| 51 | + "Retrieve data from network", |
| 52 | + "data CID", |
| 53 | + "output path"), |
| 54 | + CMD("import", Node_client_import, "Import data", "input path"), |
| 55 | + CMD("deal", |
| 56 | + Node_client_deal, |
| 57 | + "Initialize storage deal with a miner", |
| 58 | + "dataCid", |
| 59 | + "miner", |
| 60 | + "price", |
| 61 | + "duration"), |
| 62 | + CMD("generate-car", |
| 63 | + Node_client_generateCar, |
| 64 | + "Generate a car file from input", |
| 65 | + "input path", |
| 66 | + "output path"), |
| 67 | + CMD("local", Node_client_local, "List locally imported data"), |
| 68 | + CMD("find", Node_client_find, "Find data in the network", "data CID"), |
| 69 | + CMD("list-retrievals", |
| 70 | + Node_client_listRetrievals, |
| 71 | + "List retrieval market deals"), |
| 72 | + CMD("inspect-deal", |
| 73 | + Node_client_inspectDeal, |
| 74 | + "Inspect detailed information about deal's lifecycle and the " |
| 75 | + "various stages it goes through"), |
| 76 | + CMD("deal-stats", |
| 77 | + Node_client_dealStats, |
| 78 | + "Print statistics about local storage deals"), |
| 79 | + CMD("list-deals", Node_client_listDeals, "List storage market deals"), |
| 80 | + CMD("balances", |
| 81 | + Node_client_balances, |
| 82 | + "Print storage market client balances"), |
| 83 | + CMD("get-deal", |
| 84 | + Node_client_getDeal, |
| 85 | + "Print detailed deal information", |
| 86 | + "proposal CID"), |
45 | 87 | })},
|
46 |
| - {GROUP("wallet")({ |
47 |
| - CMD("new", Node_wallet_new), |
48 |
| - CMD("list", Node_wallet_list), |
49 |
| - CMD("add-balance", Node_wallet_addBalance), |
50 |
| - CMD("balance", Node_wallet_balance), |
51 |
| - CMD("default", Node_wallet_default), |
52 |
| - CMD("set-default", Node_wallet_setDefault), |
53 |
| - CMD("import", Node_wallet_import), |
54 |
| - CMD("sign", Node_wallet_sign), |
55 |
| - CMD("verify", Node_wallet_verify), |
56 |
| - CMD("delete", Node_wallet_delete), |
57 |
| - {GROUP("market")({ |
58 |
| - CMD("add", Node_wallet_market_add), |
| 88 | + {GROUP("wallet", "Manage wallet")({ |
| 89 | + CMD("new", |
| 90 | + Node_wallet_new, |
| 91 | + "Generate a new key of the given type", |
| 92 | + "type(bls|secp256k1 (default: secp256k1))"), |
| 93 | + CMD("list", Node_wallet_list, "List wallet address"), |
| 94 | + CMD("add-balance", |
| 95 | + Node_wallet_addBalance, |
| 96 | + "Send funds between accounts", |
| 97 | + "target address", |
| 98 | + "amount"), |
| 99 | + CMD("balance", |
| 100 | + Node_wallet_balance, |
| 101 | + "Get account balance", |
| 102 | + "address"), |
| 103 | + CMD("default", Node_wallet_default, "Get default wallet address"), |
| 104 | + CMD("set-default", |
| 105 | + Node_wallet_setDefault, |
| 106 | + "Set default wallet address", |
| 107 | + "address"), |
| 108 | + CMD("import", Node_wallet_import, "Import keys", {"path(optional)"}), |
| 109 | + CMD("sign", |
| 110 | + Node_wallet_sign, |
| 111 | + "Sign a message", |
| 112 | + "signing address", |
| 113 | + "hex message"), |
| 114 | + CMD("verify", |
| 115 | + Node_wallet_verify, |
| 116 | + "Verify the signature of a message", |
| 117 | + "signing address", |
| 118 | + "hexMessage", |
| 119 | + "signature"), |
| 120 | + CMD("delete", |
| 121 | + Node_wallet_delete, |
| 122 | + "Soft delete an address from the wallet - hard deletion " |
| 123 | + "needed for permanent removal", |
| 124 | + "address"), |
| 125 | + {GROUP("market", "Interact with market balances")({ |
| 126 | + CMD("add", |
| 127 | + Node_wallet_market_add, |
| 128 | + "Add funds to the Storage Market Actor", |
| 129 | + "amount"), |
59 | 130 | })},
|
60 | 131 | })},
|
61 |
| - CMD("version", Node_version), |
| 132 | + CMD("version", Node_version, "Api version"), |
62 | 133 | })};
|
63 | 134 |
|
64 | 135 | } // namespace fc::cli::cli_node
|
|
0 commit comments