PHP Altcoin/Bitcoin Data Explorer
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src simplify the code without else Jun 20, 2016
tests fix Declaration of BlockInfo::getData Sep 7, 2015
.gitignore update gitignore Jan 24, 2016
.travis.yml remove hhvm Sep 12, 2017
CODE_OF_CONDUCT.md Create CODE_OF_CONDUCT.md Sep 5, 2017
CONTRIBUTING.md Create CONTRIBUTING.md Sep 8, 2017
LICENSE Update LICENSE Jan 11, 2018
README.md typofix Dec 21, 2015
composer.json psr-4 Sep 7, 2015
phpunit.xml psr-4 Sep 7, 2015

README.md

Altcoin/Bitcoin Data Explorer

Build Status SensioLabs Insight License Latest Stable Version

PHP Altcoin/Bitcoin data Explorer

This package can get transaction information with Bitcoin protocol.

It can send HTTP requests to a Bitcoin peer server to perform several operations.

Currently it can get transaction details, get peer information, get mining information, get network hashes, get block chains, etc..

Installation

You can install this library by using [Composer]. You can also view more info about this on [Packagist].

Add this to the require section in your composer.json file.

{
    "require": {
        "arzzen/altcoin-bitcoin-explorer": "1.1.*"
    }
}

Usage

Information about network:

# Get information from network 
use BlockExplorer\NetworkInfo;
$network = new NetworkInfo($ip, $port, $username, $password);

# Get information about the wallets network and block chain
$networkInfo = $network->getInfo();
print_r($networkInfo);

# Get data about each connected node
$peerInfo = $network->getPeerInfo();
print_r($peerInfo);

# Get calculated network hash rate for the latest block
$latestHash = $network->getNetworkHashForLatestBlock();
print_r($latestHash);

Information about transactions:

# Fetch transactions information
use BlockExplorer\Transaction;
$transaction = new Transaction($ip, $port, $username, $password);

$transactionInfo = $transaction->getTransaction('51b78168d94ec307e2855697209275d477e05d8647caf29cb9e38fb6a4661145');
print_r($transactionInfo);

Information from block chain:

# Get information from blockchain
use BlockExplorer\BlockChain;
$block = new BlockChain($ip, $port, $username, $password);

$blockInfoFromHash = $block->getBlock('000000000000000007c4695c756bb944cf31f1f20487a32375d9d4c61dfd6349');
print_r($blockInfoFromHash);

$blockInfoFromHeight = $block->getBlockHash('308788');
print_r($blockInfoFromHeight);

Award

Class won "PHP Programming Innovation Award" on phpclasses.org (August 2014). Link.