JSON-RPC API
Laatst bewerkt: , Invalid DateTime
In order for a software application to interact with the Ethereum blockchain - either by reading blockchain data or sending transactions to the network - it must connect to an Ethereum node.
For this purpose, every Ethereum client implements a JSON-RPC specification(opens in a new tab), so there is a uniform set of methods that applications can rely on regardless of the specific node or client implementation.
JSON-RPC(opens in a new tab) is a stateless, light-weight remote procedure call (RPC) protocol. It defines several data structures and the rules around their processing. It is transport agnostic in that the concepts can be used within the same process, over sockets, over HTTP, or in many various message passing environments. It uses JSON (RFC 4627) as data format.
Client implementations
Ethereum clients each may utilize different programming languages when implementing the JSON-RPC specification. See individual client documentation for further details related to specific programming languages. We recommend checking the documentation of each client for the latest API support information.
Convenience Libraries
While you may choose to interact directly with Ethereum clients via the JSON-RPC API, there are often easier options for dapp developers. Many JavaScript and backend API libraries exist to provide wrappers on top of the JSON-RPC API. With these libraries, developers can write intuitive, one-line methods in the programming language of their choice to initialize JSON-RPC requests (under the hood) that interact with Ethereum.
Consensus client APIs
This page deals mainly with the JSON-RPC API used by Ethereum execution clients. However, consensus clients also have an RPC API that allows users to query information about the node, request Beacon blocks, Beacon state, and other consensus-related information directly from a node. This API is documented on the Beacon API webpage(opens in a new tab).
An internal API is also used for inter-client communication within a node - that is, it enables the consensus client and execution client to swap data. This is called the 'Engine API' and the specs are available on GitHub(opens in a new tab).
Execution client spec
Read the full JSON-RPC API spec on GitHub(opens in a new tab).
Conventions
Hex value encoding
Two key data types get passed over JSON: unformatted byte arrays and quantities. Both are passed with a hex encoding but with different requirements for formatting.
Quantities
When encoding quantities (integers, numbers): encode as hex, prefix with "0x", the most compact representation (slight exception: zero should be represented as "0x0").
Here are some examples:
- 0x41 (65 in decimal)
- 0x400 (1024 in decimal)
- WRONG: 0x (should always have at least one digit - zero is "0x0")
- WRONG: 0x0400 (no leading zeroes allowed)
- WRONG: ff (must be prefixed 0x)
Unformatted data
When encoding unformatted data (byte arrays, account addresses, hashes, bytecode arrays): encode as hex, prefix with "0x", two hex digits per byte.
Here are some examples:
- 0x41 (size 1, "A")
- 0x004200 (size 3, "\0B\0")
- 0x (size 0, "")
- WRONG: 0xf0f0f (must be even number of digits)
- WRONG: 004200 (must be prefixed 0x)
The default block parameter
The following methods have an extra default block parameter:
When requests are made that act on the state of Ethereum, the last default block parameter determines the height of the block.
The following options are possible for the defaultBlock parameter:
HEX String
- an integer block numberString "earliest"
for the earliest/genesis blockString "latest"
- for the latest mined blockString "safe"
- for the latest safe head blockString "finalized"
- for the latest finalized blockString "pending"
- for the pending state/transactions
Examples
On this page we provide examples of how to use individual JSON_RPC API endpoints using the command line tool, curl(opens in a new tab). These individual endpoint examples are found below in the Curl examples section. Further down the page, we also provide an end-to-end example for compiling and deploying a smart contract using a Geth node, the JSON_RPC API and curl.
Curl examples
Examples of using the JSON_RPC API by making curl(opens in a new tab) requests to an Ethereum node are provided below. Each example includes a description of the specific endpoint, its parameters, return type, and a worked example of how it should be used.
The curl requests might return an error message relating to the content type. This is because the --data
option sets the content type to application/x-www-form-urlencoded
. If your node does complain about this, manually set the header by placing -H "Content-Type: application/json"
at the start of the call. The examples also do not include the URL/IP & port combination which must be the last argument given to curl (e.g. 127.0.0.1:8545
). A complete curl request including these additional data takes the following form:
1curl -H "Content-Type: application/json" -X POST --data '{"jsonrpc":"2.0","method":"web3_clientVersion","params":[],"id":67}' 127.0.0.1:85452
Gossip, State, History
A handful of core JSON-RPC methods require data from the Ethereum network, and fall neatly into three main categories: Gossip, State, and History. Use the links in these sections to jump to each method, or use the table of contents to explore the whole list of methods.
Gossip Methods
These methods track the head of the chain. This is how transactions make their way around the network, find their way into blocks, and how clients find out about new blocks.
State Methods
Methods that report the current state of all the data stored. The "state" is like one big shared piece of RAM, and includes account balances, contract data, and gas estimations.
History Methods
Fetches historical records of every block back to genesis. This is like one large append-only file, and includes all block headers, block bodies, uncle blocks, and transaction receipts.
- eth_getBlockTransactionCountByHash
- eth_getBlockTransactionCountByNumber
- eth_getUncleCountByBlockHash
- eth_getUncleCountByBlockNumber
- eth_getBlockByHash
- eth_getBlockByNumber
- eth_getTransactionByHash
- eth_getTransactionByBlockHashAndIndex
- eth_getTransactionByBlockNumberAndIndex
- eth_getTransactionReceipt
- eth_getUncleByBlockHashAndIndex
- eth_getUncleByBlockNumberAndIndex
JSON-RPC API Methods
web3_clientVersion
Returns the current client version.
Parameters
None
Returns
String
- The current client version
Example
1// Request2curl -X POST --data '{"jsonrpc":"2.0","method":"web3_clientVersion","params":[],"id":67}'3// Result4{5 "id":67,6 "jsonrpc":"2.0",7 "result": "Geth/v1.12.1-stable/linux-amd64/go1.19.1"8}9Kopiรซren
web3_sha3
Returns Keccak-256 (not the standardized SHA3-256) of the given data.
Parameters
DATA
- the data to convert into a SHA3 hash
1params: ["0x68656c6c6f20776f726c64"]2Kopiรซren
Returns
DATA
- The SHA3 result of the given string.
Example
1// Request2curl -X POST --data '{"jsonrpc":"2.0","method":"web3_sha3","params":["0x68656c6c6f20776f726c64"],"id":64}'3// Result4{5 "id":64,6 "jsonrpc": "2.0",7 "result": "0x47173285a8d7341e5e972fc677286384f802f8ef42a5ec5f03bbfa254cb01fad"8}9Kopiรซren
net_version
Returns the current network id.
Parameters
None
Returns
String
- The current network id.
The full list of current network IDs is available at chainlist.org(opens in a new tab). Some common ones are:
1
: Ethereum Mainnet5
: Goerli testnet11155111
: Sepolia testnet
Example
1// Request2curl -X POST --data '{"jsonrpc":"2.0","method":"net_version","params":[],"id":67}'3// Result4{5 "id":67,6 "jsonrpc": "2.0",7 "result": "3"8}9Kopiรซren
net_listening
Returns true
if client is actively listening for network connections.
Parameters
None
Returns
Boolean
- true
when listening, otherwise false
.
Example
1// Request2curl -X POST --data '{"jsonrpc":"2.0","method":"net_listening","params":[],"id":67}'3// Result4{5 "id":67,6 "jsonrpc":"2.0",7 "result":true8}9Kopiรซren
net_peerCount
Returns number of peers currently connected to the client.
Parameters
None
Returns
QUANTITY
- integer of the number of connected peers.
Example
1// Request2curl -X POST --data '{"jsonrpc":"2.0","method":"net_peerCount","params":[],"id":74}'3// Result4{5 "id":74,6 "jsonrpc": "2.0",7 "result": "0x2" // 28}9Kopiรซren
eth_protocolVersion
Returns the current Ethereum protocol version. Note that this method is not available in Geth(opens in a new tab).
Parameters
None
Returns
String
- The current Ethereum protocol version
Example
1// Request2curl -X POST --data '{"jsonrpc":"2.0","method":"eth_protocolVersion","params":[],"id":67}'3// Result4{5 "id":67,6 "jsonrpc": "2.0",7 "result": "54"8}9Kopiรซren
eth_syncing
Returns an object with data about the sync status or false
.
Parameters
None
Returns
The precise return data varies between client implementations. All clients return False
when the node is not syncing, and all clients return the following fields.
Object|Boolean
, An object with sync status data or FALSE
, when not syncing:
startingBlock
:QUANTITY
- The block at which the import started (will only be reset, after the sync reached his head)currentBlock
:QUANTITY
- The current block, same as eth_blockNumberhighestBlock
:QUANTITY
- The estimated highest block
However, the individual clients may also provide additional data. For example Geth returns the following:
1{2 "jsonrpc": "2.0",3 "id": 1,4 "result": {5 "currentBlock": "0x3cf522",6 "healedBytecodeBytes": "0x0",7 "healedBytecodes": "0x0",8 "healedTrienodes": "0x0",9 "healingBytecode": "0x0",10 "healingTrienodes": "0x0",11 "highestBlock": "0x3e0e41",12 "startingBlock": "0x3cbed5",13 "syncedAccountBytes": "0x0",14 "syncedAccounts": "0x0",15 "syncedBytecodeBytes": "0x0",16 "syncedBytecodes": "0x0",17 "syncedStorage": "0x0",18 "syncedStorageBytes": "0x0"19 }20}21Toon alleKopiรซren
Whereas Besu returns:
1{2 "jsonrpc": "2.0",3 "id": 51,4 "result": {5 "startingBlock": "0x0",6 "currentBlock": "0x1518",7 "highestBlock": "0x9567a3",8 "pulledStates": "0x203ca",9 "knownStates": "0x200636"10 }11}12Toon alleKopiรซren
Refer to the documentation for your specific client for more details.
Example
1// Request2curl -X POST --data '{"jsonrpc":"2.0","method":"eth_syncing","params":[],"id":1}'3// Result4{5 "id":1,6 "jsonrpc": "2.0",7 "result": {8 startingBlock: '0x384',9 currentBlock: '0x386',10 highestBlock: '0x454'11 }12}13// Or when not syncing14{15 "id":1,16 "jsonrpc": "2.0",17 "result": false18}19Toon alleKopiรซren
eth_coinbase
Returns the client coinbase address.
Parameters
None
Returns
DATA
, 20 bytes - the current coinbase address.
Example
1// Request2curl -X POST --data '{"jsonrpc":"2.0","method":"eth_coinbase","params":[],"id":64}'3// Result4{5 "id":64,6 "jsonrpc": "2.0",7 "result": "0x407d73d8a49eeb85d32cf465507dd71d507100c1"8}9Kopiรซren
eth_chainId
Returns the chain ID used for signing replay-protected transactions.
Parameters
None
Returns
chainId
, hexadecimal value as a string representing the integer of the current chain id.
Example
1// Request2curl -X POST --data '{"jsonrpc":"2.0","method":"eth_chainId","params":[],"id":67}'3// Result4{5 "id":67,6 "jsonrpc": "2.0",7 "result": "0x1"8}9Kopiรซren
eth_mining
Returns true
if client is actively mining new blocks. This can only return true
for proof-of-work networks and may not be available in some clients since The Merge.
Parameters
None
Returns
Boolean
- returns true
of the client is mining, otherwise false
.
Example
1// Request2curl -X POST --data '{"jsonrpc":"2.0","method":"eth_mining","params":[],"id":71}'3//4{5 "id":71,6 "jsonrpc": "2.0",7 "result": true8}9Kopiรซren
eth_hashrate
Returns the number of hashes per second that the node is mining with. This can only return true
for proof-of-work networks and may not be available in some clients since The Merge.
Parameters
None
Returns
QUANTITY
- number of hashes per second.
Example
1// Request2curl -X POST --data '{"jsonrpc":"2.0","method":"eth_hashrate","params":[],"id":71}'3// Result4{5 "id":71,6 "jsonrpc": "2.0",7 "result": "0x38a"8}9Kopiรซren
eth_gasPrice
Returns an estimate of the current price per gas in wei. For example, the Besu client examines the last 100 blocks and returns the median gas unit price by default.
Parameters
None
Returns
QUANTITY
- integer of the current gas price in wei.
Example
1// Request2curl -X POST --data '{"jsonrpc":"2.0","method":"eth_gasPrice","params":[],"id":73}'3// Result4{5 "id":73,6 "jsonrpc": "2.0",7 "result": "0x1dfd14000" // 8049999872 Wei8}9Kopiรซren
eth_accounts
Returns a list of addresses owned by client.
Parameters
None
Returns
Array of DATA
, 20 Bytes - addresses owned by the client.
Example
1// Request2curl -X POST --data '{"jsonrpc":"2.0","method":"eth_accounts","params":[],"id":1}'3// Result4{5 "id":1,6 "jsonrpc": "2.0",7 "result": ["0x407d73d8a49eeb85d32cf465507dd71d507100c1"]8}9Kopiรซren
eth_blockNumber
Returns the number of most recent block.
Parameters
None
Returns
QUANTITY
- integer of the current block number the client is on.
Example
1// Request2curl -X POST --data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":83}'3// Result4{5 "id":83,6 "jsonrpc": "2.0",7 "result": "0x4b7" // 12078}9Kopiรซren
eth_getBalance
Returns the balance of the account of given address.
Parameters
DATA
, 20 Bytes - address to check for balance.QUANTITY|TAG
- integer block number, or the string"latest"
,"earliest"
or"pending"
, see the default block parameter
1params: ["0x407d73d8a49eeb85d32cf465507dd71d507100c1", "latest"]2Kopiรซren
Returns
QUANTITY
- integer of the current balance in wei.
Example
1// Request2curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getBalance","params":["0x407d73d8a49eeb85d32cf465507dd71d507100c1", "latest"],"id":1}'3// Result4{5 "id":1,6 "jsonrpc": "2.0",7 "result": "0x0234c8a3397aab58" // 1589724902343750008}9Kopiรซren
eth_getStorageAt
Returns the value from a storage position at a given address.
Parameters
DATA
, 20 Bytes - address of the storage.QUANTITY
- integer of the position in the storage.QUANTITY|TAG
- integer block number, or the string"latest"
,"earliest"
or"pending"
, see the default block parameter
Returns
DATA
- the value at this storage position.
Example
Calculating the correct position depends on the storage to retrieve. Consider the following contract deployed at 0x295a70b2de5e3953354a6a8344e616ed314d7251
by address 0x391694e7e0b0cce554cb130d723a9d27458f9298
.
1contract Storage {2 uint pos0;3 mapping(address => uint) pos1;4 function Storage() {5 pos0 = 1234;6 pos1[msg.sender] = 5678;7 }8}9
Retrieving the value of pos0 is straight forward:
1curl -X POST --data '{"jsonrpc":"2.0", "method": "eth_getStorageAt", "params": ["0x295a70b2de5e3953354a6a8344e616ed314d7251", "0x0", "latest"], "id": 1}' localhost:85452{"jsonrpc":"2.0","id":1,"result":"0x00000000000000000000000000000000000000000000000000000000000004d2"}3Kopiรซren
Retrieving an element of the map is harder. The position of an element in the map is calculated with:
1keccack(LeftPad32(key, 0), LeftPad32(map position, 0))2Kopiรซren
This means to retrieve the storage on pos1["0x391694e7e0b0cce554cb130d723a9d27458f9298"] we need to calculate the position with:
1keccak(2 decodeHex(3 "000000000000000000000000391694e7e0b0cce554cb130d723a9d27458f9298" +4 "0000000000000000000000000000000000000000000000000000000000000001"5 )6)7Kopiรซren
The geth console which comes with the web3 library can be used to make the calculation:
1> var key = "000000000000000000000000391694e7e0b0cce554cb130d723a9d27458f9298" + "0000000000000000000000000000000000000000000000000000000000000001"2undefined3> web3.sha3(key, {"encoding": "hex"})4"0x6661e9d6d8b923d5bbaab1b96e1dd51ff6ea2a93520fdc9eb75d059238b8c5e9"5Kopiรซren
Now to fetch the storage:
1curl -X POST --data '{"jsonrpc":"2.0", "method": "eth_getStorageAt", "params": ["0x295a70b2de5e3953354a6a8344e616ed314d7251", "0x6661e9d6d8b923d5bbaab1b96e1dd51ff6ea2a93520fdc9eb75d059238b8c5e9", "latest"], "id": 1}' localhost:85452{"jsonrpc":"2.0","id":1,"result":"0x000000000000000000000000000000000000000000000000000000000000162e"}3Kopiรซren
eth_getTransactionCount
Returns the number of transactions sent from an address.
Parameters
DATA
, 20 Bytes - address.QUANTITY|TAG
- integer block number, or the string"latest"
,"earliest"
or"pending"
, see the default block parameter
1params: [2 "0x407d73d8a49eeb85d32cf465507dd71d507100c1",3 "latest", // state at the latest block4]5Kopiรซren
Returns
QUANTITY
- integer of the number of transactions send from this address.
Example
1// Request2curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getTransactionCount","params":["0x407d73d8a49eeb85d32cf465507dd71d507100c1","latest"],"id":1}'3// Result4{5 "id":1,6 "jsonrpc": "2.0",7 "result": "0x1" // 18}9Kopiรซren
eth_getBlockTransactionCountByHash
Returns the number of transactions in a block from a block matching the given block hash.
Parameters
DATA
, 32 Bytes - hash of a block
1params: ["0xb903239f8543d04b5dc1ba6579132b143087c68db1b2168786408fcbce568238"]2Kopiรซren
Returns
QUANTITY
- integer of the number of transactions in this block.
Example
1// Request2curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getBlockTransactionCountByHash","params":["0xb903239f8543d04b5dc1ba6579132b143087c68db1b2168786408fcbce568238"],"id":1}'3// Result4{5 "id":1,6 "jsonrpc": "2.0",7 "result": "0xb" // 118}9Kopiรซren
eth_getBlockTransactionCountByNumber
Returns the number of transactions in a block matching the given block number.
Parameters
QUANTITY|TAG
- integer of a block number, or the string"earliest"
,"latest"
or"pending"
, as in the default block parameter.
1params: [2 "0xe8", // 2323]4Kopiรซren
Returns
QUANTITY
- integer of the number of transactions in this block.
Example
1// Request2curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getBlockTransactionCountByNumber","params":["0xe8"],"id":1}'3// Result4{5 "id":1,6 "jsonrpc": "2.0",7 "result": "0xa" // 108}9Kopiรซren
eth_getUncleCountByBlockHash
Returns the number of uncles in a block from a block matching the given block hash.
Parameters
DATA
, 32 Bytes - hash of a block
1params: ["0xb903239f8543d04b5dc1ba6579132b143087c68db1b2168786408fcbce568238"]2Kopiรซren
Returns
QUANTITY
- integer of the number of uncles in this block.
Example
1// Request2curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getUncleCountByBlockHash","params":["0xb903239f8543d04b5dc1ba6579132b143087c68db1b2168786408fcbce568238"],"id":1}'3// Result4{5 "id":1,6 "jsonrpc": "2.0",7 "result": "0x1" // 18}9Kopiรซren
eth_getUncleCountByBlockNumber
Returns the number of uncles in a block from a block matching the given block number.
Parameters
QUANTITY|TAG
- integer of a block number, or the string "latest", "earliest" or "pending", see the default block parameter
1params: [2 "0xe8", // 2323]4Kopiรซren
Returns
QUANTITY
- integer of the number of uncles in this block.
Example
1// Request2curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getUncleCountByBlockNumber","params":["0xe8"],"id":1}'3// Result4{5 "id":1,6 "jsonrpc": "2.0",7 "result": "0x1" // 18}9Kopiรซren
eth_getCode
Returns code at a given address.
Parameters
DATA
, 20 Bytes - addressQUANTITY|TAG
- integer block number, or the string"latest"
,"earliest"
or"pending"
, see the default block parameter
1params: [2 "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b",3 "0x2", // 24]5Kopiรซren
Returns
DATA
- the code from the given address.
Example
1// Request2curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getCode","params":["0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x2"],"id":1}'3// Result4{5 "id":1,6 "jsonrpc": "2.0",7 "result": "0x600160008035811a818181146012578301005b601b6001356025565b8060005260206000f25b600060078202905091905056"8}9Kopiรซren
eth_sign
The sign method calculates an Ethereum specific signature with: sign(keccak256("\x19Ethereum Signed Message:\n" + len(message) + message)))
.
By adding a prefix to the message makes the calculated signature recognizable as an Ethereum specific signature. This prevents misuse where a malicious dapp can sign arbitrary data (e.g. transaction) and use the signature to impersonate the victim.
Note: the address to sign with must be unlocked.
Parameters
DATA
, 20 Bytes - addressDATA
, N Bytes - message to sign
Returns
DATA
: Signature
Example
1// Request2curl -X POST --data '{"jsonrpc":"2.0","method":"eth_sign","params":["0x9b2055d370f73ec7d8a03e965129118dc8f5bf83", "0xdeadbeaf"],"id":1}'3// Result4{5 "id":1,6 "jsonrpc": "2.0",7 "result": "0xa3f20717a250c2b0b729b7e5becbff67fdaef7e0699da4de7ca5895b02a170a12d887fd3b17bfdce3481f10bea41f45ba9f709d39ce8325427b57afcfc994cee1b"8}9Kopiรซren
eth_signTransaction
Signs a transaction that can be submitted to the network at a later time using with eth_sendRawTransaction.
Parameters
Object
- The transaction object
type
:from
:DATA
, 20 Bytes - The address the transaction is sent from.to
:DATA
, 20 Bytes - (optional when creating new contract) The address the transaction is directed to.gas
:QUANTITY
- (optional, default: 90000) Integer of the gas provided for the transaction execution. It will return unused gas.gasPrice
:QUANTITY
- (optional, default: To-Be-Determined) Integer of the gasPrice used for each paid gas, in Wei.value
:QUANTITY
- (optional) Integer of the value sent with this transaction, in Wei.data
:DATA
- The compiled code of a contract OR the hash of the invoked method signature and encoded parameters.nonce
:QUANTITY
- (optional) Integer of a nonce. This allows to overwrite your own pending transactions that use the same nonce.
Returns
DATA
, The RLP-encoded transaction object signed by the specified account.
Example
1// Request2curl -X POST --data '{"id": 1,"jsonrpc": "2.0","method": "eth_signTransaction","params": [{"data":"0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675","from": "0xb60e8dd61c5d32be8058bb8eb970870f07233155","gas": "0x76c0","gasPrice": "0x9184e72a000","to": "0xd46e8dd67c5d32be8058bb8eb970870f07244567","value": "0x9184e72a"}]}'3// Result4{5 "id": 1,6 "jsonrpc": "2.0",7 "result": "0xa3f20717a250c2b0b729b7e5becbff67fdaef7e0699da4de7ca5895b02a170a12d887fd3b17bfdce3481f10bea41f45ba9f709d39ce8325427b57afcfc994cee1b"8}9Kopiรซren
eth_sendTransaction
Creates new message call transaction or a contract creation, if the data field contains code, and signs it using the account specified in from
.
Parameters
Object
- The transaction object
from
:DATA
, 20 Bytes - The address the transaction is sent from.to
:DATA
, 20 Bytes - (optional when creating new contract) The address the transaction is directed to.gas
:QUANTITY
- (optional, default: 90000) Integer of the gas provided for the transaction execution. It will return unused gas.gasPrice
:QUANTITY
- (optional, default: To-Be-Determined) Integer of the gasPrice used for each paid gas.value
:QUANTITY
- (optional) Integer of the value sent with this transaction.data
:DATA
- The compiled code of a contract OR the hash of the invoked method signature and encoded parameters.nonce
:QUANTITY
- (optional) Integer of a nonce. This allows to overwrite your own pending transactions that use the same nonce.
1params: [2 {3 from: "0xb60e8dd61c5d32be8058bb8eb970870f07233155",4 to: "0xd46e8dd67c5d32be8058bb8eb970870f07244567",5 gas: "0x76c0", // 304006 gasPrice: "0x9184e72a000", // 100000000000007 value: "0x9184e72a", // 24414062508 data: "0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675",9 },10]11Toon alleKopiรซren
Returns
DATA
, 32 Bytes - the transaction hash, or the zero hash if the transaction is not yet available.
Use eth_getTransactionReceipt to get the contract address, after the transaction was mined, when you created a contract.
Example
1// Request2curl -X POST --data '{"jsonrpc":"2.0","method":"eth_sendTransaction","params":[{see above}],"id":1}'3// Result4{5 "id":1,6 "jsonrpc": "2.0",7 "result": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331"8}9Kopiรซren
eth_sendRawTransaction
Creates new message call transaction or a contract creation for signed transactions.
Parameters
DATA
, The signed transaction data.
1params: [2 "0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675",3]4Kopiรซren
Returns
DATA
, 32 Bytes - the transaction hash, or the zero hash if the transaction is not yet available.
Use eth_getTransactionReceipt to get the contract address, after the transaction was mined, when you created a contract.
Example
1// Request2curl -X POST --data '{"jsonrpc":"2.0","method":"eth_sendRawTransaction","params":[{see above}],"id":1}'3// Result4{5 "id":1,6 "jsonrpc": "2.0",7 "result": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331"8}9