I have a question about reading / calling methods / properties from smart contract, which is 1 year old, via RPC using my own geth node, which is running in snap mode.
My config for running geth:
ExecStart=/usr/bin/geth --syncmode snap --txlookuplimit=0 --http --http.api personal,eth,net,web3,txpool
let net = require("net"); let web3 = new Web3(myNodeUri); let contract = new web3.eth.Contract(abi, address); const name = await contract.methods.name().call(); console.log(name);
This is throwing:
Returned values aren't valid, did it run Out of Gas? You might also see this error if you are not using the correct ABI for the contract you are retrieving data from, requesting data from a block number that does not exist, or querying a node which is not fully synced
I tried to run the above code, by using an infura link and this gives me the result, which i'm looking for. So the above code is correct in terms of: abi, address of contract and syntax.
However, my geth node is fully synced as I'm able to successfully call this with correct results:
const transaction = await web3.eth.getTransaction(address); const receipt = await web3.eth.getTransactionReceipt(address);
Does my geth node, does not have the information to call contract methods? I also tried the code directly on my node by using the
geth.ipc to prevent any RPC issues, but ends in the same out of gas error.
Can someone help me here