Skip to main content
OverflowAI is here! AI power for your Stack Overflow for Teams knowledge community. Learn more
22 votes
Accepted

How can a DApp detect a fork or chain reorganization using web3.js or additional libraries?

Here's code that waits specified number of blocks and verifies the transaction receipt is still valid. If a fork occurs and the replay fails, the receipt check should fail and the callback will call ...
Paul S's user avatar
  • 4,271
7 votes

How to fork my own version of ETH?

You should actually read Building Ethereum Once you have installed a client, you need to download the python script that generates the Genesis file. It’s called ‘mk_genesis_block.py’, and can be ...
niksmac's user avatar
  • 9,673
4 votes
Accepted

Hypothetical: What if ETH miners remove difficulty bomb and continue using PoW?

If all miners removed the difficulty bomb and basically reject the fork (or introduce a new one by removing it) then there would still just be one chain as there is nobody else creating any other ...
SCBuergel's user avatar
  • 8,774
4 votes
Accepted

How can I create a new public blockchain cloned from Ethereum?

If you already know how to create a private Ethereum chain, then you're already most of the way there. The difference between "public" and "private" is basically the process of publicising and ...
Richard Horrocks's user avatar
4 votes

How can a DApp detect a fork or chain reorganization using web3.js or additional libraries?

Currently I don't think there is a way to do that. Currently the docs say to just wait 12 blocks to make sure that a hard fork didn't happen and use getCode(). https://github.com/ethereum/wiki/wiki/...
VoR0220's user avatar
  • 1,710
3 votes
Accepted

Why does a permanent chain split occur only in a Hard Fork?

Your understanding is close but it's not quite right. A soft fork is a change that makes some block, that was previously legal, illegal. A hard fork is a change that makes some block, that was ...
Edmund Edgar's user avatar
  • 16.9k
3 votes
Accepted

What does “⑂ block became a side fork” mean in Geth?

Both mining nodes are competing to create blocks, and mined a block at around the same time. Both blocks are valid, but they are 2 possible realities. They keep mining and one of them finds another ...
Nicolas Bernard's user avatar
3 votes
Accepted

Cold Storage after a Hard Fork?

To the protocol, there's no difference between the various kinds of storage (hot, cold, paper, etc.) All it knows is that a given key corresponds to a given address. So there wouldn't be anything ...
Matthew Schmidt's user avatar
3 votes

How can a DApp detect a fork or chain reorganization using web3.js or additional libraries?

On web3 API, section contract events, it is said that the object given to the callback has a removed field. If you listen for your event and a reorganization occurs, you should be notified by an event ...
nbremond's user avatar
3 votes

How to make my own private blockchain?

So for running you own private chain you basically need to create and configure your genesis.json file and define a networkId when running your blockchain client. For tweaking deeper configs you ...
Daniel Miranda's user avatar
2 votes

How can a DApp detect a fork or chain reorganization using web3.js or additional libraries?

Yes , there is a way to do it: When a fork occurs, the hash of the Block (or State) will change, so all you have to do is to get the hash of the last Block (or State) before you submit a transaction. ...
Nulik's user avatar
  • 4,061
2 votes

Interpreting the messages recieved during synchronisation on geth

Message type 1, from the relevant code: // If we're DAO hard-fork aware, validate any remote peer with regard to the hard-fork if daoBlock := pm.chainconfig.DAOForkBlock; daoBlock != nil { ...
Lee's user avatar
  • 8,558
2 votes
Accepted

"Fork choice rule" : A general term? or a specific algorithm?

A fork choice rule is a general term. For some history I've found, one of the early written descriptions of the term is from March 2017 https://medium.com/@VitalikButerin/minimal-slashing-conditions-...
eth's user avatar
  • 85.9k
2 votes
Accepted

Fork Choice Rule in Ethereum 2.0?

The fork choice rule in Ethereum 2.0 is called LMD GHOST. The basic answer to the question is branch 2: the branch with the most attestations/votes. There are many other details to the fork choice. ...
eth's user avatar
  • 85.9k
2 votes
Accepted

Where can I get a list of blockchain network?

Blockchains are often categorized by the consensus algorithm they use, therefore it is worth taking a look at Blockchain Consensus Encyclopedia. The site contains numerous blockchain projects that are ...
btwiuse's user avatar
  • 176
2 votes

Set Custom ChainId for Hardhat Localhost When Forking Network

By default, hardhat will search for the hardhat configuration in networks. If it is not defined, it will use the default parameters to run the node. networks: { hardhat: { chainId: 7545, }...
Christian Dahdah's user avatar
2 votes
Accepted

web3.py, how to sign transaction with impersonate account of Ganache-Cli

You do not need to have the private key to sign a spoofed transaction. You can use eth_sendTransaction API to send an unsigned transaction Ganache over HTTP. Ganache node does not check the signature ...
Mikko Ohtamaa's user avatar
1 vote

Where can I get a list of blockchain network?

The best sources I know that covers all blockchain would be cryptocurrency prices websites like coingecko. Most EVM compatible chains can be found here
Markus Schick's user avatar
1 vote

Synced version of hardhat fork

For me, HH always runs a few blocks behind on fork for some reason. But you could remain relatively synced (about always 5 blocks behind) by continuously resetting your fork per "Resetting the ...
user1784747's user avatar
1 vote
Accepted

publishing blocks with delay

Good question, what happens when blocks are published with a delay? First, you seem to think that delayed blocks aren't valid anymore which isn't the case. Late received blocks remain valid blocks. ...
upavloff's user avatar
  • 1,110
1 vote
Accepted

Would it be possible to create a fork of Ethereum or Ethereum Classic where only few smart contracts can be deployed after offchain debates(forums..)?

HECO blockchain recently implemented something like this. HECO is an Ethereum fork modified to implement POSA and other features. As far as I know, nodes are probably all controlled by Huobi (CEX). ...
Undead8's user avatar
  • 3,580
1 vote
Accepted

When Eth Classic was forked off, did the people who held Ether suddenly hold an identical sum in two currencies?

The chains were forked at block 1,920,000 so they have in common the previous blocks. At that block existing balances were duplicated in both chains. There were contracts that were deployed in order ...
Ismael's user avatar
  • 30.5k
1 vote

I'm here to run the official Go-Ethereum repo. How can i do that?

If you want to make project from resource install go you need clone go-ethereum make it More details in official documentations: https://geth.ethereum.org/docs/install-and-build/installing-geth#...
foreston's user avatar
  • 366
1 vote
Accepted

How does web3 handle new longest chains?

There are multiple ways to address this using web3 - one using a subscription and the other using getPastEvents() on a contract. Subscription The first - if you want to setup a subscription to ...
Steven V's user avatar
  • 1,471
1 vote

Can we change the Consensus of Ethereum after cloning from github

As long as you are talking about go-ethereum you can indeed choose to run your node with PoW or PoA (Clique) consensus engine just by tweaking genesis.json basically. You can learn more about running ...
Ivan Andrusenko's user avatar
1 vote

Ethereum Smart Contract with Custom Fee and Percentage of the collected Fee Distrusted token holder

The transaction fee is credited to the block miner. The mechanism is part of the consensus rules and cannot be modified by a smart contract. Some contracts implement a separate fee that is paid when ...
Ismael's user avatar
  • 30.5k
1 vote

How can I (efficiently) programatically see if I am on an ETH or ETC chain?

You can pull the block data for block 1920000 using web3. This is the dao fork block so the block hash will be different. ETC is 0x94365e3a8c0b35089c1d1195081fe7489b528a84b22199c916180db8b28ade7f ...
Cody Burns's user avatar
1 vote

How to migrate ethereum based crypto currency to other (possibly own) blockchain?

Usually, you hold some form of a coin swap. A rough way to go about this is as follows. Build a pause functionality into your ERC20 contract, and pause the contract on the swap date Have some method ...
Raghav Sood's user avatar
  • 4,050
1 vote

Prevent other mining softwares to mine my public forked Ethereum chain

The easiest way is to have a list of miners (identified by address) , and only insert blocks from these miners. The list must be signed by you with your private key and downloaded every certain period ...
Nulik's user avatar
  • 4,061
1 vote

I need some clarification about cloning Ethereum

Yes what you need is a genesis file. It is a jason file that is used to initialize the ethereum network. If you want to clone the ethereum blockchain, you must first get the exact genesis file of the ...
Siddhi Kiran Bajracharya's user avatar

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