简体   繁体   中英

cURL error [0]: Failed to connect to 127.0.0.1 port 8545: Connection refused

I am using laravel package(furqansiddiqui/erc20-php) for erc20 token transfer, But i am getting error when execute the code

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

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

Make sure to run geth by --rpc parameter

geth --rpc

As easier way to connect to Ethereum network, you can use https://infura.io

Infura support mainnet and testnets (rinkeby, ropsten, kovan, goerli), thats good for development.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM