Questions tagged [go-ethereum]

Go Ethereum (short: Geth) is a Golang implementation of the Ethereum protocol.

Filter by
Sorted by
Tagged with
80
votes
11answers
30k views

Common useful JavaScript snippets for geth

In geth you can loadscript any .js file. I discovered this one on the wiki which I like a lot: function checkAllBalances() { var i =0; eth.accounts.forEach( function(e){ console.log(" eth....
18
votes
2answers
4k views

Why is my ether balance 0 in geth, even though the sync is nearly complete?

My geth --fast sync is nearly complete, and the balance shows correctly on Etherscan. I was running geth on linux and haven't synced in a while, so I deleted the chaindata and updated the wallet and ...
56
votes
6answers
189k views

How to import a plain private key into geth or Mist?

This is such a basic question, but I can not figure out how to import a plain, unencrypted private key into geth or mist? I tried geth account import 7[......]bla but it seems this command is always ...
50
votes
5answers
76k views

How can I get a geth node to download the blockchain quickly?

I'm running a geth node on slow hardware. At the current rate of progress it could be several days before I can download all the blockchain. Is there a way to get it to synchronise more quickly?
19
votes
2answers
6k views

Deploying the Greeter contract via the geth CLI is not registering in my private blockchain

I am running a local private Ethereum blockchain using: geth --networkid 60098 --genesis CustomGenesis.json --nodiscover --maxpeers 0 --rpc --rpccorsdomain "http://localhost:3000" --datadir "./data" ...
95
votes
2answers
86k views

What is Geth's “fast” sync, and why is it faster?

One of the answers to this question suggested using Geth's --fast flag to help quickly synchronise the block data. How does the flag work, and how does using it speed up the synchronisation? Are we ...
25
votes
2answers
44k views

Why is my node synchronization stuck/extremely slow at block 2,306,843?

Using macOS 10.12.1 with Ethereum Wallet 0.8.7, nodes are connected but Sync doesn't even start. Stuck at block 2,306,843. What can I do? Please keep in mind, I am neither a coder nor a tech geek.
46
votes
1answer
44k views

What is Geth's “light” sync, and why is it so fast?

This question is in a similar vein to the past questions about geth --fast and parity --warp. There was a recent question where the OP wanted to do as little syncing as possible, and one of the ...
26
votes
3answers
16k views

How can I make new account by JSON-RPC?

I'd like to make new account by JSON-RPC.I've checked the wiki of Ethereum, however I could not find out how to do that. I've found call existed accounts, but it isn't what I want. eth_accounts ...
41
votes
3answers
34k views

How to call a contract method using the eth_call JSON-RPC API

Ok, so I'm trying to call a contract method using the methods provided by the Ethereum JSON RPC interface. The JSON RPC is running on an Ubuntu machine. Unfortunately, I can't really get a result back ...
29
votes
6answers
15k views

ecrecover from Geth and web3.eth.sign

I have tried to use ecrecover() to verify the signature of a message. I have looked at lots of references here and elsewhere, like: https://lab-blog.ey.com/2016/12/19/ecrecover/ How does one ...
15
votes
2answers
1k views

How to get values returned by non constant transaction functions?

As per my understanding when I invoke a constant function without a transaction in a contract and if the function returns some result I am able to get it in EthereumJ or Go-Ethereum, But when a ...
55
votes
2answers
28k views

What does each genesis.json parameter mean?

I'm trying to setup genesis.json for my private network. What does each parameter mean and what value can I set in genesis.json? nonce: any data? timestamp: any time? parentHash: any hash? extraData: ...
38
votes
2answers
27k views

How to select a network id or is there a list of network ids?

We're starting a new open network based on the Ethereum protocol. The question is how to allocate a network id for the new network. In Ethereum we have main net, four test networks, classic with test ...
48
votes
3answers
21k views

How to reduce the chances of your Ethereum wallet getting hacked?

Summary The hack that occurred on May 12 2016 to steal 7,218 ethers from Patrick only affects miners where: Incoming RPC connections from the Internet on TCP port 8545 are forwarded to the machine ...
9
votes
2answers
2k views

Unable to define greeterContract in the Greeter tutorial. Breaking change in Solidity 0.4.9!

I was following the Greeter tutorial on Go Ethereum wiki and got stuck on the "var greeterContract = web3.eth.contract(greeterCompiled.greeter.info.abiDefinition)" phase returning TypeError: Cannot ...
12
votes
1answer
4k views

Peer discovery not working on private network

I'm running 3 nodes with the following command: geth --verbosity 4 --autodag --nat any --genesis /opt/blockchain/genesis.json \ --datadir /opt/blockchain/data --networkid 4828 --port 30303 --rpc ...
32
votes
2answers
50k views

how to unlock the account with geth?

when I use the web3 interface to sign on msgs, it tell me that the account should be unlocked, how can I manage this with geth and what exactly does unlocking mean?
13
votes
2answers
4k views

How to load Solidity source file into geth

Is it possible to load Solidity source file .sol file to go-ethereum. I am using the 'loadScript' method by saving a .js file like the following and loads it. source = "contract test {\n" + " /// ...
15
votes
2answers
5k views

How to conditionally send ethers to another account post-hard-fork to protect yourself from replay attacks

The DAO contract was attacked on 17th June 2016 where the attacker drained about USD 50 million worth of ethers using a recursive call vulnerability in The DAO contract code. The attacker drained ...
25
votes
2answers
19k views

How to explore all transactions for a given account?

After beeing able to check account balances, I am looking for a method to list all transactions for a given Ethereum account through json-rpc protocol. I haven't found any method suitable for that on ...
26
votes
6answers
7k views

How to make miner to mine only when there are Pending Transactions?

As of now the geth miner running on my system mines even empty blocks. All i wanted is miner should mine only when there are Transactions to mine, after mining the miner should immediately sleep. ...
23
votes
4answers
16k views

How can I empty the blockchain?

I am trying to do a fast sync using geth --fast but I am getting this message: blockchain not empty, fast sync disabled How can I empty the blockchain to allow for fast sync?
20
votes
5answers
10k views

How do I import my presale wallet?

I purchased ether during the presale. Is there an easy way to import those ether and start using them?
10
votes
1answer
3k views

Can I unlock an account using JSON-RPC?

The only way I can work with ETH is through --rpc mode. Normally I would prefer to use the Python interface. But I found myself in a situation where the RPC is very limited. For example, I can't ...
14
votes
1answer
6k views

Are pending transactions “dropped” and “reinstated”?

I tried a simple transfer of ether between two accounts using geth, but set quite a low gas price (2 gwei). After two hours the transaction was still showing in geth under eth.pendingTransactions - I ...
19
votes
2answers
15k views

How to estimate gas at contract creation/deployment to private ethereum blockchain

What I have done a) When I use web3.eth.estimateGas to estimate the cost of a contract creation constructor with no parameters, the estimate is correct. b) If the contract is already deployed then ...
12
votes
1answer
4k views

Why isn't fast sync the default?

As I understand, fast sync has all the security guarantees of a full sync, but is faster. Is that correct? If so, why isn't fast sync the default?
23
votes
3answers
19k views

How can I expose Geth's RPC server to external connections?

I want to set up a private network of applications which can connect to a single Geth node. What options do I have for exposing the RPC server? I'm running this: geth --rpc --testnet (sometimes I use ...
37
votes
3answers
64k views

How to delete or reset the blockchain in geth? (OSX)

I have a currupt Blockchain and want to hard reset the chain. what do I need to delete in order to start downloading the chain from scratch? I know that there are 2 ethereum folders (I am on OSX): $...
24
votes
1answer
29k views

Geth node starts to sync from the beginning after fast sync

I have synced using the --fast command. Now how should I proceed? I tried stopping it, and then running geth --rpc but it says: Last Header #1311471 Last Block #0 Fast Block #1310224 What should I ...
16
votes
4answers
32k views

My C: drive in my WINDOWS PC is almost full. How can I change both geth and Mist path to relocate my blockchain files?

I read here somewhere that I have to execute geth --datadir "NEW PATH". But this solution: 1) Doesn't work in a permanent way for me (it will actually point geth in that direction but if I after ...
17
votes
1answer
4k views

eth.pendingTransactions vs eth.getBlock('pending').transactions

What is the difference between eth.pendingTransactions and eth.getBlock('pending').transactions? I have noticed that sometimes eth.pendingTransactions have some transactions that eth.getBlock('...
31
votes
5answers
24k views

How can I run go-ethereum as daemon process on Ubuntu?

The Installation Instructions for Ubuntu suggest running geth from the command line, how can I run it as daemon process / service on Ubuntu?
17
votes
1answer
3k views

Instrumenting EVM

I need to get all contract internal transactions. To do it, I'll need to instrument Ethereum EVM. My question is: what I should do to get the transaction details? Right now, I'm looking to the code ...
25
votes
4answers
35k views

Can't send transaction — “Exceeds block gas limit” or “Intrinsic gas too low”

I'm trying to send Ether using geth 1.3.5, like this: eth.sendTransaction({from:eth.accounts[0], to:'0x[ADDRESS_HERE]', value: web3.toWei(5, "ether"), gas:21000}); And I'm getting "Exceeds block gas ...
8
votes
3answers
10k views

Best way to burn ethers and other ethereum tokens?

Is it correct that any ethers or tokens sent to the address 0x0000000000000000000000000000000000000000 will be destroyed? Or what is the best way of burning ethers / tokens?
15
votes
2answers
5k views

Truffle Migrations Account Locked Error with --network command

I have started a private blockchain using the command, geth --networkid 1337 --datadir ~/home/xyz/testnet --ipcpath /home/xyz/.ethereum/geth.ipc --rpc --rpcapi eth,web3 --rpcport 8545 --rpcaddr ...
6
votes
4answers
5k views

How to run two nodes on the same device?

I want to run two separate nodes on my computer but it seems that the two nodes will collide with other. I know some considerations should be taken such as the ports, but anything else should I take ...
15
votes
2answers
6k views

Error: account unlock with HTTP access is forbidden when unlock an account in Geth console

personal.unlockAccount(eth.accounts[0],"") Error: account unlock with HTTP access is forbidden I run Geth in a Docker container and use docker exec -it bootstrap geth --datadir=~/.ethereum/...
8
votes
1answer
5k views

How to unlock accounts programmatically after the node has started?

Is there any way of just unlocking accounts without opening the console with geth? I'm writing some scripts to automate cluster generation and I wish I could just call geth to unlocking some accounts ...
7
votes
1answer
1k views

How to call Library Function from a Contract? => [error] The contract code couldn't be stored, please check your gas amount. undefined

When I compiled following code at "https://ethereum.github.io/browser-solidity/" it gives me two Web3 deploy code for: var libraryContract = web3.eth.contract(...); //Web3 deploy code var ...
16
votes
2answers
10k views

How much faster is it to sync with --jitvm?

geth help has: VIRTUAL MACHINE OPTIONS: --jitvm Enable the JIT VM The impact of --jitvm has been unanswered and I'm looking for answers to these 3 specifically: How much faster is geth ...
8
votes
1answer
2k views

How do I tell whether the Mist/Wallet is “fast” or “full” syncing?

I'm currently installing Mist/Ethereum Wallet from the pre-built binaries. Having the run the ./Ethereum-wallet executable, it's now part-way through syncing the blockchain. It seems to be taking ...
2
votes
1answer
992 views

geth v1.8 unable to download the last 65 blocks for the mainnet

Currently running geth 1.8 on Ubuntu 17.10 on an SSD. Anytime I start geth, it will always sync until it hits the last 65 blocks where it just hangs and looks like it stays stuck at downloading the ...
16
votes
4answers
18k views

Possible to store the blockchain in a different directory?

I'm running geth on Linux within a Chromebook. The blockchain is being stored within ~/.ethereum, along with other important files. Problem is, the storage capacity on my Chromebook is quite limited ...
12
votes
6answers
22k views

Is there a quicker way than geth --fast to download the Ethereum blockchain?

I had the Mist client installed, but it hadn't been updated in a few weeks so I tried renaming the chaindata folder (instead of deleting it) and downloading the blockchain with geth --fast as that is ...
11
votes
5answers
14k views

Invalid JSON RPC response: “” In Browser-Solidity

I'd like to connect private geth node from browser-solidity, however it returned the error Invalid JSON RPC response: "". Please check the following picture for details. Could you tell me how to ...
4
votes
2answers
3k views

How do I print my account balances and TheDAO tokens from geth

Is there a convenient script to print out my account balances and TheDAO tokens from the go-ethereum client geth?
8
votes
3answers
6k views

Convert an eth key to a geth key

I need to convert my eth key to a geth key. eth put the key in %appdata%\roaming\Web3\keys, and I see it as a .json file. If I move that to the %appdata%\roaming\Ethereum\keystore directory, geth ...