diff --git a/README.md b/README.md index a0f9720..aa6a81e 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,8 @@ file = "./logger/logs/flare-ftso-indexer.log" console = true [chain] -node_url = "http://127.0.0.1:8545/" +node_url = "http://127.0.0.1:8545/" # or NODE_URL environment variable +# api_key = ... or NODE_API_KEY environment variable [timeout] backoff_max_elapsed_time_seconds = 300 # optional, defaults to 300s = 5 minutes. Affects how long the indexer will keep retrying in case of a complete outage of the node provider. Set to 0 to retry indefinitely. diff --git a/config/config.go b/config/config.go index cac852e..7722a98 100644 --- a/config/config.go +++ b/config/config.go @@ -149,6 +149,7 @@ func (cc ChainConfig) FullNodeURL() (*url.URL, error) { var envOverrides = map[string]func(*Config, string){ "DB_USERNAME": func(c *Config, v string) { c.DB.Username = v }, "DB_PASSWORD": func(c *Config, v string) { c.DB.Password = v }, + "NODE_URL": func(c *Config, v string) { c.Chain.NodeURL = v }, "NODE_API_KEY": func(c *Config, v string) { c.Chain.APIKey = v }, }