pub struct IndexerConfig {
pub store: PathBuf,
pub secondary_path: PathBuf,
pub poll_interval: u64,
pub index_tx_pool: bool,
pub block_filter: Option<String>,
pub cell_filter: Option<String>,
pub db_background_jobs: Option<NonZeroUsize>,
pub db_keep_log_file_num: Option<NonZeroUsize>,
pub init_tip_hash: Option<H256>,
pub request_limit: Option<usize>,
pub rich_indexer: RichIndexerConfig,
}
Expand description
Indexer config options.
Fields§
§store: PathBuf
The index store path, default data_dir / indexer / store
secondary_path: PathBuf
The secondary_db path, default data_dir / indexer / secondary_path
poll_interval: u64
The poll interval by secs
index_tx_pool: bool
Whether to index the pending txs in the ckb tx-pool
block_filter: Option<String>
Customize block filter
cell_filter: Option<String>
Customize cell filter
db_background_jobs: Option<NonZeroUsize>
Maximum number of concurrent db background jobs (compactions and flushes)
db_keep_log_file_num: Option<NonZeroUsize>
Maximal db info log files to be kept.
init_tip_hash: Option<H256>
The init tip block hash
request_limit: Option<usize>
limit of indexer request
rich_indexer: RichIndexerConfig
Rich indexer config options
Implementations§
Source§impl IndexerConfig
impl IndexerConfig
Sourcepub fn adjust<P: AsRef<Path>>(&mut self, root_dir: &Path, indexer_dir: P)
pub fn adjust<P: AsRef<Path>>(&mut self, root_dir: &Path, indexer_dir: P)
Canonicalizes paths in the config options.
If self.store
is not set, set it to data_dir / indexer / store
.
If self.secondary_path
is not set, set it to data_dir / indexer / secondary_path
.
If self.rich_indexer
is Sqlite
, and self.rich_indexer.sqlite.store
is not set,
set it to data_dir / indexer / sqlite / sqlite.db
.
If any of the above paths is relative, convert them to absolute path using
root_dir
as current working directory.
Trait Implementations§
Source§impl Clone for IndexerConfig
impl Clone for IndexerConfig
Source§fn clone(&self) -> IndexerConfig
fn clone(&self) -> IndexerConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for IndexerConfig
impl Debug for IndexerConfig
Source§impl Default for IndexerConfig
impl Default for IndexerConfig
Source§impl<'de> Deserialize<'de> for IndexerConfig
impl<'de> Deserialize<'de> for IndexerConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl From<&IndexerConfig> for IndexerSyncConfig
impl From<&IndexerConfig> for IndexerSyncConfig
Source§fn from(config: &IndexerConfig) -> IndexerSyncConfig
fn from(config: &IndexerConfig) -> IndexerSyncConfig
Auto Trait Implementations§
impl Freeze for IndexerConfig
impl RefUnwindSafe for IndexerConfig
impl Send for IndexerConfig
impl Sync for IndexerConfig
impl Unpin for IndexerConfig
impl UnwindSafe for IndexerConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more