Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The method eth_sendTransaction does not exist/is not available #1637

Closed
cmaliwal opened this issue May 17, 2018 · 4 comments
Closed

The method eth_sendTransaction does not exist/is not available #1637

cmaliwal opened this issue May 17, 2018 · 4 comments
Assignees
Labels
Needs Clarification Requires additional input
Projects

Comments

@cmaliwal
Copy link

cmaliwal commented May 17, 2018

I am trying to send the args on function from owner account but getting Returned error.

I am using web3 1.0 .

Function in contract :

/**
* @dev Adds single address to whitelist.
* @param trusted Address to be added to the whitelist
*/
function addToWhiteList(address trusted) public onlyOwner {
    require(!whitelist[trusted]);
    whitelist[trusted] = true;

    emit UserWhitelist(true);
}

Code on index.html :

// Add user on whitelist
abc.methods.addToWhiteList("0x9DA80947ACf5Fc16299311EdAabc37fF7d201C95")
.send({ from: "0x61A44075419C4402f6DE631341d875Ece6A3922e" })
.on("receipt", function(receipt) {
  console.log(receipt);
})
.on("error", function(error) {
  console.error(error);
});

ERROR : Returned error: The method eth_sendTransaction does not exist/is not available

Note : I add web3 in script tag :

<script language="javascript" type="text/javascript" src="web3.min.js"></script>

and init. like this

web3 = new Web3(new Web3.providers.WebsocketProvider("wss://ropsten.infura.io/ws"));

Note :

  • Node : v8.10.0
  • NPM : 5.6.0
  • OS : Ubuntu
  • Truffle v4.1.6 (core: 4.1.6)
  • Solidity v0.4.21 (solc-js)
@masterviana
Copy link

Same thing happen with me on version ^1.0.0-beta.34.

Try to call .send method, this is the log :
{ jsonrpc: '2.0', id: 0, error: { code: -32601, message: 'The method eth_sendTransaction does not exist/is not available' } }

@nivida nivida self-assigned this Aug 10, 2018
@nivida nivida added the Needs Clarification Requires additional input label Nov 28, 2018
@nivida nivida added this to To do in 1.0 Nov 28, 2018
@hadarbmdev
Copy link

hadarbmdev commented Dec 16, 2018

I've reproduced the same issue,web3 version: 1.0.0-beta.34, using infura ropsten as external provider.

this is after following the PKEY tip:
https://ethereum.stackexchange.com/questions/26999/invalid-json-rpc-response-error-for-sendtransaction-on-infura-ropsten-node-t

used:

this.web3.eth.accounts.wallet.add(this.pkey)

this.walletOwnerAddress = '0x'+ethUtils.privateToAddress(ethUtils.toBuffer('0x' + this.pkey)).toString('hex')

this.web3.eth.defaultAccount = this.walletOwnerAddress

this.web3.eth.sendTransaction({ to: toAddr, value: this.web3.utils.toWei("0.1", "ether") })

@webkonglong
Copy link

回退web3版本为 0.20.4。 1.0.0-beta.34版本确实有这个问题,拿用户私钥绕过钱包服务端签名也不行 ,会出现 交易哈希,但是区块链查询不到,矿工很久没有被挖矿。

demo地址 https://github.com/LinkIdol/eth-dapp-demo

@OFRBG
Copy link

OFRBG commented Jan 11, 2019

Infura doesn't support sending non-raw transactions. See: https://infura.io/docs/ethereum/json-rpc/eth_sendRawTransaction

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Clarification Requires additional input
Projects
No open projects
1.0
  
Done
Development

No branches or pull requests

6 participants