utipd/counterparty-follower

对等方发送交易跟随器。

dev-master 2014-09-04 02:41 UTC

This package is not auto-updated.

Last update: 2024-09-24 02:32:02 UTC


README

UTipdMe 的 CounterpartyFollower 组件。

对等方发送交易跟随器。这是 UTipdMe 的一个独立组件。

Build Status

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);
}

关于孤块

孤块现象可能会发生。要处理这些问题,您可以使用 https://github.com/UTipdMe/native-follower

接受的提示

比特币或对等方代币可以通过 1LCwHQzrFY9q4h2eX2ApWzUHSqTc5UzHZW 获得感谢接受