6
6
#include " storage/car/car.hpp"
7
7
#include " storage/ipld/memory_indexed_car.hpp"
8
8
#include " storage/unixfs/unixfs.hpp"
9
- #include " storage/ipld/memory_indexed_car.hpp"
10
9
11
10
namespace fc ::cli::_node {
12
11
using api::FileRef;
13
12
using api::ImportRes;
14
13
using api::RetrievalOrder;
15
- using primitives::address::Address;
16
- using proofs::padPiece;
17
14
using ::fc::storage::car::makeCar;
18
15
using ::fc::storage::unixfs::wrapFile;
19
-
16
+ using primitives::address::Address;
17
+ using proofs::padPiece;
20
18
21
19
struct clientRetrieve {
22
20
struct Args {
@@ -56,7 +54,10 @@ namespace fc::cli::_node {
56
54
RetrievalOrder order{};
57
55
auto data_cid{cliArgv<CID>(argv, 0 , " dataCid" )};
58
56
auto path{cliArgv<boost::filesystem::path>(argv, 1 , " path" )};
59
- order.client = (args.from ? *args.from : cliTry (api._ ->WalletDefaultAddress (), " Getting address of default wallet..." ));
57
+ order.client =
58
+ (args.from ? *args.from
59
+ : cliTry (api._ ->WalletDefaultAddress (),
60
+ " Getting address of default wallet..." ));
60
61
order.miner = (args.provider ? *args.provider : Address{});
61
62
if (args.max_price ) {
62
63
fmt::print (" max price is {}fil ({}attofil)\n " ,
@@ -74,25 +75,27 @@ namespace fc::cli::_node {
74
75
75
76
struct clientImportData {
76
77
struct Args {
77
- CLI_BOOL (" car" , " import from a car file instead of a regular file" )car;
78
+ CLI_BOOL (" car" , " import from a car file instead of a regular file" ) car;
78
79
79
80
CLI_OPTS () {
80
- Opts opts;
81
- car (opts);
82
- return opts;
81
+ Opts opts;
82
+ car (opts);
83
+ return opts;
83
84
}
84
85
};
85
86
86
87
CLI_RUN () {
87
88
Node::Api api{argm};
88
89
auto path{cliArgv<std::string>(argv, 0 , " path to file to import" )};
89
90
FileRef file_ref{path, args.car };
90
- auto result = cliTry (api._ ->ClientImport (file_ref), " Processing data import" );
91
+ auto result =
92
+ cliTry (api._ ->ClientImport (file_ref), " Processing data import" );
91
93
fmt::print (" File Root CID: " + result.root .toString ().value ());
92
94
fmt::print (" Data Import Success" );
93
95
}
94
96
};
95
97
98
+ <<<<<<< HEAD
96
99
97
100
<<<<<<< HEAD
98
101
struct clientGenerateCar {
@@ -107,13 +110,18 @@ namespace fc::cli::_node {
107
110
}
108
111
=======
109
112
struct Node_client_generateCar : Empty{
113
+ =======
114
+ struct Node_client_generateCar : Empty {
115
+ >>>>>>> f1466404 (client updates)
110
116
CLI_RUN() {
111
117
auto path_to{cliArgv<boost::filesystem::path>(argv, 0 , " input-path" )};
112
118
auto path_out{cliArgv<boost::filesystem::path>(argv, 1 , " output-path" )};
113
119
>>>>>>> 172a64dc (client methods cli updates)
114
120
115
121
auto tmp_path = path_to.string () + " .unixfs-tmp.car" ;
116
- auto ipld = cliTry (MemoryIndexedCar::make (tmp_path, true ), " Creting IPLD instance of {}" , tmp_path);
122
+ auto ipld = cliTry (MemoryIndexedCar::make (tmp_path, true ),
123
+ " Creting IPLD instance of {}" ,
124
+ tmp_path);
117
125
std::ifstream file{path_to.string ()};
118
126
auto root = cliTry (wrapFile (*ipld, file));
119
127
cliTry (::fc::storage::car::makeSelectiveCar (
@@ -123,34 +131,50 @@ namespace fc::cli::_node {
123
131
}
124
132
};
125
133
134
+ <<<<<<< HEAD
126
135
struct clientLocal : Empty{
127
136
CLI_RUN (){
128
137
Node::Api api {argm};
129
138
CLI_TRY_TEXT (result, api._ ->ClientListImports (), " Fail of getting imports list" );
130
139
for (auto it = result.begin (); it != result.end (); it++){
140
+ =======
141
+ struct Node_client_local : Empty {
142
+ CLI_RUN () {
143
+ Node::Api api{argm};
144
+ auto result = cliTry (api._ ->ClientListImports (), " Getting imports list" );
145
+ for (auto it = result.begin (); it != result.end (); it++) {
146
+ >>>>>>> f1466404 (client updates)
131
147
fmt::print (" Root CID: {} \n " , it->root .toString ().value ());
132
148
fmt::print (" Source: {}\n " , it->source );
133
149
fmt::print (" Path: {}\n " , it->path );
134
150
}
135
151
}
136
152
};
137
153
154
+ <<<<<<< HEAD
138
155
<<<<<<< HEAD
139
156
struct clientFind {
140
157
struct Args {
141
158
=======
142
159
struct Node_client_find {
160
+ =======
161
+ struct Node_client_find {};
162
+ >>>>>>> f1466404 (client updates)
143
163
144
- };
145
-
146
- struct Node_client_listRetrieval {
164
+ struct Node_client_listRetrieval {
147
165
struct Args {
166
+ <<<<<<< HEAD
148
167
CLI_BOOL (" verbose" , " print verbose deal details" )verbose;
149
168
CLI_BOOL (" show-failed" , " show failed/failing deals" )failed_show;
150
169
CLI_BOOL (" completed" , " show completed retrievals" )completed_show;
151
170
>>>>>>> 172a64dc (client methods cli updates)
171
+ =======
172
+ CLI_BOOL (" verbose" , " print verbose deal details" ) verbose;
173
+ CLI_BOOL (" show-failed" , " show failed/failing deals" ) failed_show;
174
+ CLI_BOOL (" completed" , " show completed retrievals" ) completed_show;
175
+ >>>>>>> f1466404 (client updates)
152
176
153
- CLI_OPTS (){
177
+ CLI_OPTS() {
154
178
Opts opts;
155
179
verbose (opts);
156
180
failed_show (opts);
@@ -159,24 +183,24 @@ namespace fc::cli::_node {
159
183
}
160
184
};
161
185
162
- CLI_RUN (){
186
+ CLI_RUN () {
163
187
Node::Api api{argm};
164
188
bool failed_show = !args.failed_show ;
165
- // TODO: continue;
189
+ // TODO: continue;
166
190
// chan = ()
167
191
// if(flag){
168
192
// chan->read([](){
169
193
// print(api->stateRetrivalsDeals)
170
194
//
171
195
// })
172
- while (true ){
173
- sleep (10000000000 );
174
- }
196
+ while (true ) {
197
+ sleep (10000000000 );
198
+ }
175
199
//
176
200
}
177
-
178
201
};
179
202
203
+ <<<<<<< HEAD
180
204
181
205
182
206
<<<<<<< HEAD
@@ -185,6 +209,9 @@ namespace fc::cli::_node {
185
209
186
210
=======
187
211
struct Node_client_inspectDeal {
212
+ =======
213
+ struct Node_client_inspectDeal {
214
+ >>>>>>> f1466404 (client updates)
188
215
struct Args {
189
216
CLI_OPTIONAL (" proposal-cid" , " proposal cid of deal to be inspected" , CID)
190
217
proposal_cid;
@@ -196,79 +223,117 @@ namespace fc::cli::_node {
196
223
return opts;
197
224
}
198
225
};
199
- CLI_RUN (){
226
+ CLI_RUN () {
200
227
Node::Api api{argm};
201
-
202
-
203
-
204
228
}
205
-
206
229
};
207
- struct Node_client_list_deals {
230
+ struct Node_client_list_deals {
208
231
struct Args {
209
232
CLI_BOOL (" show-failed" , " show failed/failing deals" ) failed_show;
210
- CLI_OPTS (){
233
+ CLI_OPTS () {
211
234
Opts opts;
212
235
failed_show (opts);
213
236
return opts;
214
237
}
215
238
};
216
239
217
- CLI_RUN (){
240
+ CLI_RUN () {
218
241
Node::Api api{argm};
219
242
fmt::print (" Not supported yet\n " );
220
- auto local_deals = cliTry (api._ ->ClientListDeals (), " Getting local client deals..." );
243
+ auto local_deals =
244
+ cliTry (api._ ->ClientListDeals (), " Getting local client deals..." );
221
245
// TODO(Markuus): make output;
222
246
}
223
247
};
224
248
225
- struct Node_client_balances {
226
- struct Args {
227
- CLI_OPTIONAL (" client" , " specifies market client" , Address)client;
228
- CLI_OPTS (){
229
- Opts opts;
249
+ struct Node_client_balances {
250
+ struct Args {
251
+ CLI_OPTIONAL (" client" , " specifies market client" , Address) client;
252
+ CLI_OPTS () {
253
+ Opts opts;
230
254
client (opts);
231
255
return opts;
232
256
}
233
257
};
234
258
235
- CLI_RUN (){
259
+ CLI_RUN () {
236
260
Node::Api api{argm};
237
- Address addr = (args.client ? *args.client : cliTry (api._ ->WalletDefaultAddress (), " Getting address of default wallet..." ));
261
+ Address addr =
262
+ (args.client ? *args.client
263
+ : cliTry (api._ ->WalletDefaultAddress (),
264
+ " Getting address of default wallet..." ));
238
265
auto balance = cliTry (api._ ->StateMarketBalance (addr, TipsetKey ()));
239
266
240
-
241
267
fmt::print (" Escrowed Funds: {}\n " , AttoFil{balance.escrow });
242
268
fmt::print (" Locked Funds: {}\n " , AttoFil{balance.locked });
243
- // TODO: Reserved and Avaliable
269
+ // TODO: Reserved and Avaliable
244
270
}
245
271
};
246
272
<<<<<<< HEAD
247
273
>>>>>>> 172a64dc (client methods cli updates)
248
274
=======
249
275
250
-
251
- struct Node_client_getDeal : Empty{
252
- CLI_RUN (){
276
+ struct Node_client_getDeal : Empty {
277
+ CLI_RUN () {
253
278
Node::Api api{argm};
254
279
auto proposal_cid{cliArgv<CID>(argv, 0 , " proposal cid of deal to get" )};
255
280
// TODO: Client getDealInfo
256
281
}
257
282
};
258
283
259
- struct Node_client_stat : Empty{
284
+ struct Node_client_stat : Empty {
260
285
CLI_RUN () {
261
286
Node::Api api{argm};
262
287
auto cid{cliArgv<CID>(argv, 0 , " cid of localy stored file" )};
263
- // auto deal_size = cliTry(api._->);
264
- // TODO: CLientDealSize;
288
+ // auto deal_size = cliTry(api._->);
289
+ // TODO: CLientDealSize;
265
290
}
266
-
267
291
};
268
292
293
+ struct Node_client_listTransfers {
294
+ struct Args {
295
+ CLI_BOOL (" completed" , " show completed data transfers" ) completed;
296
+ CLI_BOOL (" watch" ,
297
+ " watch deal updates in real-time, rather than a one time list" )
298
+ watch;
299
+ CLI_BOOL (" show-failed" , " show failed/cancelled transfers" ) failed_show;
269
300
301
+ CLI_OPTS () {
302
+ Opts opts;
303
+ completed (opts);
304
+ watch (opts);
305
+ failed_show (opts);
306
+ return opts;
307
+ }
308
+ };
270
309
310
+ <<<<<<< HEAD
271
311
>>>>>>> 490821f3 (client updates)
312
+ =======
313
+ CLI_RUN () {
314
+ fmt::print (" Not supported yet" );
315
+ // TODO: ClientListDataTransfers
316
+ }
317
+ };
318
+ >>>>>>> f1466404 (client updates)
319
+
320
+ struct Node_client_grantDatacap {
321
+ struct Args {
322
+ CLI_OPTIONAL (" from" ,
323
+ " specifies the adrress of notary to send message from" ,
324
+ Address)
325
+ from;
326
+ CLI_OPTS () {
327
+ Opts opts;
328
+ from (opts);
329
+ return opts;
330
+ }
331
+ };
272
332
333
+ CLI_RUN () {
334
+ auto target{cliArgv<Address>(argv, 0 , " target address" )};
335
+ auto allowness{cliArgv<AttoFil>(argv, 1 , " amount" )};
336
+ }
337
+ };
273
338
274
339
} // namespace fc::cli::_node
0 commit comments