【问题标题】:cURL error [0]: Failed to connect to 127.0.0.1 port 8545: Connection refusedcURL 错误 [0]:无法连接到 127.0.0.1 端口 8545:连接被拒绝
【发布时间】:2020-08-24 13:39:44
【问题描述】:

我正在使用 laravel 包(furqansiddiqui/erc20-php)进行 erc20 令牌传输,但是执行代码时出现错误

$geth = new EthereumRPC('127.0.0.1', 8545);

    $erc20 = new ERC20($geth);
    $token = $erc20->token("0x05f4a42e251f2d52b8ed15e9fedaacfcef1fad27");
    var_dump($token->name()); // string(7) "Zilliqa"

【问题讨论】:

    标签: php ethereum erc20


    【解决方案1】:

    确保通过--rpc参数运行geth

    geth --rpc
    

    作为连接以太坊网络的更简单方法,您可以使用https://infura.io

    Infura 支持主网和测试网(rinkeby、ropsten、kovan、goerli),这对开发很有好处。

    【讨论】:

      猜你喜欢
      • 2021-11-18
      • 2021-05-23
      • 2017-11-09
      • 2023-03-26
      • 2021-01-27
      • 2016-12-24
      • 2018-08-09
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多