denpamusic / laravel-bitcoinrpc

Bitcoin JSON-RPC Service Provider for Laravel.
https://laravel-bitcoinrpc.denpa.pro
MIT License
90 stars 39 forks source link

Possible to use external server IP #5

Closed reinierkors closed 6 years ago

reinierkors commented 6 years ago

Hi, is it possible to use an external IP address instead of localhost?

denpamusic commented 6 years ago

Hi, it is possible to use external IP or hostname to reach daemon. Just make sure that RPC port is open on remote. Depending on usage, I also recommend you to disallow access to this port for anyone except server that runs laravel.

CryDeTaan commented 6 years ago

You can specify allowed IP address. Examples from the bitcoin.conf spec:

#rpcallowip=10.1.1.34/255.255.255.0
#rpcallowip=1.2.3.4/24
#rpcallowip=2001:db8:85a3:0:0:8a2e:370:7334/96

See here for more information: https://en.bitcoin.it/wiki/Running_Bitcoin#Bitcoin.conf_Configuration_File

CryDeTaan commented 6 years ago

This can be closed, I just tested and works by specifying in .env

Remember to run php artisan vendor:publish --provider="Denpa\Bitcoin\Providers\ServiceProvider" for the config to be created so that you can specify your remote server in the .env file.

This is how I did it in the .env based on the config/bitcoind.php file:

BITCOIND_HOST=10.0.0.139
BITCOIND_USER=exampleuser
BITCOIND_PASSWORD=examplepasswor
denpamusic commented 6 years ago

Yes, I believe comments above by me and @CryDeTaan fully answer initial question, so I'll close this for now. If you have any issues setting up remote rpc access don't hesitate to update this issue or write your questions directly to gitter. Thanks!