Post
Topic
Board Bitcoin Technical Support
Merits 3 from 3 users
Topic OP
Help! to connect Bitcoin Core
by
Nshan0102
on 16/08/2019, 10:33:02 UTC
⭐ Merited by OmegaStarScream (1) ,ETFbitcoin (1) ,o_e_l_e_o (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!