Skip to content

Commit 84e8bbc

Browse files
ElestriasMarkuu-s
authored andcommitted
retrieve core
Signed-off-by: elestrias <[email protected]>
1 parent e0b4ca0 commit 84e8bbc

File tree

2 files changed

+59
-0
lines changed

2 files changed

+59
-0
lines changed

core/cli/node/_tree.hpp

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/**
2+
* Copyright Soramitsu Co., Ltd. All Rights Reserved.
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
#pragma once
7+
8+
#include "cli/node/net.hpp"
9+
#include "cli/tree.hpp"
10+
#include "cli/node/client.hpp"
11+
12+
namespace fc::cli::_node {
13+
const auto _tree{tree<Node>({
14+
{"net",
15+
tree<Group>({
16+
{"listen", tree<Node_net_listen>()},
17+
})},
18+
{"client",
19+
tree<Group>({
20+
{"retrieve", tree<clientRetrive>()},
21+
})},
22+
})};
23+
} // namespace fc::cli::_node

core/cli/node/client.hpp

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
//
2+
// Created by Ruslan Gilvanov on 12.02.2022.
3+
4+
#pragma once
5+
#include "cli/node/node.hpp"
6+
7+
namespace fc::cli::_node{
8+
9+
10+
struct clientRetrive{
11+
struct Args{
12+
bool car{};
13+
bool export_merkle_root{};
14+
std::string data_selector;
15+
16+
CLI_OPTS(){
17+
Opts opts;
18+
auto option{opts.add_options()};
19+
option("car", po::bool_switch(&car), "Export to a car file instead of a regular file");
20+
option("data-selector", po::value(&data_selector), "IPLD datamodel text-path selector, or IPLD json selector");
21+
option("car-export-merkle-proof", po::bool_switch(&export_merkle_root), "(requires --data-selector and --car) Export data-selector merkle proof");
22+
return opts;
23+
}
24+
};
25+
26+
27+
CLI_RUN(){
28+
std::cout<<args.data_selector<<"\n";
29+
}
30+
};
31+
32+
33+
34+
35+
36+
} //fc::cli::node

0 commit comments

Comments
 (0)