Bitcoin Forum
June 08, 2024, 03:22:26 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: RPC call to Ethereum node  (Read 102 times)
victorkimba17 (OP)
Jr. Member
*
Offline Offline

Activity: 113
Merit: 5


View Profile
April 23, 2019, 04:07:18 AM
 #1

I want to make a call to Ethereum node using JSON RPC method. On the command line, i use the curl command to call eth_sendTransaction:

Quote
curl -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"eth_sendTransaction","params":[{"from":"<from_addr>","to": "<to_addr>","gas": "0x76c0","gasPrice": "0x9184e72a000", "value": "0x0", "data": "0xa9059cbb0000000000000000000000007704169f56d59e0908a4423a943d9ca18e3106b900000 0000000000000000000000000000000000000000000000000000000000a"}], "id":1}' <ethereum_node_ip>:8545

The data field "0xa9059cbb0000000000000000000000007704169f56d59e0908a4423a943d9ca18e3106b900000 0000000000000000000000000000000000000000000000000000000000a"
 is obtained from https://abi.hashex.org/

After issuing the curl command , it got stuck forever.  Do i use the right way to obtain the data field?
victorkimba17 (OP)
Jr. Member
*
Offline Offline

Activity: 113
Merit: 5


View Profile
May 09, 2019, 05:59:49 AM
Merited by Herbert2020 (1)
 #2

I am using parity client. I found out the reason. The from_addr and to_addr field needs to be unlocked using the personal_unlockAccount rpc command.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!