* cmd/tendermint: fix initialization file creation checks
Fixes#989.
The original initialization sequence started to inexplicably
fail
```shell
tendermint unsafe_reset_all
tendermint init
tendermint node --proxy_app=dummy
```
used to fail with
```shell
ERROR: Failed to create node: Couldn't read GenesisDoc file: open
/Users/emmanuelodeke/.tendermint/genesis.json: no such file or directory
```
because the initialization sequence always assumed that the
genesisDoc would only be set if the privValidator was generated.
However, `tendermint unsafe_reset_all` only created the
`priv_validator.json` file which would mean that then running
`tendermint init` would never create the `genesis.json` file
which if following the recommended sequence would then fail
since the `genesis.json` was absent.
* cmd/tendermint: Load PrivValidatorFS if existent, lest generate it
Feedback from @melekes
* change logging messages for init cmd
Refs #989
Can now run batch which can be tested by:
```shell
echo -e "echo foo\necho blue" | abci-cli batch
```
giving
```shell
I[12-12|07:55:55.513] Starting socketClient
module=abci-client impl=socketClient
-> code: OK
-> data: foo
-> data.hex: 0x666F6F
-> code: OK
-> data: blue
-> data.hex: 0x626C7565
```
Use the single client connection at startup time
for sending over commands instead of shelling out
for every command.
This code fixes the regression from
https://github.com/tendermint/abci/pull/117
which instead used "os/exec".Command with:
"abci-cli <the_command> [args...]"
The purpose of this code is to restore us
back to the state after cobra replace urlfave/cli.
There is still a bit of work to implement Batch
itself, but that should be simpler as a focused
command.
Fixes#133
This commit adds the basic test command 'abci-cli test' that will
allow developers of server for their own language to continuously test
their implementation.
plus make Client interface more consistent. All *Sync functions now
return an error as a second return param. Deliver/Check/Commit use Code
to indicate errors and have IsErr() func defined on ResponseXYZ structs.