0

i'm using metamask with ropsten. deployed my contract on ropsten using remix. for the backend i used infura to create instance of web3. ew Web3(new Web3.providers.HttpProvider('https://ropsten.infura.io/v3/MY_API_KEY'));

i'm able to get data from blockchain by contract.getDetails(123); but while sending the details i'm getting below error, "The method eth_sendTransaction does not exist/is not available"

2 Answers 2

0

I understand you problem, this is due to API version change between Infura and Web3. Please try to match the version of Web3 API with Infura.

0

Install and use truffle-hdwallet-provider to create a provider using your mnemonic and the infura endpoint. You can then pass this provider while creating instance of Web3:

const HDWalletProvider = require("truffle-hdwallet-provider");

const provider = new HDWalletProvider(
  mnemonic,
  'https://ropsten.infura.io/v3/MY_API_KEY'
);

const web3 = new Web3(provider);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.