我分别编译了bitcoin和btcpool的源码,在运行btcpool里面的一些服务的时候,需要设置RPC服务。
这个RPC服务应该就是bitcoind提供的。
我现在需要设置RPC服务的地址是127.0.0.1:8332, 用户是onerpc, 密码是123,如何设置呢?
我启动的命令是:
bitcoind -server -rpcuser=onerpc -rpcpassword=123 -port=8332
使用命令出了下面的错误:
bitcoind -rpcuser=onerpc -rpcpassword=123 -port=8332 -jsonrpc -server
Error: Unable to bind to 0.0.0.0:8332 on this computer. Bitcoin Core is probably already running.
Error: Failed to listen on any port. Use -listen=0 if you want this.
在/root/.bitcoin/下面创建配置文件bitcoin.conf
cp ./contrib/debian/examples/bitcoin.conf /root/.bitcoin/
直接运行bitcoind
bitcoind
查看端口8332
lsof -i:8332
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
bitcoind 8331 root 9u IPv6 308456 0t0 TCP *:8332 (LISTEN)