我即将通过 RPC 处理我的狗狗币钱包。我租了一台小型服务器并在那里安装了 dogcoind。在 dogcoin.conf 中如下:
server=1
rpcallowip=ip from extern server
rpcport=port
rpcuser=user
rpcpassword=pass
不幸的是,我在使用 jsonRPCClient.class.php 时总是收到以下消息:
Fatal error: Uncaught exception 'Exception' with message 'Failed connect to ip from wallet server:port; Connection refused' in /home/user/public_html/cont/class/jsonRPCClient.class.php:185 Stack trace: #0 /home/user/public_html/cont/class/jsonRPCClient.class.php(247): jsonRPCClient->callByCURL('{"method":"geti...') #1 /home/user/public_html/doge.php(15): jsonRPCClient->__call('getinfo', Array) #2 /home/user/public_html/doge.php(15): jsonRPCClient->getinfo() #3 {main} thrown in /home/user/public_html/cont/class/jsonRPCClient.class.php on line 185
php 看起来像这样:
require "cont/class/doge.class.php";
require "cont/class/jsonRPCClient.class.php";
$config = array(
'user' => 'user',
'pass' => 'pass',
'host' => 'ip from wallet server',
'port' => 'port from wallet server' );
// create client conncetion
$doge = new doge( $config );
// create a new address
$address = $doge->get_address( 'mkaz' );
print( $address );
// check balance
print( "mkaz: " . $doge->get_balance( 'mkaz' ) );
有人可以告诉我我在这里做错了什么吗?
预先感谢您的帮助