Here:
https://blockchain.info/api/json_rpc_apiwe can see an example of using bitcoind to contact another, remote wallet:
$ ./bitcoind -rpcconnect=rpc.blockchain.info -rpcport=443 -rpcssl -rpcuser=YourWalletIdentifier -rpcpassword=YourPassword getinfo
Now, I am trying to use Perl CGI, running on one howt, and accessing the wallet on another host (on blockchain.info):
use JSON::RPC::Client;
use Data::Dumper;
my $client = new JSON::RPC::Client;
$client->ua->credentials(
'localhost:8332', 'jsonrpc', 'user' => 'password' # REPLACE WITH YOUR bitcoin.conf rpcuser/rpcpassword
);
my $uri = 'http://localhost:8332/';
my $obj = {
method => 'getinfo',
params => [],
};
my $res = $client->call( $uri, $obj );
if ($res){
if ($res->is_error) { print "Error : ", $res->error_message; }
else { print Dumper($res->result); }
} else {
print $client->status_line;
}Could you please help me to edit this Perl script, to move parameters (like url/port etc) from the command line to the script, so that the script could access the wallet, AND it was done using secure connection?
My second question is less urgent, but still: JSON::RPC::Client seems to be obsolete in Perl. Are there new alternatives to the code above?