deemru/wavesreproduce

Waves Reproduce framework

1.0.1 2025-01-22 22:04 UTC

This package is auto-updated.

Last update: 2025-01-22 22:05:22 UTC


README

packagist php-v GitHub license

WavesReproduce is a framework for reproducing transactions logic already applied to a Waves type blockchain.

  • Automatically reconstructs on-chain state
  • Watches multiple addresses
  • Lets you attach custom logic to different transaction types

Installation

composer require deemru/wavesreproduce

Basic usage

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];

Documentaion