You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the hilo-node's cli args are directly transformed into the hilo-nodeConfig. Instead, the node binary should use Figment to attempt to read environment variables, then the toml file, and lastly the CLI args to build the Config.
This could look like the following.
use hilo_node::Config;use figment::{Figment, providers::{Serialized,Env,Toml}};let cli = NodeArgs.parse()?;let toml_file = cli.static-config;// This can be a cli arg, so you can do `node --static-config hilo.toml`let defaults_provider = Serialized::defaults(DefaultsProvider::default());let toml_provider = Toml::file(toml_file).nested();let cli_provider = Serialized::defaults(cli);let config:Config = Figment::new().merge(defaults_provider).merge(Env::prefixed("HILO_")).merge(toml_provider).merge(cli_provider).extract()?;
Note, the CliArgs should be modified to make arguments optional.
The text was updated successfully, but these errors were encountered:
Description
Currently, the
hilo-node
's cli args are directly transformed into thehilo-node
Config
. Instead, thenode
binary should use Figment to attempt to read environment variables, then the toml file, and lastly the CLI args to build theConfig
.This could look like the following.
Note, the
CliArgs
should be modified to make arguments optional.The text was updated successfully, but these errors were encountered: