Skip to content

Commit

Permalink
Merge branch 'node-url-env' into 'main'
Browse files Browse the repository at this point in the history
add env override for node URL

See merge request flarenetwork/flare-system-c-chain-indexer!33
  • Loading branch information
ryanc-flare committed May 27, 2024
2 parents 53bb3c4 + 5897a9a commit 8f39b43
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 1 addition & 0 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
}

Expand Down

0 comments on commit 8f39b43

Please sign in to comment.