Skip to main content

All Questions

Tagged with or
Filter by
Sorted by
Tagged with
96 votes
12 answers
51k views

Common useful JavaScript snippets for geth

In Geth you can loadscript any javascript 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(&...
24 votes
2 answers
8k 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 ...
user17499's user avatar
  • 241
64 votes
7 answers
214k 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 ...
q9f's user avatar
  • 33k
62 votes
5 answers
94k 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?
18 votes
3 answers
3k 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 ...
madhan siva's user avatar
111 votes
4 answers
111k 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 ...
Richard Horrocks's user avatar
28 votes
2 answers
56k 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.
Ramsroyal's user avatar
  • 391
20 votes
2 answers
7k 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" ...
Bill LaPrise's user avatar
60 votes
1 answer
63k 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 ...
Richard Horrocks's user avatar
29 votes
3 answers
22k 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 ...
Toshi's user avatar
  • 2,357
57 votes
4 answers
56k 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 ...
MethDamon's user avatar
  • 803
59 votes
5 answers
49k 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 ...
Igor Barinov's user avatar
  • 2,158
76 votes
2 answers
40k 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: ...
Satoshi Nakanishi's user avatar
56 votes
3 answers
25k 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 ...
BokkyPooBah's user avatar
  • 40.4k
34 votes
6 answers
28k 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 ...
Daniel Mermelstein's user avatar
12 votes
1 answer
6k 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 ...
Henrique Barcelos's user avatar
30 votes
6 answers
13k 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. ...
Subhod I's user avatar
  • 927
15 votes
2 answers
6k 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 ...
BokkyPooBah's user avatar
  • 40.4k
10 votes
2 answers
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 ...
Henrik's user avatar
  • 103
43 votes
3 answers
78k 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?
Wang's user avatar
  • 2,426
13 votes
2 answers
5k 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" + " /// ...
niksmac's user avatar
  • 9,673
38 votes
5 answers
35k 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 ...
Juan Ignacio Pérez Sacristán's user avatar
21 votes
5 answers
13k 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?
Ethan Wilding's user avatar
5 votes
1 answer
2k views

How to setup constantinople fork for private ethereum chain

I am trying to add the constantinople fork to my private net with is running on geth. I have updated to latest geth, geth 1.8.23. I have stopped my current geth node running and have chnged the ...
Manoj Kumar's user avatar
37 votes
4 answers
48k views

What is a chainID in Ethereum, how is it different than NetworkID, and how is it used?

Here it's described in Ethereum's go implementation. type ChainConfig struct { ChainId *big.Int `json:"chainId"` // Chain id identifies the current chain and is used for replay protection A few ...
AlwaysQuestioning's user avatar
23 votes
4 answers
17k 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?
Randomblue's user avatar
  • 2,620
18 votes
1 answer
11k 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 ...
nick101's user avatar
  • 277
11 votes
1 answer
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 ...
yanik's user avatar
  • 473
9 votes
4 answers
11k 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 ...
Wang's user avatar
  • 2,426
41 votes
5 answers
38k 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?
J-B's user avatar
  • 8,971
36 votes
6 answers
76k 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 "...
Dan Sandberg's user avatar
35 votes
5 answers
49k views

Is there a way to find an account's current transaction nonce?

I need to know my transaction nonce because I am doing fancy stuff with contract addresses (which are the keccak hash of my address + my transaction nonce). Is there a way to find this through the ...
Broseph's user avatar
  • 695
29 votes
4 answers
34k 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 ...
Karl Floersch's user avatar
23 votes
5 answers
29k 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 ...
Imroz's user avatar
  • 871
14 votes
1 answer
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?
Randomblue's user avatar
  • 2,620
2 votes
2 answers
2k views

invalid opcode "0x1c" during smart contract method execution

I have written a smart contract to test event from java project using web3j I have prepared the web3j wrapper java class using solc compiler version "0.5.7+commit.6da8b019.Linux.g++" I am using a ...
iOS-Developer84's user avatar
46 votes
3 answers
84k 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): $...
xpnimi's user avatar
  • 723
27 votes
1 answer
32k 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 ...
kostasps's user avatar
  • 373
25 votes
1 answer
7k 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 ...
Pablo Yabo's user avatar
  • 2,743
24 votes
1 answer
9k 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('...
coeniebeyers's user avatar
17 votes
4 answers
34k 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 ...
Gonzo's user avatar
  • 173
13 votes
3 answers
32k 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?
Resten's user avatar
  • 543
28 votes
4 answers
34k 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 ...
FugueWeb's user avatar
  • 457
18 votes
4 answers
9k views

How to schedule a transaction?

Anyone can guide me on how to schedule a transaction to be sent once a specific block number is mined? Thanks
Youssef's user avatar
  • 283
17 votes
2 answers
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 --fast -...
eth's user avatar
  • 86.5k
15 votes
2 answers
6k 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 ...
godimedia's user avatar
  • 253
10 votes
3 answers
13k views

How do I send the entire ether balance from one account to another account?

I'm trying to use web3 to transfer all (or as much as I can) of the balance of an account to another account. Here is the code I have so far: var sender = web3.eth.accounts[0]; var receiver = web3....
Webeng's user avatar
  • 915
9 votes
1 answer
6k 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 ...
Henrique Barcelos's user avatar
8 votes
1 answer
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 ...
Richard Horrocks's user avatar
7 votes
1 answer
2k 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 ...
alper's user avatar
  • 8,404

1
2 3 4 5
16