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

ERROR: unknown flag: --consensus.create_empty_blocks_interval #4065

Closed
KrishnaPG opened this issue Oct 17, 2019 · 10 comments · Fixed by #4205
Closed

ERROR: unknown flag: --consensus.create_empty_blocks_interval #4065

KrishnaPG opened this issue Oct 17, 2019 · 10 comments · Fixed by #4205
Labels
good first issue Contributions Welcome!! T:enhancement Type: Enhancement T:ux Type: Issue or Pull Request related to developer experience

Comments

@KrishnaPG
Copy link

Tendermint version: 0.32.6-c4ba93a1

ABCI app: local test app

Environment:

  • OS: Windows 10 x64
  • Install tools: tendermint-node
  • Others:

What happened:

ERROR: unknown flag: --consensus.create_empty_blocks_interval

What you expected to happen: should work without error

Have you tried the latest version: yes

How to reproduce it (as minimally and precisely as possible):

Use the below command line

tendermint node --home=./tendermint --consensus.create_empty_blocks=false --consensus.create_empty_blocks_interval=30s --p2p.laddr=tcp://0.0.0.0:26656 --rpc.laddr=tcp://0.0.0.0:26657 --moniker=anonymous

Anything else we need to know:

Trying to run tendermint with above CLI command is failing with the above error. The create_empty_blocks setting on the same command has no problem. Not sure why it does not accept the create_empty_blocks_interval param

While it is failing from the CLI command directly, the original requirement is to be able to launch the node with tendermint-node, which obviously is generating the above error. The config there is:

			"consensus": {
				"create_empty_blocks": false,
				"create_empty_blocks_interval": "30s"
			}

which the tendermint-node automatically converts to CLI commandline parameters, where it is failing to launch because of the above error. So, tried running the command directly from CLI then observed that it is failing.

@KrishnaPG
Copy link
Author

Also, same issue with log_format option:

> tendermint node --home=./tendermint --p2p.laddr=tcp://0.0.0.0:26656 --rpc.laddr=tcp://0.0.0.0:26657 --moniker=anonymous --log_format=json

ERROR: unknown flag: --log_format

@melekes
Copy link
Contributor

melekes commented Oct 19, 2019

Tendermint does not expose all config parameters via CLI.

@melekes
Copy link
Contributor

melekes commented Oct 19, 2019

And I don't think it should as it leads to code duplication UNLESS there's a way to avoid it. You can use env variables for simple variables: TM_LOG_FORMAT=json tendermint node ...

@KrishnaPG
Copy link
Author

KrishnaPG commented Oct 19, 2019

Thank you @melekes

So, how exactly does one programatically control the tendermint node instance, say when launching through tendermint-node ?

As of now, a tendermint node instance is useless without a proxy app instance. So, launching the node instance as part of the abci_host app is the perfect (only?) way to manage its life programatically.

Given that Tendemint Node is supposed to be 'programmable' one would expect the behavior to be controlled at runtime (and not just through config files).

does not expose all config parameters

How does one know which ones are exposed and which ones are not?

It sounds pretty wierd to send some commands through CLI param, and some through env, when all of them reside in the same config.

I am kind of stuck where I could launch the tendermint-node instance from Node.JS programatically, but no way to control its behavior programatically. Unable to move ahead because of this random decision not to include some params on the CLI.

Wondering if you are targeting only GO programmers, and moving away from JS/Node.js If so, please let us know so that we would just stay away and not bother you. It is really frustrating to encounter something labelled as built for programmers, and then not being able to do anything with it programmatically.

@ebuchman
Copy link
Contributor

How does one know which ones are exposed and which ones are not?

The tendermint node --help shows a list. Not sure we have better place where this is documented.

You are right it can be a bit frustrating that some things can be handled directly on the CLI, while the rest require editing the config file. Most folks have just dealt with this, and figured out a way to programmatically manage the config file. It would probably be a bit over whelming to surface the entire config file into the CLI flags. That said, since we already have a CLI flag for --consensus.create_empty_blocks, it wouldn't be a stretch to add one for --consensus.create_empty_blocks_interval. Would you be open to submitting a PR? Would be much appreciated.

Thanks!

@KrishnaPG
Copy link
Author

Thank you @ebuchman .

Adding consensus.create_empty_blocks_interval would be helpful. Regarding the PR, wish I could do it - unfortunately, this seems to be GO code, and not something in my reach. Tried reading the code, and could not make a head or tail of it. One of the reasons why I am using tendermint-node for the ABCI (from Javascript).

To give a bigger picture:

How does one know which ones are exposed and which ones are not?

I meant that "programmatically". That is, in an ABCI host built in some other language, which receives the tendermint config file, it would be very difficult to know programmatically which options in that config file has to go into ENV, and which has to go into the command line. The tendermint node --help is, once again, CLI option that a program such as abci host may not find interesting.

The goal I am trying to achieve is: start, control and stop the tendermint node programmatically (without any human intervention). Since tendermint is consensus-engine for programmers, I am hoping that it would be made possible.

@melekes
Copy link
Contributor

melekes commented Nov 3, 2019

The goal I am trying to achieve is: start, control and stop the tendermint node programmatically (without any human intervention). Since tendermint is consensus-engine for programmers, I am hoping that it would be made possible.

Yeah, that's a good goal I think.

Maybe there's a way to do it using viper. We'll need to research.

@ebuchman ebuchman added API T:ux Type: Issue or Pull Request related to developer experience T:enhancement Type: Enhancement good first issue Contributions Welcome!! labels Nov 19, 2019
@ebuchman
Copy link
Contributor

Ok I've marked it as "good first issue". Someone with minimal Go experience should be able to tackle this. Meanwhile, we fully agree with your point re programmability. Would you mind opening a new issue describing this and how you might like to see it be realized?

Thanks!

@KrishnaPG
Copy link
Author

Thank you @ebuchman

Tried to summarize some of the details here briefly: #4204

Request others, who may have more experience with TM, to add further ideas and suggestions to make it thorough.

@jgimeno
Copy link
Contributor

jgimeno commented Nov 29, 2019

Ouch!! Now I have seen this new ticket created by @KrishnaPG ! You can close the PR if not needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Contributions Welcome!! T:enhancement Type: Enhancement T:ux Type: Issue or Pull Request related to developer experience
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants