How to broadcastTransaction in Tron network PHP

14 Views Asked by At

I use iexbase and nile testnet to test the TRX transfer function of the tron ​​network. My code public function tron_api(){ $fullNode = new \IEXBase\TronAPI\Provider\HttpProvider('https://nile.trongrid.io'); $solidityNode = new \IEXBase\TronAPI\Provider\HttpProvider('https://nile.trongrid.io'); $eventServer = new \IEXBase\TronAPI\Provider\HttpProvider('https://nile.trongrid.io'); try { $tron = new \IEXBase\TronAPI\Tron($fullNode, $solidityNode, $eventServer); } catch (\IEXBase\TronAPI\Exception\TronException $e) { exit($e->getMessage()); } $address = '...'; $tron->setAddress($address);

    $privateKey="...";
    $tron->setPrivateKey($privateKey);

    $output = [
        'sendResult' => $tron->send('...', 1),
    ];
    
    return response()->json($output);
}

but when I run code it respone "code": "SIGERROR", and I dont can broadcast it to tron nile tesnet network.

I want broadcast transfer to tron network

0

There are 0 best solutions below