custom-nodes.php 501 B

1234567891011121314151617
  1. <?php
  2. include_once '../vendor/autoload.php';
  3. use IEXBase\TronAPI\Provider\HttpProvider;
  4. use IEXBase\TronAPI\Tron;
  5. $fullNode = new HttpProvider('https://api.trongrid.io');
  6. $solidityNode = new HttpProvider('https://api.trongrid.io');
  7. $eventServer = new HttpProvider('https://api.trongrid.io');
  8. $privateKey = 'private_key';
  9. //Example 1
  10. try {
  11. $tron = new Tron($fullNode, $solidityNode, $eventServer, $privateKey);
  12. } catch (\IEXBase\TronAPI\Exception\TronException $e) {
  13. die($e->getMessage());
  14. }