7
7
#include " storage/car/car.hpp"
8
8
#include " storage/ipld/memory_indexed_car.hpp"
9
9
#include " storage/unixfs/unixfs.hpp"
10
- #include " storage/ipld/memory_indexed_car.hpp"
11
10
12
11
namespace fc ::cli::_node {
13
12
using api::FileRef;
14
13
using api::ImportRes;
15
14
using api::RetrievalOrder;
16
- using primitives::address::Address;
17
- using proofs::padPiece;
18
15
using ::fc::storage::car::makeCar;
19
16
using ::fc::storage::unixfs::wrapFile;
20
-
17
+ using primitives::address::Address;
18
+ using proofs::padPiece;
21
19
22
20
struct clientRetrieve {
23
21
struct Args {
@@ -57,7 +55,10 @@ namespace fc::cli::_node {
57
55
RetrievalOrder order{};
58
56
auto data_cid{cliArgv<CID>(argv, 0 , " dataCid" )};
59
57
auto path{cliArgv<boost::filesystem::path>(argv, 1 , " path" )};
60
- order.client = (args.from ? *args.from : cliTry (api._ ->WalletDefaultAddress (), " Getting address of default wallet..." ));
58
+ order.client =
59
+ (args.from ? *args.from
60
+ : cliTry (api._ ->WalletDefaultAddress (),
61
+ " Getting address of default wallet..." ));
61
62
order.miner = (args.provider ? *args.provider : Address{});
62
63
if (args.max_price ) {
63
64
fmt::print (" max price is {}fil ({}attofil)\n " ,
@@ -75,25 +76,27 @@ namespace fc::cli::_node {
75
76
76
77
struct clientImportData {
77
78
struct Args {
78
- CLI_BOOL (" car" , " import from a car file instead of a regular file" )car;
79
+ CLI_BOOL (" car" , " import from a car file instead of a regular file" ) car;
79
80
80
81
CLI_OPTS () {
81
- Opts opts;
82
- car (opts);
83
- return opts;
82
+ Opts opts;
83
+ car (opts);
84
+ return opts;
84
85
}
85
86
};
86
87
87
88
CLI_RUN () {
88
89
Node::Api api{argm};
89
90
auto path{cliArgv<std::string>(argv, 0 , " path to file to import" )};
90
91
FileRef file_ref{path, args.car };
91
- auto result = cliTry (api._ ->ClientImport (file_ref), " Processing data import" );
92
+ auto result =
93
+ cliTry (api._ ->ClientImport (file_ref), " Processing data import" );
92
94
fmt::print (" File Root CID: " + result.root .toString ().value ());
93
95
fmt::print (" Data Import Success" );
94
96
}
95
97
};
96
98
99
+ <<<<<<< HEAD
97
100
98
101
<<<<<<< HEAD
99
102
struct clientGenerateCar {
@@ -108,13 +111,18 @@ namespace fc::cli::_node {
108
111
}
109
112
=======
110
113
struct Node_client_generateCar : Empty{
114
+ =======
115
+ struct Node_client_generateCar : Empty {
116
+ >>>>>>> f1466404 (client updates)
111
117
CLI_RUN() {
112
118
auto path_to{cliArgv<boost::filesystem::path>(argv, 0 , " input-path" )};
113
119
auto path_out{cliArgv<boost::filesystem::path>(argv, 1 , " output-path" )};
114
120
>>>>>>> 172a64dc (client methods cli updates)
115
121
116
122
auto tmp_path = path_to.string () + " .unixfs-tmp.car" ;
117
- auto ipld = cliTry (MemoryIndexedCar::make (tmp_path, true ), " Creting IPLD instance of {}" , tmp_path);
123
+ auto ipld = cliTry (MemoryIndexedCar::make (tmp_path, true ),
124
+ " Creting IPLD instance of {}" ,
125
+ tmp_path);
118
126
std::ifstream file{path_to.string ()};
119
127
auto root = cliTry (wrapFile (*ipld, file));
120
128
cliTry (::fc::storage::car::makeSelectiveCar (
@@ -124,34 +132,50 @@ namespace fc::cli::_node {
124
132
}
125
133
};
126
134
135
+ <<<<<<< HEAD
127
136
struct clientLocal : Empty{
128
137
CLI_RUN (){
129
138
Node::Api api {argm};
130
139
CLI_TRY_TEXT (result, api._ ->ClientListImports (), " Fail of getting imports list" );
131
140
for (auto it = result.begin (); it != result.end (); it++){
141
+ =======
142
+ struct Node_client_local : Empty {
143
+ CLI_RUN () {
144
+ Node::Api api{argm};
145
+ auto result = cliTry (api._ ->ClientListImports (), " Getting imports list" );
146
+ for (auto it = result.begin (); it != result.end (); it++) {
147
+ >>>>>>> f1466404 (client updates)
132
148
fmt::print (" Root CID: {} \n " , it->root .toString ().value ());
133
149
fmt::print (" Source: {}\n " , it->source );
134
150
fmt::print (" Path: {}\n " , it->path );
135
151
}
136
152
}
137
153
};
138
154
155
+ <<<<<<< HEAD
139
156
<<<<<<< HEAD
140
157
struct clientFind {
141
158
struct Args {
142
159
=======
143
160
struct Node_client_find {
161
+ =======
162
+ struct Node_client_find {};
163
+ >>>>>>> f1466404 (client updates)
144
164
145
- };
146
-
147
- struct Node_client_listRetrieval {
165
+ struct Node_client_listRetrieval {
148
166
struct Args {
167
+ <<<<<<< HEAD
149
168
CLI_BOOL (" verbose" , " print verbose deal details" )verbose;
150
169
CLI_BOOL (" show-failed" , " show failed/failing deals" )failed_show;
151
170
CLI_BOOL (" completed" , " show completed retrievals" )completed_show;
152
171
>>>>>>> 172a64dc (client methods cli updates)
172
+ =======
173
+ CLI_BOOL (" verbose" , " print verbose deal details" ) verbose;
174
+ CLI_BOOL (" show-failed" , " show failed/failing deals" ) failed_show;
175
+ CLI_BOOL (" completed" , " show completed retrievals" ) completed_show;
176
+ >>>>>>> f1466404 (client updates)
153
177
154
- CLI_OPTS (){
178
+ CLI_OPTS() {
155
179
Opts opts;
156
180
verbose (opts);
157
181
failed_show (opts);
@@ -160,24 +184,24 @@ namespace fc::cli::_node {
160
184
}
161
185
};
162
186
163
- CLI_RUN (){
187
+ CLI_RUN () {
164
188
Node::Api api{argm};
165
189
bool failed_show = !args.failed_show ;
166
- // TODO: continue;
190
+ // TODO: continue;
167
191
// chan = ()
168
192
// if(flag){
169
193
// chan->read([](){
170
194
// print(api->stateRetrivalsDeals)
171
195
//
172
196
// })
173
- while (true ){
174
- sleep (10000000000 );
175
- }
197
+ while (true ) {
198
+ sleep (10000000000 );
199
+ }
176
200
//
177
201
}
178
-
179
202
};
180
203
204
+ <<<<<<< HEAD
181
205
182
206
183
207
<<<<<<< HEAD
@@ -269,6 +293,9 @@ namespace fc::cli::_node {
269
293
>>>>>>> b414cb63 (example client)
270
294
=======
271
295
struct Node_client_inspectDeal{
296
+ =======
297
+ struct Node_client_inspectDeal {
298
+ >>>>>>> f1466404 (client updates)
272
299
struct Args {
273
300
CLI_OPTIONAL (" proposal-cid" , " proposal cid of deal to be inspected" , CID)
274
301
proposal_cid;
@@ -280,79 +307,120 @@ namespace fc::cli::_node {
280
307
return opts;
281
308
}
282
309
};
283
- CLI_RUN (){
310
+ CLI_RUN () {
284
311
Node::Api api{argm};
285
-
286
-
287
-
288
312
}
289
-
290
313
};
291
- struct Node_client_list_deals {
314
+ struct Node_client_list_deals {
292
315
struct Args {
293
316
CLI_BOOL (" show-failed" , " show failed/failing deals" ) failed_show;
294
- CLI_OPTS (){
317
+ CLI_OPTS () {
295
318
Opts opts;
296
319
failed_show (opts);
297
320
return opts;
298
321
}
299
322
};
300
323
301
- CLI_RUN (){
324
+ CLI_RUN () {
302
325
Node::Api api{argm};
303
326
fmt::print (" Not supported yet\n " );
304
- auto local_deals = cliTry (api._ ->ClientListDeals (), " Getting local client deals..." );
327
+ auto local_deals =
328
+ cliTry (api._ ->ClientListDeals (), " Getting local client deals..." );
305
329
// TODO(Markuus): make output;
306
330
}
307
331
};
308
332
309
- struct Node_client_balances {
310
- struct Args {
311
- CLI_OPTIONAL (" client" , " specifies market client" , Address)client;
312
- CLI_OPTS (){
313
- Opts opts;
333
+ struct Node_client_balances {
334
+ struct Args {
335
+ CLI_OPTIONAL (" client" , " specifies market client" , Address) client;
336
+ CLI_OPTS () {
337
+ Opts opts;
314
338
client (opts);
315
339
return opts;
316
340
}
317
341
};
318
342
319
- CLI_RUN (){
343
+ CLI_RUN () {
320
344
Node::Api api{argm};
321
- Address addr = (args.client ? *args.client : cliTry (api._ ->WalletDefaultAddress (), " Getting address of default wallet..." ));
345
+ Address addr =
346
+ (args.client ? *args.client
347
+ : cliTry (api._ ->WalletDefaultAddress (),
348
+ " Getting address of default wallet..." ));
322
349
auto balance = cliTry (api._ ->StateMarketBalance (addr, TipsetKey ()));
323
350
324
-
325
351
fmt::print (" Escrowed Funds: {}\n " , AttoFil{balance.escrow });
326
352
fmt::print (" Locked Funds: {}\n " , AttoFil{balance.locked });
327
- // TODO: Reserved and Avaliable
353
+ // TODO: Reserved and Avaliable
328
354
}
329
355
};
330
356
357
+ <<<<<<< HEAD
331
358
332
359
<<<<<<< HEAD
333
360
>>>>>>> 172a64dc (client methods cli updates)
334
361
=======
335
362
struct Node_client_getDeal : Empty{
336
363
CLI_RUN (){
364
+ =======
365
+ struct Node_client_getDeal : Empty {
366
+ CLI_RUN () {
367
+ >>>>>>> f1466404 (client updates)
337
368
Node::Api api{argm};
338
369
auto proposal_cid{cliArgv<CID>(argv, 0 , " proposal cid of deal to get" )};
339
370
// TODO: Client getDealInfo
340
371
}
341
372
};
342
373
343
- struct Node_client_stat : Empty{
374
+ struct Node_client_stat : Empty {
344
375
CLI_RUN () {
345
376
Node::Api api{argm};
346
377
auto cid{cliArgv<CID>(argv, 0 , " cid of localy stored file" )};
347
- // auto deal_size = cliTry(api._->);
348
- // TODO: CLientDealSize;
378
+ // auto deal_size = cliTry(api._->);
379
+ // TODO: CLientDealSize;
349
380
}
350
-
351
381
};
352
382
383
+ struct Node_client_listTransfers {
384
+ struct Args {
385
+ CLI_BOOL (" completed" , " show completed data transfers" ) completed;
386
+ CLI_BOOL (" watch" ,
387
+ " watch deal updates in real-time, rather than a one time list" )
388
+ watch;
389
+ CLI_BOOL (" show-failed" , " show failed/cancelled transfers" ) failed_show;
353
390
391
+ CLI_OPTS () {
392
+ Opts opts;
393
+ completed (opts);
394
+ watch (opts);
395
+ failed_show (opts);
396
+ return opts;
397
+ }
398
+ };
354
399
400
+ CLI_RUN () {
401
+ fmt::print (" Not supported yet" );
402
+ // TODO: ClientListDataTransfers
403
+ }
404
+ };
405
+
406
+ struct Node_client_grantDatacap {
407
+ struct Args {
408
+ CLI_OPTIONAL (" from" ,
409
+ " specifies the adrress of notary to send message from" ,
410
+ Address)
411
+ from;
412
+ CLI_OPTS () {
413
+ Opts opts;
414
+ from (opts);
415
+ return opts;
416
+ }
417
+ };
355
418
419
+ CLI_RUN () {
420
+ auto target{cliArgv<Address>(argv, 0 , " target address" )};
421
+ auto allowness{cliArgv<AttoFil>(argv, 1 , " amount" )};
422
+ }
423
+ };
356
424
357
425
>>>>>>> 490821f3 (client updates)
358
426
} // namespace fc::cli::_node
0 commit comments