我已经构建了Catcoind (比特币/项目的一个分支),我可以通过根用户访问我的终端中的命令:
cd catcoin/src
./catcoind -daemon这将启动Catcoind,打开端口,并允许我键入诸如'./catcoind another‘之类的命令,但我希望通过运行在另一个服务器上的PHP RPC客户端访问它们。我目前的代码是:
<?php
require_once 'jsonRPCClient.php';
$catcoin = new jsonRPCClient('http://RPCUSER:RPCPASS@IP:PORT');
print_r($catcoin->getinfo());
echo $catcoin->getdifficulty();我在Ubuntu上构建Catcoind的配置文件是:
server=1
rpcuser=USER
rpcpassword=PASS
rpcssl=0
rpcallowip=*
bind=IP:PORT
externalip=IP
proxy=IP:PORT
port=PORT
rpcconnect=IP当我运行代码时,它说它未能打开拒绝的流/连接。Catcoind的配置位于位置~/.cat硬币/catcoin.conf。有什么想法吗?我知道这是令人困惑的,但我确实做了所有事情,但允许外部is访问API。谢谢!:D
发布于 2014-01-15 03:43:47
您不需要在conf文件中编写所有这些东西,只需使用以下命令
server=1
daemon=1
rpcuser=<user_namer>
rpcpassword=<password>
rpctimeout=30如果从远程主机连接,请添加以下行
rpcallowip=<remote_ip_address>保存并退出conf文件,然后重新启动守护进程,首先停止catecoind停止,然后启动catcoind。
发布于 2014-01-05 03:23:12
允许使用外部IP吗?如果不允许,请确保IP被允许,以便它可以调用api。错误failed to open the stream / connection refused通常意味着ip和一切都是正确的,但是服务器拒绝连接。
https://stackoverflow.com/questions/20892538
复制相似问题