Skip to content

Latest commit

 

History

History
47 lines (39 loc) · 941 Bytes

readme.md

File metadata and controls

47 lines (39 loc) · 941 Bytes

Bitcoind PHP simple wrapper

Its a simple library granting access to bitcoind core RPC with simple php methods and auto complete for IDEs

The logic is separated into 3 different departments:

  • Wallet
  • Transactions
  • Blockchain

Usage

Instantiating bitcoin

    require "../vendor/autoload.php";
    
    $bc = new BitcoindClient(
        'foo',          // user name
        'bar',          // password
        'localhost',    // host address
        18333           // rpc port
    );
        
    echo $bc->wallet->getAccountAddress("");
    echo $bc->wallet->getBalance();

Installing Dependencies

Install the packages via composer:

composer install
composer dump-autoload

Spawn bitcoin daemon with docker

docker-compose up -d

look inside docker with

docker exec -it <containerId> sh

Testing

Just run the PHPUnit test suit by:

composer test