Bitcoin core почему RPC открыт только для localhost?
Не получается соеденится с RPC Bitcoin Node, вернее с localhost все нормально, а вот из другого сервера - ошибка:
curl: (7) Failed to connect to server_ip port 8331: Connection refused
Как открыть доступ из вне?
Тут видно что порт который указан в конфиге 8331 открыт только для localhost
lsof -i | grep LISTEN
systemd-r 268 systemd-resolve 13u IPv4 13475 0t0 TCP localhost:domain (LISTEN)
sshd 469 root 3u IPv4 15137 0t0 TCP *:ssh (LISTEN)
sshd 469 root 4u IPv6 15148 0t0 TCP *:ssh (LISTEN)
bitcoind 532 root 9u IPv6 15735 0t0 TCP localhost:8331 (LISTEN)
bitcoind 532 root 10u IPv4 15737 0t0 TCP localhost:8331 (LISTEN)
bitcoind 532 root 27u IPv6 15772 0t0 TCP *:8333 (LISTEN)
bitcoind 532 root 28u IPv4 15773 0t0 TCP *:8333 (LISTEN)
Вот мой bitcoin.conf:
server=1
daemon=1
maxconnections=20
prune=551
dbcache=300
dbbatchsize=1024
maxsigcachesize=4
maxmempool=300
maxorphantx=10
mempoolexpiry=12
rpcuser=user
rpcpassword=pass
rpcallowip=site_ip
rpcallowip=127.0.0.1
rpcallowip=0.0.0.0/0
rpcport=8331
whitelist=site_ip
whitelist=127.0.0.1
whitelist=0.0.0.0/0
Тестирую в терминале командой: curl --data-binary '{"jsonrpc":"1.0","id":"curltext","method":"getnewaddress","params":[]}' -H 'content-type:text/plain;' http://user:pass@server_ip:8331
Ответы (1 шт):
Вопрос решен созданием тоннеля на сервере с сайтом к серверу где биткоин
/usr/bin/ssh -NT -o ServerAliveInterval=60 -L 127.0.0.1:8332:127.0.0.1:8332 tunnel@IP_SERVER_BTC