Where can i find the rpc server logs.
I am writing a perl script to interact with a private blockchain and I am able to make few api calls but server is throwing "500 Internal Server Error" when I invoke getblockhash
Code snippet:
sub getBlockHash {
$class=shift;
my $height=shift;
print "height inside fn: $height \n"; # I am getting the number correctly here.
my $obj = {
method => 'getblockhash', # similar function with getinfo or getblockcount without
params => [$height], # passing params works well.
}; # tried sendwithmetadata , it works with params
my $res = $client->call( $uri, $obj );
if ($res){
print "Got res\n";
if ($res->is_error) { print "Error : ", $res->error_message; return "ERROR"; }
else {
my $data = Dumper ($res->result);
$bcount = substr ($data,length('$VAR1 = '),length($data));
$bcount =~ s/\W//g;
return $bcount;
}
} else {
print "no res\n";
print $client->status_line;
return "ERROR";
}
}
----------------- RESULT -----------------------
height inside fn: 15545
no res
500 Internal Server ErrorHash = ERROR
---------------------
Where can I find the logs to debug these kind of errors? is getblockhash not recognised?
I want to traverse the block starting from 0 to total number of blocks , using getblock api after I get the hash from getblockhash <height> call.
is there any other method to do this? I am interested to fetch transactions which has metadata attached to them.
any help much appreciated.
thanks