I'm trying to tune my geth node to get ERC-20 tokens balances, but y API call always returns
{'jsonrpc': '2.0', 'id': 1, 'result': '0x'}
My geth node version:
instance=Geth/v1.9.13-stable-cbc4ac26/windows-amd64/go1.14.2
modules: admin:1.0 debug:1.0 eth:1.0 ethash:1.0 miner:1.0 net:1.0 personal:1.0 rpc:1.0 txpool:1.0 web3:1.0
I have fully synced node (200Gb size)
I've tried to connect my node from MyCrypto wallet. It works well (main balance), but I can't get token balances via my geth node.
Also i've tried to use python pyetherbalance module.
import pyetherbalance
ethbalance = pyetherbalance.PyEtherBalance(infura_url)
balance_omg = ethbalance.get_token_balance('USDT', ethereum_address)
eth_call retruns always {'jsonrpc': '2.0', 'id': 1, 'result': '0x'} if I connecting to my geth node, but it work well with infura node
eth.blockNumber = 10040830
Command line:
geth - -rpc - -rpcapi "db, txpool, ethash, eth,net,web3,personal" - -rpcaddr = "127.0.0.1" - -rpcport = "8545" - -rpccorsdomain = "*"
Api python code:
address = "0x......"
contract_address = "0xdac17f958d2ee523a2206206994597c13d831ec7" # USDT
abi = '0x70a08231000000000000000000000000' + address[2:]
params = [{"to": contract_address, "data": abi}, "latest"]
response = json_rpc_post('eth_call', params, 1)
eth.blockNumber
what does it return? What command line do you use to launch geth? What code do you use to query balances? – Ismael May 10 '20 at 20:35