PHP code example of deemru / wavesreproduce

1. Go to this page and download the library: Download deemru/wavesreproduce library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

deemru / wavesreproduce example snippets


use deemru\WavesKit;
use deemru\WavesReproduce;

$wk = new WavesKit;
$address = 'target_waves_address';

$rp = new WavesReproduce( $wk, $address );
$rp->update();

$handlers = [
    // Data transactions (type = 12)
    12 => [
        $address => function( $tx ) {
            // Handle data tx for this address
        }
    ],
    // Invoke transactions (type = 16)
    16 => [
        $address => function( $tx ) {
            // Handle invoke tx for this address
        }
    ],
];

// Replay all transactions of interest from the earliest recorded height
$rp->reproduce( $handlers );

// Access your replicated state
$state = $rp->state[$address];