P
P
P4YK2021-10-16 11:50:07
PHP
P4YK, 2021-10-16 11:50:07

How to remotely connect bitcoind to another server?

Hello, I'm interested in such a question as how to connect bitcoind remotely to another server.
I have a server where bitcoind is located. On another server there is a web server where php is located to connect bitcoind.
Here is the bitcoin.conf config:

listen=1
maxconnections=10
rest=1
daemon=1
txindex=1
server=1
rpcbind=10.57.4.135
rpcuser=rpcuser
rpcpassword=rpcpassword
rpcallowip=10.57.4.107/255.255.255.0
rpcbind=127.0.0.1:8332
rpcallowip=0.0.0.0/0
rpcport=8332

Here is the php code:
<?php
require_once('easybitcoin.php');
$bitcoin = new Bitcoin('rpcuser','rpcpassword','127.0.0.1','8332');
 echo "<pre>\n";
  print_r($bitcoin->getinfo()); echo "\n";
  echo "Received: ".$bitcoin->getreceivedbylabel("Your Address")."\n";
  echo "</pre>";
?>
Но bitcoin.php не хочет подключаться:(

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Mouvdy, 2021-10-16
@P4YK

[main]
# Allow JSON-RPC connections from, by default only localhost are allowed
rpcbind=0.0.0.0
rpcallowip=web_server_php_ip
rpcallowip=127.0.0.1

#[core]
daemon=1
debug=1
maxconnections=900

# [configuration]
datadir=/root/.bitcoin/

# [RPC]
server=1
rpcuser=username
rpcpassword=password
rpcport=8332

rpcthreads=16

minconf=0

A working option from my side, + 8332 port in the firewall

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question