Skip to content

Commit

Permalink
feat: add options for logs
Browse files Browse the repository at this point in the history
  • Loading branch information
lgalabru committed Jul 31, 2023
1 parent 3485e6f commit 917090b
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions components/hord-cli/src/config/mod.rs
Expand Up @@ -30,6 +30,12 @@ pub struct Config {
pub event_sources: Vec<EventSourceConfig>,
pub limits: LimitsConfig,
pub network: IndexerConfig,
pub logs: LogConfig,
}

#[derive(Clone, Debug)]
pub struct LogConfig {
pub ordinals_computation: bool,
}

#[derive(Clone, Debug)]
Expand Down Expand Up @@ -223,6 +229,12 @@ impl Config {
stacks_network,
bitcoin_network,
},
logs: LogConfig {
ordinals_computation: config_file
.logs
.and_then(|l| l.ordinals_computation)
.unwrap_or(true),
},
};
Ok(config)
}
Expand Down Expand Up @@ -350,6 +362,9 @@ impl Config {
stacks_network: StacksNetwork::Devnet,
bitcoin_network: BitcoinNetwork::Regtest,
},
logs: LogConfig {
ordinals_computation: true,
},
}
}

Expand Down Expand Up @@ -379,6 +394,9 @@ impl Config {
stacks_network: StacksNetwork::Testnet,
bitcoin_network: BitcoinNetwork::Testnet,
},
logs: LogConfig {
ordinals_computation: true,
},
}
}

Expand Down Expand Up @@ -410,6 +428,9 @@ impl Config {
stacks_network: StacksNetwork::Mainnet,
bitcoin_network: BitcoinNetwork::Mainnet,
},
logs: LogConfig {
ordinals_computation: false,
},
}
}
}
Expand Down

0 comments on commit 917090b

Please sign in to comment.