我正在运行一个比特币服务器,我通过运行bitcoin-cli getinfo来验证它的工作情况。我有一个新的比特币现金服务器,它基本上设置相同,但当我运行cli命令时,它会出错。当我从服务器运行这个命令时;
bitcoin-cli -rpcuser bitcoin -stdinrpcpass REDACTED_1aAbY -conf /data01/bitcoin/bitcoin.conf -rpcport 8332 getinfo我得到的结果是:error: Could not locate RPC credentials. No authentication cookie could be found, and RPC password is not set. See -rpcpassword and -stdinrpcpass. Configuration file: (/home/ubuntu/.bitcoin/bitcoin.conf)
无论我在比特币-cli上使用什么标志,我都会得到相同的错误。该错误指示conf文件应位于/home/ubuntu/.bitcoin/bitcoin.conf,但该文件和目录不存在。
我的服务器配置看起来像这样;
server=1
txindex=1
zmqpubrawtx=tcp://127.0.0.1:28332
zmqpubhashblock=tcp://127.0.0.1:28332
rpcallowip=127.0.0.1
rpcallowip=0.0.0.0/0
rpcuser=bitcoin
rpcpassword=REDACTED_1aAbY
rpcbind=0.0.0.0
rest=1
daemon=1
datadir=/data01/bitcoin
rpcworkqueue=128
whitelist=0.0.0.0/0
rpcallowip=::/0
printtoconsole=1如果我停止运行bitcoind exe,那么我会得到这个错误;
Make sure the bitcoind server is running and that you are connecting to the correct RPC port.```
That tells me at least I'm running against what I think I am.发布于 2019-07-27 04:27:15
事实证明,当服务器仍在下载块时,您无法连接到rpc服务器。一旦完成,您就可以连接到服务器了。使用比特币-cli getinfo是最初的问题。
发布于 2019-07-26 14:43:05
(本地) cli命令独立于rpc身份验证。只需像这样尝试该命令:
比特币-cli getinfo
比特币-cli -rpcport=8332获取信息
https://stackoverflow.com/questions/57206919
复制相似问题