Calling a contract method #6480
Unanswered
cipaterson
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, I just wanted to clarify something if someone can set me right -
This:
https://docs.web3js.org/guides/smart_contracts/deploying_and_interacting_with_smart_contracts#step-7-interact-with-the-smart-contract-using-web3js
shows sending a tx to invoke a contract method:
Which works for my local node but it won't work for a remote provider like Infura or Alchemy - right?
I get an error when executing this against Infura:
InvalidResponseError: Returned error: The method eth_sendTransaction does not exist/is not available
This is because remote providers don't store private keys and so can't sign the Tx for us, we need to sign the tx locally and send with something like this:
Am I right or can web3.js understand that it's not dealing with a local node and can the .send() do the signing for me?
Beta Was this translation helpful? Give feedback.
All reactions