|
|
@ -11,11 +11,10 @@ use strict; |
|
|
|
use warnings; |
|
|
|
use Data::Dumper; |
|
|
|
use JSON; |
|
|
|
#use Getopt::Long; |
|
|
|
use Getopt::Long; |
|
|
|
|
|
|
|
my $node_client = 'hush-cli'; # hush-cli client |
|
|
|
my $block_height = 699000; # start block unless changed with --block |
|
|
|
my $node_client = 'hush-cli'; # hush-cli client |
|
|
|
my $block_height = 699000; # start block unless changed with --block |
|
|
|
my $version = "0.1"; |
|
|
|
my $print_version; |
|
|
|
|
|
|
@ -58,7 +57,7 @@ sub read_json { |
|
|
|
|
|
|
|
my ($raw) = @_; |
|
|
|
|
|
|
|
eval { decode_json($raw) }; # eval first, bad JSON kills puppies |
|
|
|
eval { decode_json($raw) }; # eval first, bad JSON kills puppies |
|
|
|
|
|
|
|
if (!$@) { |
|
|
|
return(decode_json($raw)); |
|
|
@ -76,7 +75,7 @@ sub node_cli { |
|
|
|
|
|
|
|
my $response = qx{$node_client $command 2>/dev/null}; |
|
|
|
|
|
|
|
my $json = read_json($response); # bad JSON kills puppies too |
|
|
|
my $json = read_json($response); |
|
|
|
|
|
|
|
if ($json) { |
|
|
|
return($json); |
|
|
|