File tree Expand file tree Collapse file tree 5 files changed +19
-0
lines changed Expand file tree Collapse file tree 5 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,10 @@ pub fn reset_data(args: ResetDataArgs) -> Result<(), ExitCode> {
16
16
target_dirs. push ( args. db_path ) ;
17
17
}
18
18
19
+ if args. indexer {
20
+ target_dirs. push ( args. indexer_path ) ;
21
+ }
22
+
19
23
if args. network {
20
24
target_dirs. push ( args. network_dir ) ;
21
25
}
Original file line number Diff line number Diff line change @@ -196,6 +196,7 @@ block_uncles_cache_size = 30
196
196
# # Or you may want use more flexible scripts, block template as arg.
197
197
# notify_scripts = ["{cmd} {blocktemplate}"]
198
198
#
199
+ # # CKB built-in indexer settings. Existing indexes can be cleaned up using the `ckb reset-data` subcommand.
199
200
# [indexer_v2]
200
201
# # Indexing the pending txs in the ckb tx-pool
201
202
# index_tx_pool = false
Original file line number Diff line number Diff line change @@ -146,6 +146,8 @@ pub struct ResetDataArgs {
146
146
pub all : bool ,
147
147
/// Reset database.
148
148
pub database : bool ,
149
+ /// Reset indexer.
150
+ pub indexer : bool ,
149
151
/// Reset all network data, including the secret key and peer store.
150
152
pub network : bool ,
151
153
/// Reset network peer store.
@@ -158,6 +160,8 @@ pub struct ResetDataArgs {
158
160
pub data_dir : PathBuf ,
159
161
/// The path to the database directory.
160
162
pub db_path : PathBuf ,
163
+ /// The path to the indexer directory.
164
+ pub indexer_path : PathBuf ,
161
165
/// The path to the network data directory.
162
166
pub network_dir : PathBuf ,
163
167
/// The path to the network peer store directory.
Original file line number Diff line number Diff line change @@ -242,6 +242,12 @@ fn reset_data() -> Command {
242
242
. action ( clap:: ArgAction :: SetTrue )
243
243
. help ( "Delete only `data/db`" ) ,
244
244
)
245
+ . arg (
246
+ Arg :: new ( ARG_INDEXER )
247
+ . long ( ARG_INDEXER )
248
+ . action ( clap:: ArgAction :: SetTrue )
249
+ . help ( "Delete only `data/indexer/store`" ) ,
250
+ )
245
251
. arg (
246
252
Arg :: new ( ARG_NETWORK )
247
253
. long ( ARG_NETWORK )
Original file line number Diff line number Diff line change @@ -306,6 +306,7 @@ impl Setup {
306
306
let config = self . config . into_ckb ( ) ?;
307
307
let data_dir = config. data_dir ;
308
308
let db_path = config. db . path ;
309
+ let indexer_path = config. indexer . store ;
309
310
let network_config = config. network ;
310
311
let network_dir = network_config. path . clone ( ) ;
311
312
let network_peer_store_path = network_config. peer_store_path ( ) ;
@@ -315,6 +316,7 @@ impl Setup {
315
316
let force = matches. get_flag ( cli:: ARG_FORCE ) ;
316
317
let all = matches. get_flag ( cli:: ARG_ALL ) ;
317
318
let database = matches. get_flag ( cli:: ARG_DATABASE ) ;
319
+ let indexer = matches. get_flag ( cli:: ARG_INDEXER ) ;
318
320
let network = matches. get_flag ( cli:: ARG_NETWORK ) ;
319
321
let network_peer_store = matches. get_flag ( cli:: ARG_NETWORK_PEER_STORE ) ;
320
322
let network_secret_key = matches. get_flag ( cli:: ARG_NETWORK_SECRET_KEY ) ;
@@ -324,12 +326,14 @@ impl Setup {
324
326
force,
325
327
all,
326
328
database,
329
+ indexer,
327
330
network,
328
331
network_peer_store,
329
332
network_secret_key,
330
333
logs,
331
334
data_dir,
332
335
db_path,
336
+ indexer_path,
333
337
network_dir,
334
338
network_peer_store_path,
335
339
network_secret_key_path,
You can’t perform that action at this time.
0 commit comments