Closed alexwale closed 4 years ago
some i not get it, any body can give some solution ?
I used geth
erespond@notebook://home/erespond/Desktop/coba3$ geth --syncmode "light" --rpc --rpcaddr 192.168.100.5 --rpcapi="db,eth,net,web3,personal,web3"
INFO [10-23|03:28:23.684] Dropping default light client cache provided=1024 updated=128
INFO [10-23|03:28:23.685] Maximum peer count ETH=0 LES=10 total=50
INFO [10-23|03:28:23.685] Smartcard socket not found, disabling err="stat /run/pcscd/pcscd.comm: no such file or directory"
INFO [10-23|03:28:23.687] Starting peer-to-peer node instance=Geth/v1.9.6-stable-bd059680/linux-amd64/go1.11.5
INFO [10-23|03:28:23.687] Allocated cache and file handles database=/home/erespond/.ethereum/geth/lightchaindata cache=64.00MiB handles=2048
INFO [10-23|03:28:23.811] Initialised chain configuration config="{ChainID: 1 Homestead: 1150000 DAO: 1920000 DAOSupport: true EIP150: 2463000 EIP155: 2675000 EIP158: 2675000 Byzantium: 4370000 Constantinople: 7280000 Petersburg: 7280000 Istanbul:
and code for php <?php require('vendor/autoload.php');
use EthereumRPC\EthereumRPC; use ERC20\ERC20;
$geth = new EthereumRPC('192.168.100.5', 8545); // $geth = new EthereumRPC('192.168.100.5', 8545); $erc20 = new \ERC20\ERC20($geth);
$token = $erc20->token('0xd26114cd6EE289AccF82350c8d8487fedB8A0C07');
var_dump($token->name()); var_dump($token->symbol()); var_dump($token->decimals()); ?>
result: string(0) "" string(0) "" int(0)
I am not certain but this may have something to do with your node being synced in light mode. This lib is in use in production envs where Geth node is synced in full mode.
hi there, i use those functions ,but get all value was null, i don't why can you help me to fix it ? thanks a lot . here is my result. code: $geth = new EthereumRPC('127.0.0.1', 8545); $erc20 = new \ERC20\ERC20($geth); $token = $erc20->token('0xd26114cd6EE289AccF82350c8d8487fedB8A0C07');
result: string(0) "" string(0) "" int(0)