Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add options to add custom values to use in various places in the config #47

Open
daniel1302 opened this issue Mar 22, 2022 · 0 comments

Comments

@daniel1302
Copy link
Contributor

daniel1302 commented Mar 22, 2022

Currently, We need to spend a lot of time to change one value, e.g log level. We can add a mechanism, that injects custom context into the config template.

This is a PR that shows problem: https://github.com/vegaprotocol/system-tests/pull/636

Solution

Let's say we have a new section in the HCL config:

template_variables = {
    log_level_vega = "Info"
    log_level_data_node = "Debug"
}

Then We can use it in a configs like here:

// ============================
// ===== VegaNode Config ======
// ============================

      vega = <<-EOT
[API]
  	Level = "{{.variables.log_level_vega}}"
	Port = 30{{.NodeNumber}}2
	[API.REST]
			Port = 30{{.NodeNumber}}3

[Blockchain]
  	Level = "Debug"
	[Blockchain.Tendermint]
    	Level = "{{.variables.log_level_vega}}"
		ClientAddr = "tcp://127.0.0.1:266{{.NodeNumber}}7"
		ServerAddr = "0.0.0.0"
		ServerPort = 266{{.NodeNumber}}8
	[Blockchain.Null]
    	evel = "{{.variables.log_level_vega}}"
		Port = 31{{.NodeNumber}}1

[Collateral]
    Level = "{{.variables.log_level_vega}}"

[CoreAPI]
    LogLevel = "{{.variables.log_level_vega}}"
...
...
@gordsport gordsport moved this to Todo in Core Kanban Mar 25, 2022
@gordsport gordsport added the Low label Nov 9, 2022
@gordsport gordsport added this to the ☄️ Cosmic Elevator milestone Nov 9, 2022
@gordsport gordsport removed this from the ☄️ Cosmic Elevator milestone May 4, 2023
@gordsport gordsport removed this from Core Kanban Oct 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants