multichain-util always returning exit status 0 (success)

+2 votes

Hi, I don't know the proper place to ask this,

When I do `multichain-util create some-chain-name....`, even if it fails because of reasons like existing chain-names, and it says "ERROR: Blockchain parameter set was not generated.", its exit status is 0.
I see this when I do `multichain-util clone not-existing-chain-name` or `multichaind not-existing-chain-name` too.

I'm just curious: shouldn't this be exit code 1 or so? And also the stderr output could be used, I think.
Or am I missing existences of any other fatal errors that uses stderr and exit statuses > 0 ?

I can see that doing things like `multichain-cli chain-name close` returns an exit status 89, saying "error: {"code":-32601,"message":"Method not found"}" in the stderr, as expected.

multichain version: 1.0 alpha 18

asked Mar 22, 2016 by ndac_todoroki
edited Mar 23, 2016 by ndac_todoroki

1 Answer

+2 votes
 
Best answer
Yes, I think you are right about this. We'll look into fixing it for the next alpha.
answered Mar 23, 2016 by MultiChain
selected Mar 23, 2016 by ndac_todoroki
Thanks, it'll be great when writing a script for multichain!
Just one more thing: `multichaind chainname -daemon` needs to be quit with a Ctrl-C or Enter or something (It won't return to the console directly). Could this be fixed too?
Thanks, we will check into that as well.
Haha gj  ndac_todoroki i noticed this things as well, they were a bit annoying when working manually but they dont seem to disrupt next system command entered by my program so i forgot to mention it.
You multichain guys could also look into editing the message that  
multichain-util create chainname
prints out to system. Currently it says "To generate blockchain please run"multichaind chainname"" and you need to add -daemon at the end to actually run it, without it it completely bugs out and you have to terminate it to resume working in that terminal which also terminates the blockchain.
SlobodanMargetic: I think that isn't wrong, I thought the `-daemon` is an option to make multichaind to work as a daemon. Without the option it still generates the blockchain, but in interactive mode. It is the same behavior as in something like God or Nginx or so :)
...