195

Call A call is a local invocation of a contract function that does not broadcast or publish anything on the blockchain. It is a read-only operation and will not consume any Ether. It simulates what would happen in a transaction, but discards all the state changes when it is done. It is synchronous and the return value of the contract function is returned ...


66

Summary Your original contract code would not work correctly until I added a constant to the function definition to indicate that this function does not modify the blockchain. I had to use the method signature of double(int256) instead of double(int) to get the eth_call JSON-RPC to work. The Details Run Your geth Instance You can use the Testnet ...


55

IPC or Inter-process Communications generally works on your local computers. In the Ethereum space, IPC normally involves geth creating a IPC pipe (which is represented by the file $HOME/.ethereum/geth.ipc) on your computer's local filesystem. Other processes on the same computer can then use the IPC file to create bi-directional communications with geth. ...


47

estimateGas works by pretending the transaction was actually being included in the blockchain, and then returning the exact gas amount that would have been charged if that pretend operation was real. In other words, it uses the exact same procedure a miner would use to calculate the actual fee. Given this approach, a casual observer might think that there ...


39

The difference between in a call and a transaction is the following: transactions are created by your client, signed and broadcasted to the network. They will eventually alter the state of the blockchain, for example, by manipulating balances or values in smart contracts. calls are transactions executed locally on the user's local machine which alone ...


33

(Please edit me. I'm a community wiki) Summary Don't allow TCP request on port 8545 from the Internet to be forwarded to your geth machine Don't enable --rpc without checking that only your GPU mining computers can access TCP port 8545 on your Ethereum node geth computer Don't run the Ethereum Wallet on the same machine as your geth computer. If you need a ...


28

First, a note on safety: You should not make the personal API available over RPC If you are on a local, trusted machine, you should use IPC instead of RPC. Otherwise, anyone who can connect to your node via RPC can try to brute-force your passwords and steal your Ether. All administrative APIs are available by default over IPC, so no need to use any flags ...


28

v, r, s are the values for the transaction's signature. They can be used as in Get public key of any ethereum account A little more information, r and s are outputs of an ECDSA signature, and v is the recovery id. https://bitcoin.stackexchange.com/questions/38351/ecdsa-v-r-s-what-is-v also applies to Ethereum. For replay attack prevention, Ethereum ...


27

ethereumjs-tx is a library with this example: npm install ethereumjs-tx const Tx = require('ethereumjs-tx').Transaction var privateKey = new Buffer('e331b6d69882b4cb4ea581d88e0b604039a3de5967688d3dcffdd2270c0fd109', 'hex') var rawTx = { nonce: '0x00', gasPrice: '0x09184e72a000', gasLimit: '0x2710', to: '0x0000000000000000000000000000000000000000',...


26

You can easily and securely create an SSH tunnel to your ETH Node from the application server. This way, the ETH node is fooled into believing that the connection is from localhost and you can ensure that only the holder of a private key can access. This is a link to instructions on how to setup certificate based authentication It is important to setup ...


23

I will try to anwser your question. I worked on bloom filters in cpp-ethereum and Parity. will retrieving event logs become prohibitively slow as the blockchain becomes larger? Not necessarily. Everything depends on the implementation, logs density (average number of logs / block) and number of cache levels. More specifically, what is the time ...


23

Your comment is correct: use web3.eth.getTransactionCount(accountAddress) Note that the client (Geth) should be in sync with the blockchain. If you don't have a node and want to trust a service, you can try Infura with eth_getTransactionCount.


21

http://localhost:8545 is the RPC port of your locally running Ethereum node software. When running geth, the Go implementation of the Ethereum node software, the command line parameters to create and configure this RPC service follows: user@Kumquat:~$ geth --help | grep rpc --rpc Enable the HTTP-RPC server --rpcaddr "127.0.0.1" ...


19

warning: I do not recommend this By default the node will only accept connections from localhost. You can change this to accept connections from anyone with: --rpcaddr "0.0.0.0". Please note that anytime a private key is unlocked, anyone on the Internet can use this key by querying your rpc server and send transactions.


19

It is quite complicated to get this correct, but here's some information on how to work it out. I'm using a simple contract as an example: pragma solidity ^0.4.2; contract Test { uint256 public v1; string public v2; function Test(uint256 _v1, string _v2) { v1 = _v1; v2 = _v2; } } Here is my deployment to a --dev blockchain ...


18

I assume that you are attempting to connect to a geth node. It might be that this node does not have the personal management API loaded which you could specify while starting geth --rpcapi eth,web3,personal --rpc as described. Please take care, everyone with (local) access to your machine could now mess with your accounts, therefore this is disabled by ...


17

According to the Geth JSON RPC docs The curl options below might return a response where the node complains about the content type, this is because the --data option sets the content type to application/x-www-form-urlencoded . If your node does complain, manually set the header by placing -H "Content-Type: application/json" at the start of the ...


15

If you want to build a explore like etherscan.io, you need to crawl all data in ethereum network and save all txs in the db. There is no direct rpc method to obtain all transactions related to the account.


15

Infura is the most prominent public Ethereum nodes. They run mainnet and many of the testnets. They also run IPFS servers. http://infura.io.


14

We were getting the same error and it turned out that there were two conflicting keyfiles. One in the default (~/.ethereum) and one in a custom location that we had specified using --datadir. In the end it was just a case of cleaning up the scripts we were using to deploy the geth node to make sure that we consistently only used one or the other keystore (...


14

I know the question is old, but I had some problems with this so I will share what helped me. To import the ABI from a JSON file, you can use the following code (assuming you already have your web3 Object): var fs = require('fs'); var jsonFile = "pathToYourJSONFile/project.json"; var parsed= JSON.parse(fs.readFileSync(jsonFile)); var abi = parsed.abi; var ...


13

In Go creating a signed transaction would look something like this: transaction := types.NewTransaction(nonce, recipient, value, gasLimit, gasPrice, input) signature, _ := crypto.Sign(transaction.SigHash().Bytes(), key) signed, _ := tx.WithSignature(signature) where key is a plain *ecdsa.PrivateKey. If you want to use Ethereum encrypted accounts, you could ...


13

To get the REP token balance via JSON-RPC, you will have to use the eth_call method. See How to call a contract method using the eth_call JSON-RPC API for more details on using eth_call. And from augur-core/src/repContract.se , the balanceOf(...) function is defined as: def balanceOf(address: address): return(self.reporting[address]: uint256) And ...


12

When you send a transaction, you will receive back a transaction hash. Use the command getTransactionByHash({transaction hash}) to retrieve the transaction details. Your blockNumber should be non-null if the transaction has been mined and included into a block. The call is documented in https://github.com/ethereum/wiki/wiki/JSON-RPC#...


12

Filters work a little bit different. Filters require LOGs to be emitted from an EVM execution (i.e. a contract). Solidity makes this easy for you by allowing you to fire events (compiled events generate LOGs). Let's take the following contract: contract T { event res(uint indexed out) function echo(uint in) { res(i); } } When the ...


12

0. Read the official security advisory. ethereum blog: [security alert] insecurely configured geth can make funds remotely accessible 1. Never turn on RPC on hot wallets. Even with IP and CORS limited to localhost. Just don't. geth # rpc is disabled by default eth # rpc is disabled by default parity # rpc is ...


12

(Here is the same response as the one I added to the question referenced above) If I start geth using the following command line: Iota:~ user$ geth --rpc console And I try to execute the following curl command: Iota:~ user$ curl localhost:8545 -X POST --header 'Content-type: application/json' --data '{"jsonrpc":"2.0", "method":"debug_traceTransaction", "...


11

RPC over HTTP is inherently unsafe, as any browser tab may access your server. Because of this, any functionality that was deemed unsafe for public consumption is not available by default on the HTTP interface. You have two options: you can either force enable the things you're missing via --rpcapi, just make sure you're clear with the security consequences....


11

As far as I know Mist can only connect to a local instance, and even then only via IPC. The reason is that is uses a few APIs that are not exposed by default over HTTP and would probably be unsafe to do so (e.g. account management).


11

You can use Web3. var Accounts = require('web3-eth-accounts'); // Passing in the eth or web3 package is necessary to allow retrieving chainId, gasPrice and nonce automatically // for accounts.signTransaction(). // var accounts = new Accounts('ws://localhost:8546'); var accounts = new Accounts(); // if nonce, chainId, gas and gasPrice is given it returns ...


Only top voted, non community-wiki answers of a minimum length are eligible