1

I want to transfer some ether from one account to another. I use curl command in ubuntu, there is my request:

curl -X POST --data '{"jsonrpc":"2.0","method":"eth_sendTransaction","params":[{"from": "0x1AC78935Ac45149C2655c9e475F16923E31a7FEd", "to": "0x777D32127644ca2a37BD0384CF0d881BB3aCbB31", "value": "0x288232983"}],"id":1}' https://ropsten.infura.io/YOUR_TOKEN

But after than returns nothing and transaction doesn't work. Also i tried with eth_call instead of eth_sendTransaction, the same problem. If anyone has this problem,please help. Thanks!

Ismael
  • 30,570
  • 21
  • 53
  • 96
Miller
  • 71
  • 5

1 Answers1

1

Unfortunately eth_sendTransaction is not among the supported methods by Infura.io. You have to create the transaction using for example ethereumjs-tx, and send it using eth_sendRawTransaction which is supported.

Ismael
  • 30,570
  • 21
  • 53
  • 96
  • Now I get error: {"jsonrpc":"2.0","id":1,"error":{"code":-32602,"message":"invalid argument 0: json: cannot unmarshal non-string into Go value of type hexutil.Bytes"}} – Miller Sep 12 '17 at 12:46
  • What was your json request? – Ismael Sep 12 '17 at 13:55
  • curl -X POST --data '{"jsonrpc":"2.0","method":"eth_sendRawTransaction","params":[{"from": "0x1AC78935Ac45149C2655c9e475F16923E31a7FEd", "to": "0x777D32127644ca2a37BD0384CF0d881BB3aCbB31", "value": "0x288232983"}, "mypass"],"id":1}' https://ropsten.infura.io/token – Miller Sep 12 '17 at 14:55
  • sendRawTransaction has a different syntax. – Ismael Sep 12 '17 at 14:58
  • https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_sendrawtransaction. You have to create the signed transaction like this https://ethereum.stackexchange.com/a/3392, and use the result as parameter. – Ismael Sep 12 '17 at 15:04
  • 1
    Try https://www.npmjs.com/package/web3js-raw. It is a wrapper to sendRawTransaction and encapsulates many complexities. – Chim Jan 14 '18 at 18:50