bitcoin - 比特币现金 bitcoin-cli 无法连接到 RPC 服务器
问题描述
我正在运行一个比特币服务器,我通过运行 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)
无论我在 bitcoin-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.
解决方案
事实证明,当服务器仍在下载块时,您无法连接到 rpc 服务器。完成后,您可以连接到服务器。使用 bitcoin-cli getinfo 是最初的问题。
推荐阅读
- pivot - 我在 DAX runningtotal 计算中是否正确使用了变量?
- android - Android Studio 相机在拍照时一直停止
- javascript - 我无法在 WebStorm Angular Material 项目中使用已删除的事件
- java - 用Java替换文件中HashMap中的值
- c# - 在 .NET 标准类库中添加对 PluralizationServices 的引用
- linux - 无法打开共享对象文件:JNI 调用期间没有这样的文件或目录
- xcode - iOS 14.5 VS 15 表正在创建空白
- go - 通过 anaconda - golang 流式传输带有特定 URL 的推文
- javascript - 如何在使用 Django 和 React 时修复 500 内部服务器错误
- reactjs - 反应弹簧错误:
属性 d:预期数量