122 votes
Accepted

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

May be there is a list of network ids? If not, let's create one. Good idea. 0: Olympic, Ethereum public pre-release PoW testnet 1: Frontier, Homestead, Metropolis, the Ethereum public PoW main ...
92 votes
Accepted

What does each genesis.json parameter mean?

Genesis block Explanation mixhash A 256-bit hash which proves, combined with the nonce, that a sufficient amount of computation has been carried out on this block: the Proof-of-Work (PoW). The ...
niksmac's user avatar
  • 9,673
83 votes
Accepted

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

I'll take my shot. Experts, please correct me. "Full" Sync: Gets the block headers, the block bodies, and validates every element from genesis block. Fast Sync: Gets the block headers, the block ...
Herman Junge's user avatar
  • 2,381
74 votes
Accepted

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

There's a lot of detail on this PR on github. Here's a quote: Instead of processing the entire block-chain one link at a time, and replay all transactions that ever happened in history, fast ...
paulmorriss's user avatar
  • 2,559
74 votes

Common useful JavaScript snippets for geth

Script To Find Transactions To/From An Account Usage Find all transaction to/from eth.accounts[0] within the last 1,000 blocks: > getTransactionsByAccount(eth.accounts[0]) Find all transaction ...
71 votes
Accepted

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

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 ...
BokkyPooBah's user avatar
  • 40.3k
64 votes
Accepted

What are ipc and rpc?

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/...
BokkyPooBah's user avatar
  • 40.3k
63 votes

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

Don't forget to use an SSD If you're able to, using an NVMe SSD is even better. If you have limited space on SSD see Can chaindata be split across two (or more) locations? That said, the Ethereum ...
59 votes

How to check my sync status on Geth 1.5.5, Raspberry Pi 3

Continuing to research, need to enter the geth node console to enter special commands. The following works: geth attach Sends user to the geth node console. eth.syncing Produces a result like ...
Arthur D. Howland's user avatar
56 votes
Accepted

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

Paste the key into a text file, save it to disk and use the path to that file with geth account import. Here are some example Windows instructions that might help: Open Notepad Paste key into notepad ...
Taylor Gerring's user avatar
56 votes
Accepted

how to unlock the account with geth?

By default, your accounts in Geth are "locked," which means that you can't send transactions from them. You need to unlock an account in order to send transactions from it through Geth directly or via ...
Zack Coburn's user avatar
56 votes
Accepted

ecrecover from Geth and web3.eth.sign

I was stuck on this issue as well for a very long time. So the solution is: Add this prefix string to your Solidity smart contract. function verify(bytes32 hash, uint8 v, bytes32 r, bytes32 s) ...
Adil Haris's user avatar
49 votes

How to check my sync status on Geth 1.5.5, Raspberry Pi 3

After running your normal geth --fast command you can open a new window and run the "geth attach" command as this will attach you to the javascript interface $ geth attach Then you can use this ...
Christoff X's user avatar
43 votes

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

Yes, this error is about some geth update. See more about it in this merged go-ethereum pull request. Overall, to bypass this protection, If you want to enable unlocking accounts with unsecure http (...
artyppl's user avatar
  • 539
41 votes
Accepted

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

Run as a systemd service Create a file geth.service: [Unit] Description=Ethereum go client [Service] Type=simple ExecStart=geth 2>%h/.ethereum/geth.log [Install] WantedBy=default.target Enable ...
q9f's user avatar
  • 32.9k
41 votes
Accepted

Understanding logs and log blooms

The first topic in the array is the sha3 hash of the hexadecimal representation of the canonical signature of the event. The remaining items in the topics array (there may be up to three) are the ...
Thomas Jay Rush's user avatar
41 votes

How long is the first sync supposed to last?

Do following steps to check the sync state: 1.) open a new geth instance and type in geth attach 2.) now type in eth.syncing This shows you the "currentBlock" and the "highestBlock".
Kevin R.'s user avatar
  • 511
40 votes

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

You can also use geth removedb to remove the blockchain and state databases. geth removedb Remove local database? [y/N] After removing the old databases, run geth --fast --cache=1024 (see answer to ...
guest's user avatar
  • 401
38 votes
Accepted

How to find the date of an Ethereum transaction while parsing it with web3?

web3.eth.getTransaction({txhash}) will contain a blockNumber. Use web3.eth.getBlock to retrieve the block details and you will find the following field: timestamp: Number - the unix timestamp for ...
BokkyPooBah's user avatar
  • 40.3k
36 votes

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

Don't forget to use an SSD If you're able to, using an NVMe SSD is even better. If you have limited space on SSD see Can chaindata be split across two (or more) locations? That said, the Ethereum ...
eth's user avatar
  • 85.6k
36 votes
Accepted

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

You can load this script to your geth console Mine only when there are transactions! var mining_threads = 1 function checkWork() { if (eth.getBlock("pending").transactions.length > 0)...
niksmac's user avatar
  • 9,673
36 votes
Accepted

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

How is it different than networkID? ChainID was introduced in EIP-155 to prevent replay attacks between the main ETH and ETC chains, which both have a networkID of 1. It's basically just an ...
Richard Horrocks's user avatar
35 votes

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

Update Mar 5 2017 The state cleaning was announced by Vitalik Buterin in the tweet State clearing 100% complete dated 23:07 Nov 29 2016. This time corresponds to block 2,718,436. The Clearing ...
BokkyPooBah's user avatar
  • 40.3k
33 votes
Accepted

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

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 ...
eth's user avatar
  • 85.6k
33 votes

Common useful JavaScript snippets for geth

1. Mine only when there are transactions! var mining_threads = 1 function checkWork() { if (eth.getBlock("pending").transactions.length > 0) { if (eth.mining) return; console....
33 votes
Accepted

Geth node starts to sync from the beginning after fast sync

Why Does Fast Sync Restart As stated in Péter Szilágyi's comment above, you will have to wait for --fast syncing to complete, otherwise you will have to restart the process again. The message you ...
BokkyPooBah's user avatar
  • 40.3k
33 votes
Accepted

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

(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 ...
33 votes
Accepted

How to add new Sealer in Geth 1.6 Proof of Authority?

The protocol defines a voting mechanism to dynamically add new signers and remove existing ones. In Geth this can be controlled via the clique.propose(address, authorized) method (clique_propose for ...
Péter Szilágyi's user avatar
32 votes
Accepted

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

For geth, delete $home/Libary/Ethereum/chaindata. That should wipe out the blockchain itself and let you sync from scratch. Also you probably want to do a fast sync afterwards to get back fast-ish on ...
Péter Szilágyi's user avatar
32 votes
Accepted

Instrumenting EVM

To do this, you need to define a VM log collector, which implements StructLogCollector. This function gets called on every step of the VM, and is provided with copies of the memory, stack, and ...
Nick Johnson's user avatar
  • 8,144

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