PHP uses web3 to monitor transactions

PHP uses web3 to monitor transactions

The core is to scan the data of the block and finally process the transaction data

function queryContractTrans(){
    
    
    global $eth  , $contract  ;
    while(1){
    
    
        $data = $eth->queryContractTrans($contract );
        /*if(!empty($data)){
    
    
            $str = var_export($data , true ) ;
            file_put_contents("./trans.log" , $str . "\n"  , FILE_APPEND);
        }*/
        print_r($data);
        echo "success \n";
        sleep(2);
        echo "\n";
    }
}

Guess you like

Origin blog.csdn.net/m0_75007620/article/details/127737960