dev-master
9999999-devA Counterparty send transaction follower.
MIT
The Requires
- php >=5.4.0
- psr/log ~1
- ext-pdo *
- utipd/xcpd-client dev-master
The Development Requires
by Devon Weller
bitcoin transaction counterparty
Wallogit.com
2017 © Pedro Peláez
A Counterparty send transaction follower.
The CounterpartyFollower component for UTipdMe., (*1)
A Counterparty send transaction follower. This is a standalone component of UTipdMe., (*2)
use Utipd\CounterpartyFollower\Follower; use Utipd\CounterpartyFollower\FollowerSetup; use Utipd\XCPDClient\Client; // create a Counterparty RPC client $xcpd_client = new Client($connection_string, $rpc_user, $rpc_password); // init a mysql database connection $pdo = new \PDO($db_connection_string, $db_user, $db_password); // create the MySQL tables if ($first_time) { $setup = new FollowerSetup($pdo, $db_name='xcpd_blocks'); $stup->InitializeDatabase(); } // build the follower and start at a recent block $follower = new Follower($xcpd_client, $pdo); $follower->setGenesisBlock(313500); // setup the handlers $follower->handleNewSend(function($send_details, $block_id) { echo "\$send_details:\n".json_encode($send_details, 192)."\n"; }); // listen forever while (true) { $follower->processAnyNewBlocks(); sleep(10); }
Orphaned blocks will happen. To handle those, you can use https://github.com/UTipdMe/native-follower, (*4)
BTC or Counterparty Tokens are gratefully accepted at 1LCwHQzrFY9q4h2eX2ApWzUHSqTc5UzHZW, (*5)
A Counterparty send transaction follower.
MIT
bitcoin transaction counterparty