@@ -12,12 +12,8 @@ use std::fs::File;
12
12
use std:: io:: { BufReader , Read } ;
13
13
use std:: path:: PathBuf ;
14
14
15
- const DEFAULT_MAINNET_STACKS_TSV_ARCHIVE : & str =
16
- "https://archive.hiro.so/mainnet/stacks-blockchain-api/mainnet-stacks-blockchain-api-latest" ;
17
- const DEFAULT_TESTNET_STACKS_TSV_ARCHIVE : & str =
18
- "https://archive.hiro.so/testnet/stacks-blockchain-api/testnet-stacks-blockchain-api-latest" ;
19
15
const DEFAULT_MAINNET_ORDINALS_SQLITE_ARCHIVE : & str =
20
- "https://archive.hiro.so/mainnet/chainhooks/hord-latest .sqlite" ;
16
+ "https://archive.hiro.so/mainnet/chainhooks/hord.sqlite" ;
21
17
const DEFAULT_REDIS_URI : & str = "redis://localhost:6379/" ;
22
18
23
19
pub const DEFAULT_INGESTION_PORT : u16 = 20455 ;
@@ -56,8 +52,6 @@ pub struct PredicatesApiConfig {
56
52
57
53
#[ derive( Clone , Debug ) ]
58
54
pub enum EventSourceConfig {
59
- StacksTsvPath ( PathConfig ) ,
60
- StacksTsvUrl ( UrlConfig ) ,
61
55
OrdinalsSqlitePath ( PathConfig ) ,
62
56
OrdinalsSqliteUrl ( UrlConfig ) ,
63
57
}
@@ -154,11 +148,11 @@ impl Config {
154
148
if let Some ( dst) = source. tsv_file_path . take ( ) {
155
149
let mut file_path = PathBuf :: new ( ) ;
156
150
file_path. push ( dst) ;
157
- event_sources. push ( EventSourceConfig :: StacksTsvPath ( PathConfig { file_path } ) ) ;
151
+ event_sources. push ( EventSourceConfig :: OrdinalsSqlitePath ( PathConfig { file_path } ) ) ;
158
152
continue ;
159
153
}
160
154
if let Some ( file_url) = source. tsv_file_url . take ( ) {
161
- event_sources. push ( EventSourceConfig :: StacksTsvUrl ( UrlConfig { file_url } ) ) ;
155
+ event_sources. push ( EventSourceConfig :: OrdinalsSqliteUrl ( UrlConfig { file_url } ) ) ;
162
156
continue ;
163
157
}
164
158
}
@@ -234,22 +228,14 @@ impl Config {
234
228
pub fn is_initial_ingestion_required ( & self ) -> bool {
235
229
for source in self . event_sources . iter ( ) {
236
230
match source {
237
- EventSourceConfig :: StacksTsvUrl ( _) | EventSourceConfig :: StacksTsvPath ( _) => {
231
+ EventSourceConfig :: OrdinalsSqlitePath ( _) | EventSourceConfig :: OrdinalsSqliteUrl ( _) => {
238
232
return true
239
233
}
240
- _ => { }
241
234
}
242
235
}
243
236
return false ;
244
237
}
245
238
246
- pub fn add_local_stacks_tsv_source ( & mut self , file_path : & PathBuf ) {
247
- self . event_sources
248
- . push ( EventSourceConfig :: StacksTsvPath ( PathConfig {
249
- file_path : file_path. clone ( ) ,
250
- } ) ) ;
251
- }
252
-
253
239
pub fn add_ordinals_sqlite_remote_source_url ( & mut self , file_url : & str ) {
254
240
self . event_sources
255
241
. push ( EventSourceConfig :: OrdinalsSqliteUrl ( UrlConfig {
@@ -275,15 +261,6 @@ impl Config {
275
261
}
276
262
}
277
263
278
- pub fn expected_local_stacks_tsv_file ( & self ) -> & PathBuf {
279
- for source in self . event_sources . iter ( ) {
280
- if let EventSourceConfig :: StacksTsvPath ( config) = source {
281
- return & config. file_path ;
282
- }
283
- }
284
- panic ! ( "expected local-tsv source" )
285
- }
286
-
287
264
pub fn expected_cache_path ( & self ) -> PathBuf {
288
265
let mut destination_path = PathBuf :: new ( ) ;
289
266
destination_path. push ( & self . storage . working_dir ) ;
@@ -299,23 +276,6 @@ impl Config {
299
276
panic ! ( "expected remote-tsv source" )
300
277
}
301
278
302
- fn expected_remote_stacks_tsv_base_url ( & self ) -> & String {
303
- for source in self . event_sources . iter ( ) {
304
- if let EventSourceConfig :: StacksTsvUrl ( config) = source {
305
- return & config. file_url ;
306
- }
307
- }
308
- panic ! ( "expected remote-tsv source" )
309
- }
310
-
311
- pub fn expected_remote_stacks_tsv_sha256 ( & self ) -> String {
312
- format ! ( "{}.sha256" , self . expected_remote_stacks_tsv_base_url( ) )
313
- }
314
-
315
- pub fn expected_remote_stacks_tsv_url ( & self ) -> String {
316
- format ! ( "{}.gz" , self . expected_remote_stacks_tsv_base_url( ) )
317
- }
318
-
319
279
pub fn expected_remote_ordinals_sqlite_sha256 ( & self ) -> String {
320
280
format ! ( "{}.sha256" , self . expected_remote_ordinals_sqlite_base_url( ) )
321
281
}
@@ -324,15 +284,6 @@ impl Config {
324
284
format ! ( "{}.gz" , self . expected_remote_ordinals_sqlite_base_url( ) )
325
285
}
326
286
327
- pub fn rely_on_remote_stacks_tsv ( & self ) -> bool {
328
- for source in self . event_sources . iter ( ) {
329
- if let EventSourceConfig :: StacksTsvUrl ( _config) = source {
330
- return true ;
331
- }
332
- }
333
- false
334
- }
335
-
336
287
pub fn rely_on_remote_ordinals_sqlite ( & self ) -> bool {
337
288
for source in self . event_sources . iter ( ) {
338
289
if let EventSourceConfig :: OrdinalsSqliteUrl ( _config) = source {
@@ -342,20 +293,6 @@ impl Config {
342
293
false
343
294
}
344
295
345
- pub fn should_download_remote_stacks_tsv ( & self ) -> bool {
346
- let mut rely_on_remote_tsv = false ;
347
- let mut remote_tsv_present_locally = false ;
348
- for source in self . event_sources . iter ( ) {
349
- if let EventSourceConfig :: StacksTsvUrl ( _config) = source {
350
- rely_on_remote_tsv = true ;
351
- }
352
- if let EventSourceConfig :: StacksTsvPath ( _config) = source {
353
- remote_tsv_present_locally = true ;
354
- }
355
- }
356
- rely_on_remote_tsv == true && remote_tsv_present_locally == false
357
- }
358
-
359
296
pub fn should_download_remote_ordinals_sqlite ( & self ) -> bool {
360
297
let mut rely_on_remote_tsv = false ;
361
298
let mut remote_tsv_present_locally = false ;
@@ -421,9 +358,7 @@ impl Config {
421
358
working_dir : default_cache_path ( ) ,
422
359
} ,
423
360
http_api : PredicatesApi :: Off ,
424
- event_sources : vec ! [ EventSourceConfig :: StacksTsvUrl ( UrlConfig {
425
- file_url: DEFAULT_TESTNET_STACKS_TSV_ARCHIVE . into( ) ,
426
- } ) ] ,
361
+ event_sources : vec ! [ ] ,
427
362
limits : LimitsConfig {
428
363
max_number_of_bitcoin_predicates : BITCOIN_MAX_PREDICATE_REGISTRATION ,
429
364
max_number_of_concurrent_bitcoin_scans : BITCOIN_SCAN_THREAD_POOL_SIZE ,
@@ -453,9 +388,6 @@ impl Config {
453
388
} ,
454
389
http_api : PredicatesApi :: Off ,
455
390
event_sources : vec ! [
456
- EventSourceConfig :: StacksTsvUrl ( UrlConfig {
457
- file_url: DEFAULT_MAINNET_STACKS_TSV_ARCHIVE . into( ) ,
458
- } ) ,
459
391
EventSourceConfig :: OrdinalsSqliteUrl ( UrlConfig {
460
392
file_url: DEFAULT_MAINNET_ORDINALS_SQLITE_ARCHIVE . into( ) ,
461
393
} ) ,
0 commit comments