Author

Topic: Help! to connect Bitcoin Core (Read 370 times)

jr. member
Activity: 98
Merit: 3
August 19, 2019, 05:17:16 AM
#13
Please provide the bitcoin.conf so that others can also learn from what you found.

Now my bitcoin.conf looks likes this.
Code:
# Generated by https://jlopp.github.io/bitcoin-core-config-generator/

# This config should be placed in following path:
# %UserProfile%\AppData\Roaming\Bitcoin\bitcoin.conf

server=1

# [network]
# Listen for incoming connections on non-default port.
port=8333

# [rpc]
# Listen for JSON-RPC connections on this port
rpcuser=Administrator
rpcpassword=somepassword
rpcallowip=111.222.0.0/16
rpcport=8332

Did you try to test the rpc over shh localy (on the server itself)  to ensure this works?
Yes and it works.
But I can't access it from other server.
legendary
Activity: 2483
Merit: 1482
-> morgen, ist heute, schon gestern <-
August 18, 2019, 04:02:48 AM
#12
for bitcoin core: simple answer is no, you don't need it.
But you need the rpc port to be exposed to the outside world to be able to comunicate with it over the internet.
If there is a wallet on the bincoin-qt/bitcoind this is a very bad idea!
Instead, if you want to connect two servers in a different location over the internet, then you have to use a vpn as best. You can use openvpn on both sides of the servers.

for your JSON-RPC client based on GuzzleHttp you need PHP.
But I would not recoment to use that, did you read that:
https://github.com/denpamusic/php-bitcoinrpc/issues/44

Please provide the bitcoin.conf so that others can also learn from what you found.

Did you try to test the rpc over shh localy (on the server itself)  to ensure this works?

It is essential that you have read and understand this:
https://en.bitcoin.it/wiki/API_reference_(JSON-RPC)
jr. member
Activity: 98
Merit: 3
August 17, 2019, 09:41:43 AM
#11
today I have searched very long to discover if my bitcoin.conf settings are wrong, and I found some mistakes there.
After some fixes I could run commands from my Bitcoin server's command line and it works.

Now the problem is that I still can't use my rpc.

I'm sorry for this, but I just want to know if it's required to install some server like ( Apache, nginx... ) in the Bitcoin server side?
Because I'm new in this kind of stuff and have to learn many things.
jr. member
Activity: 98
Merit: 3
August 17, 2019, 01:27:41 AM
#10
did you try to use the bitcoin-qt rpc-port:
       'port'          => 8332,
Yep! I have tried but the 8332 port is closed and the response is

cURL error 7: Failed to connect to 123.321.256.632 port 8332: Timed out (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)
legendary
Activity: 2483
Merit: 1482
-> morgen, ist heute, schon gestern <-
August 16, 2019, 11:56:58 AM
#9
first problem is solved, bitcoin-qt, leave it as it is now.

for your second problem:

bitcoin.conf
Code:
 # [rpc]
   # Listen for JSON-RPC connections on this port
   rpcport=8332


your app credentials
Code:
public function btcReplenish(Request $request){
        $bitCoinD = new BitcoinClient([
            'host'          => self::RDC_HOST,
           [i] 'port'          => 8333,[/i]
            'user'          => self::RDC_USER,
            'password'      => self::RDC_PASS,
        ]);

did you try to use the bitcoin-qt rpc-port:
       'port'          => 8332,
jr. member
Activity: 98
Merit: 3
August 16, 2019, 11:51:29 AM
#8
I have inserted that sattings to my bitcoin.conf, but still can't connect to it  Undecided Undecided Undecided
jr. member
Activity: 98
Merit: 3
August 16, 2019, 10:42:18 AM
#7
bitcoin-qt is fine, the same conf used for qt.
Bitcoin-qt is basicly the gui for bitcoind, so thats why it is the same.
Thank you very much I will try and let you know if it's the solution!
legendary
Activity: 2483
Merit: 1482
-> morgen, ist heute, schon gestern <-
August 16, 2019, 10:00:09 AM
#6
bitcoin-qt is fine, the same conf used for qt.
Bitcoin-qt is basicly the gui for bitcoind, so thats why it is the same.
jr. member
Activity: 98
Merit: 3
August 16, 2019, 09:52:18 AM
#5
no, with core 18.0.0 it changes, so you must use rpcbind.
You can read the core change log for rpcbind.

The same applied to 'Solo Miner', as the miner can't get work from bitcoind if the rpcbind is not set.

Is it neccessary to run bitcoind deamon, or it is ok if the bitcoin-qt is running?
legendary
Activity: 2483
Merit: 1482
-> morgen, ist heute, schon gestern <-
August 16, 2019, 09:43:39 AM
#4
no, with core 18.0.0 it changes, so you must use rpcbind.
You can read the core change log for rpcbind.

The same applied to 'Solo Miner', as the miner can't get work from bitcoind if the rpcbind is not set.
jr. member
Activity: 98
Merit: 3
August 16, 2019, 09:38:34 AM
#3
rpcallowip=xxx.xxx.xxx.0/24 (your local Network)
rpcbind=IP of the PC wich is running core /bitcoin-qt

isn't the rpcallowip the same as rpcbind?
legendary
Activity: 2483
Merit: 1482
-> morgen, ist heute, schon gestern <-
August 16, 2019, 09:08:46 AM
#2
If you where using core 0.18.1 you should add also this in your bitcoin.conf:

rpcallowip=xxx.xxx.xxx.0/24 (your local Network)
rpcbind=IP of the PC wich is running core /bitcoin-qt

with that it should work.

Consider using rpcauth in the future.
jr. member
Activity: 98
Merit: 3
August 16, 2019, 05:33:02 AM
#1
Hi there!
I'm searching in the google for more than one week and no result.

I have a Bitcoin Core Wallet in some Hosting ( for example it is:  123.321.256.632 )
There is an laravel programmed project in other hosting ( for example it is:  127.0.0.12 ) which is going to make payment processes.
I have installed Fully unit-tested Bitcoin JSON-RPC client based on GuzzleHttp. ( here is the link to github: https://github.com/denpamusic/php-bitcoinrpc);

In the Bitcoin server I have
1. started bitcoin-qt,
2. set config file ( rpc ) in both places (C:\Users\MyUserName\AppData\Roaming\Bitcoin\bitcoin.conf) and (D:\BlockChain\bitcoin.conf)
    # Generated by https://jlopp.github.io/bitcoin-core-config-generator/

   # This config should be placed in following path:
   # %UserProfile%\AppData\Roaming\Bitcoin\bitcoin.conf

   # [network]
   # Listen for incoming connections on non-default port.
   port=8333

   # [rpc]
   # Listen for JSON-RPC connections on this port
   rpcport=8332

   # [Sections]
   # Most options automatically apply to mainnet, testnet, and regtest networks.
   # If you want to confine an option to just one network, you should add it in the relevant section.  
   # EXCEPTIONS: The options addnode, connect, port, bind, rpcport, rpcbind and wallet
   # only apply to mainnet unless they appear in the appropriate section below.

   # Options only for mainnet
   [main]

   # Options only for testnet
   [test]

   # Options only for regtest
   [regtest]


   server=1

   rpcuser=Admin
   rpcpassword=passWordAdmin
   rpcallowip=123.321.256.632
   rpcconnect=127.0.0.1

Then I want to connect to my Bitcoin Core from my laravel project and it says cURL error 52: Empty reply from server (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)
Here is my code to connect with Bitcoin Core

public function btcReplenish(Request $request){

        $bitCoinD = new BitcoinClient([
            'host'          => self::RDC_HOST,
            'port'          => 8333,
            'user'          => self::RDC_USER,
            'password'      => self::RDC_PASS,
        ]);

        $balance = $bitCoinD->wallet('wallet.dat')->getbalance();
        echo $balance->get();        
        die;
    }

Please help me if there is someone who knows how to do that!
Jump to: