Questions tagged [json-rpc]

json-formatted remote procedure calls to communicate with ethereum clients

Most Ethereum clients (nodes) provide an RPC (remote procedure call) interface though which other processes may interact with the node. For example, the eth_getBalance(address, [blockNum]) RPC call returns an address's balance at a given block. Further information and a full specification of the interface is presented here: https://github.com/ethereum/wiki/wiki/JSON-RPC. Use this tag for discussions of Ethereum's RPC features.

651 questions
11
votes
1 answer

Decode JSON RPC result

How do I convert the result returned from a JSON-RPC eth_call from my geth client? This is the call: curl -X POST --data '{"jsonrpc":"2.0","method":"eth_call","params":[{"to":"0x86312d97c0dd3fd9202fdbdec434f36ee1b30720", "data":"0x18160ddd"},…
Jupiter
  • 113
  • 1
  • 5
8
votes
2 answers

JSON RPC API id

I'm reading the JSON RPC API documentation but I cannot understand what is the id that should be specified in the request (and that is also returned in the answer). Is this simply a nonce that indicates that the given reply corresponds to a given…
Briomkez
  • 1,894
  • 1
  • 11
  • 33
4
votes
2 answers

Not enough data error when deploying a smart contract using Python ethereum package

To deploy a contract to the network, we have more than one method, you can choose to use the mist or you can use the rpc interface. I choose the rpc interface in python. I deploy the contract like this: contract_tx =…
Wang
  • 2,416
  • 4
  • 19
  • 28
4
votes
2 answers

Is it possible to obtain GENESIS transactions through RPC API?

When querying the genesis block via the RPC-API (of geth), no transactions are returned by eth_getBlockByNumber. eth_getTransactionByBlockNumberAndIndex similar fails to return any information. I have had a look at how various Ethereum explorers…
fair glu
  • 365
  • 2
  • 8
4
votes
1 answer

code":-32602,"message":"invalid argument 0: hex string has odd length"

Firstly, I wrote a contract with the source below: pragma solidity ^0.4.8; contract HelloWorld { address creator; string greeting; function HelloWorld(string _greeting) public { creator = msg.sender; greeting = _greeting; …
jiebang
  • 993
  • 1
  • 12
  • 18
3
votes
3 answers

Trying to use eth_call to contract function which takes an address as it's argument

I'm trying to call a function on my smart contract that's deployed on the main Ethereum network. The function signature is balanceOf(address). So far I've followed the instructions of doing the SHA3 hash of this so I get: 0x70a08231. Now I want to…
SwimmingG
  • 219
  • 3
  • 10
3
votes
1 answer

contract string parameter

I'm trying to call Smart Contract with next method signature calculateHash(string) and Code like: function calculateHash( string testStr ) constant returns ( bytes32 ){ return sha3( testStr ); } I have next…
3
votes
2 answers

Provided Host header is not whitelisted on curl call

I wanted check if I can connect to a remote server to get some information and send a transaction. First I checked the connection with this : curl -X POST --data '{"jsonrpc":"2.0","method":"eth_syncing","params":[],"id":1}…
wxcvbn
  • 827
  • 1
  • 7
  • 17
2
votes
0 answers

JSON RPC Data Structure

Is there a data structure that contains all the JSON RPC endpoints? Not the wiki, but a JSON or SQL file that I can use to programatically iterate over all the endpoints to generate code.
Count Zero
  • 21
  • 2
2
votes
1 answer

Is there any limitation for the number of threads to service RPC calls?

Bitcoin has the config. How about ethereum? (geth) https://en.bitcoin.it/wiki/Running_Bitcoin -rpcthreads= Set the number of threads to service RPC calls (default: 4)
zono
  • 1,473
  • 5
  • 17
  • 30
2
votes
0 answers

gRPC vs JSON-RPC API?

gRPC is modern high-performance RPC framework. Using gRPC is certainly than the use of JSON RPC for communication between geth nodes and the clients such as web3. Is gRPC is part of the Ethereum roadmap?
Nathan Aw
  • 1,954
  • 12
  • 27
1
vote
1 answer

Retrieving the default token symbol of an Ethereum network via json-rpc

How can I retrieve the default token symbol of an Ethereum network via json-rpc? Ethereum would return "ETH" Ethereum classic would return "ETC"
S-K'
  • 113
  • 4
1
vote
1 answer

how can i translate JSON RPC API for curl into a http://..... address

I have access to a private chain Ethereum node that is accessible via http https://sustainability-chain.info (e.g. i can access it with metamask using special RPC and networkid 20030117 Based on…
Hans-Ueli M.
  • 63
  • 1
  • 7
1
vote
1 answer

What is the JSON-RPC method to call a contract's function?

I'm trying to figure out what exactly happens when a function of a smart contract gets called. Since all client communication is done through JSON-RPC I'm looking at their wiki to find which JSON-RPC function is called when you call a smart contract…
mesqueeb
  • 555
  • 8
  • 21
1
vote
1 answer

what is the 'QUANTITY|TAG' for in eth_call

How does that parameter affect eth_call? From the doc, this should specify a block? Does that mean it is as if the transaction were in the block?
FunkyBaby
  • 121
  • 2
1
2