Skip to main content
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

What are Ethereum transaction receipts and what are they used for?

Relationship between Transaction Trie and Receipts Trie provides a good summary: Transaction Receipts record the transaction outcome Here is the Structure of a transaction receipt blockHash: ...
eth's user avatar
  • 86.2k
36 votes
Accepted

Is it possible to cancel a transaction?

It can't be canceled, but it can be "out-gassed". You can grab the nonce (can be found on the pending tx on etherscan) and send another transaction with a higher gas price with the same nonce. If you ...
natewelch_'s user avatar
  • 12.2k
22 votes

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

For other operating systems, the default datadir is: Mac: ~/Library/Ethereum Linux: ~/.ethereum Windows: %APPDATA%/Ethereum Delete the chaindata subdirectory that you find. Run geth --fast --cache=...
eth's user avatar
  • 86.2k
22 votes
Accepted

Are gas limit in transaction and block gas limit different?

Yes. Each transaction has a gas limit. For example, there could be 5 unmined transactions where each has a gas limit of 10, 20, 30, 40, 50. The block gas limit determines how many transactions can ...
eth's user avatar
  • 86.2k
20 votes

Storing document/file in blockchain

The 1 MB size limit per Block is for the Bitcoin's blockchain. In Ethereum, there is theoretically no limit for the block size. However, blockchain is not meant for data storage and storing large ...
galahad's user avatar
  • 3,930
20 votes
Accepted

Why does ethereum creates a new block,without even a single transaction?

A benefit of a blockchain is that it is append-only with, in practice, immutable past blocks. These past blocks are immutable because it is very difficult (via proof-of-work) to create a competing ...
Xavier Leprêtre B9lab's user avatar
19 votes
Accepted

Relationship between Transaction Trie and Receipts Trie

Transaction Tries and Transaction Receipt Tries are indeed independent data structures with distinct roots stored on the blockchain header and differ in both purpose and content. Purpose: ...
zanzu's user avatar
  • 5,390
18 votes
Accepted

What is the default ordering of transactions during mining?

Edit: 23 June 2017 - Added Parity details (see below) Geth For the vanilla Geth implementation, the commitNewWork() function in worker.go orders in the following way: //approach 2 transactions := ...
Richard Horrocks's user avatar
17 votes

Is there a limit for transaction size?

As of 12/08/2017, the gas limit as detailed on EthStats.net is 6,700,314. The gas limit was 'stuck' at 4.7 million. It was recommended that miners change their settings such that the gas limit could ...
Thomas Clowes's user avatar
14 votes

Is it possible to cancel a transaction?

While it's not possible to explicitly cancel a transaction, you can invalidate the transaction before it's mined. The way this works is by broadcasting the same transaction using the same nonce, but ...
Miguel Mota's user avatar
  • 5,183
13 votes
Accepted

How can I get the data of the latest 10 blocks via web3.js?

There are a few issues with the accepted answer: as @Lam-Le mentions, .getBlock() and .getBlockNumber() are both asynchronous so if a new block is created during the loop not only will you no longer ...
vilsbole's user avatar
  • 246
12 votes
Accepted

Difficulty and total difficulty

These are explained on the wiki in the JSON RPC README, under the entry for eth_getBlockByHash(). difficulty: QUANTITY - integer of the difficulty for this block. totalDifficulty: QUANTITY - ...
Richard Horrocks's user avatar
11 votes

What does it mean to "seal a block"?

"Seal a block" is a proposed term to describe "mine a block" in a private chain. Private chains typically do not need to use proof-of-work mining, so a different term can be helpful. Specifics of ...
eth's user avatar
  • 86.2k
11 votes
Accepted

Block time and confirmation time

Block time is the expected interval between two blocks. For ethereum, this is around 15 seconds. For Bitcoin, it is 10 minutes. The number of confirmations is simply the number of blocks that have ...
Raghav Sood's user avatar
  • 4,060
10 votes

What is the default ordering of transactions during mining?

To add on the excellent answer by Richard Horrocks: I studied the last 1000 blocks: ~85% of blocks seem to be ordered by High gas price first (respecting nonce order for a single sender address) (The ...
nbarraille's user avatar
10 votes

Why does ethereum creates a new block,without even a single transaction?

On a public chain, it makes perfect sense to keep creating blocks, because a miner will still get the 5 ETH block reward, with or without transactions inside. Thus, geth will continuously mine as long ...
Matthew Schmidt's user avatar
9 votes

Why are there no leading zeroes in ethereum block hash?

What you see in block explorers is the sha3 of the block header, not the ethash.
Yaron Welner's user avatar
9 votes
Accepted

If all nodes execute smart contracts, why do only block creators get the gas fee?

However, only the miner earns the gas associated with the smart contract exectution. Does that mean that all nodes that execute the smart contract after the miner to verify its result do not earn any ...
Edmund Edgar's user avatar
  • 16.9k
9 votes

When are “pending” transactions dropped from the blockchain?

All transactions are kept in the Mempool a term borrowed from Bitcoin. You can see all the current pending transactions here: Pending Transactions There's a limit to the size of the Mempool and once ...
I.B's user avatar
  • 615
9 votes
Accepted

Why are there so many empty blocks?

In short: empty blocks propagate around the network more quickly than blocks that aren't empty. If two mining nodes find the proof-of-work solution to the blocks they're mining at the same time, only ...
Richard Horrocks's user avatar
9 votes

How do I get the latest block using etherscan api?

Even easier: https://api.blockcypher.com/v1/eth/main Blockcypher is a pretty good api for this kind of stuff.
matthewpark319's user avatar
8 votes

Difficulty and total difficulty

As Richard already pointed out, the difficulty is the current quantitative measure how hard it is to brute force ('mine') a block. The total difficulty is the accumulated sum of all blocks difficulty ...
q9f's user avatar
  • 33k
8 votes
Accepted

How to use blockchain as a Database?

The best way to start is to understand the following few concepts and learnings. what is Smart contracts ? What is solidity and how to start writing your domain data or objects in solidity. ...
Abhiram mishra's user avatar
8 votes

Calculate approximative block height at a certain time?

If you just mean a general formula, rather than something written in Solidity... Something along the lines of: last_block_number + ((future_time - time_now) / block_time) Where the future_time and ...
Richard Horrocks's user avatar
8 votes
Accepted

how can i get details of transactions from any block number without using event?

Using web3, you can use the function getBlock. Then, you can read the value of "transactions" (an array) from the object received to calculate the number of transactions and their txids: ...
AdrianClv's user avatar
  • 1,269
8 votes
Accepted

What are the differences (and relationship) between the steps used to (1) validate a transaction and (2) confirm a block?

I can provide a high-level summary that will help things make more sense as you google around for the details. They are separate concerns. Validation is concerned with deciding if the transaction ...
Rob Hitchens's user avatar
  • 55.4k
8 votes

My friend sent me a screenshot of a transaction hash, but when I search for it I find divergent data. What happened?

Your friend simply edited the HTML and changed the TimeStamp, To, and Value on that page. You can tell this because all of the other stats on the page are correct, with the exception of the items ...
Shane Fontaine's user avatar
7 votes
Accepted

What is the exact data structure of each block?

Yes, the Ethereum Yellow Paper (YP) and related Ethereum block architecture. Here are the main pieces of a block and the YP has all the sizes: 4.3. The Block. The block in Ethereum is the ...
eth's user avatar
  • 86.2k
7 votes

Can you (as a node) manually choose what block to bet on in Casper?

Yes and no. There's no way to enforce any given betting strategy in either PoS or PoW. For example, in PoW, there's no way to force miners to never mine on an attacker's chain. So, yes, a validator ...
Matthew Schmidt's user avatar

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