Hot answers tagged

119 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 ...
31 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 ...
user avatar
24 votes
Accepted

The meaning/specification of "config" in genesis.json

This is the chain configuration field, defined in config.go: // ChainConfig is the core config which determines the blockchain settings. // // ChainConfig is stored in the database on a per block ...
user avatar
17 votes

Retrieve CHAIN_ID of the executing chain from a Solidity contract

chainid is available in native solidity 0.8.0. So you can get chain id like block timestamp or block number. Here is the code. block.chainid; Documentation https://docs.soliditylang.org/en/v0.8.0/...
user avatar
16 votes

getting error on max invalid genesis file: hex string has odd length

I had the same problem and found that the issue was: "extraData": "0x0", If you change it to: "extraData": "0x00", The problem goes away. At this point though you'll have another issue because ...
user avatar
13 votes
Accepted

Retrieve CHAIN_ID of the executing chain from a Solidity contract

As of version 0.5.12, Solidity includes an assembly function chainid() that provides access to the new CHAINID opcode: function getChainID() external view returns (uint256) { uint256 id; ...
user avatar
12 votes

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

For any geth node to join a network there are 2 requirement one is to have the same genesis block and other is to have the same networkid. Once these requirements are satisfied, to join a network you ...
user avatar
  • 989
11 votes
Accepted

How do I get `gasLimit` in web3?

Asking for the last block mined, it will return the gasLimit of the block https://github.com/ethereum/wiki/wiki/JavaScript-API#web3ethgetblock var block = web3.eth.getBlock("latest"); ...
user avatar
11 votes

Who has access to ethereum 0x0000000000000000000000000000000000000000 address?

There is a treasure trove of tokens sent to address(0) to "burn" under the assumption that no one has the private key. and no one ever will. In a manner of speaking, I would classify it as a very ...
user avatar
  • 51.8k
8 votes
Accepted

Fatal: failed to write genesis block: wrong genesis block in database

You cannot do a init again if you have already done a init on datadir. In order to achive what you want you need to first create simply create account .... once account is created use that for pre-...
user avatar
  • 499
8 votes

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

Despite the fact that this question has an accepted answer, the original question does not seem to be answered, so I will add my two cents. How is it different than networkID? Network identifier (...
user avatar
7 votes
Accepted

getting error on max invalid genesis file: hex string has odd length

The same problem happened to me with geth 1.6, with a genesis file similar to yours. Last friday geth updated to 1.6 (https://github.com/ethereum/go-ethereum/releases/tag/v1.6.0). In this release:...
user avatar
  • 86
7 votes

Clique: Genesis File

Use something like this: { "config": { "chainId": <yourChainId>, "homesteadBlock": 0, "eip150Block": 0, "eip155Block": 0, "eip158Block": 0, "...
user avatar
  • 131
6 votes

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

There is a website dedicated to tracking all EVM chains and their corresponding ids: chainlist.org This is thanks to the Ethereum Lists initiative started by Ligi. Now the site is maintained by Yearn....
user avatar
6 votes

Who has access to ethereum 0x0000000000000000000000000000000000000000 address?

The genesis block is a special block which was mined by nobody and therefore is associated with the account 0x0000000000000000000000000000000000000000. It's impossible to generate the private key for ...
user avatar
  • 352
6 votes
Accepted

Geth parameter "networkid" vs. Genesis block "chainId" config?

Network id and Chain id are the same thing You can edit NetworkId in eth/config.go & params/config.go and get rid of this problem forever, you won't need to specify network id on the commandline ...
user avatar
  • 3,426
5 votes

Is it possible to preload contracts in the genesis block?

How did you build yor contract ? If you want to add a contract to genesis block you need to build it with solc --bin-runtime. By default solc and ide like remix build return code that is used for ...
user avatar
5 votes
Accepted

How could I update default homesteadBlock value on my private Ethereum blockchain?

In order to change the Homestead block, you will need to recompile geth from source. You can see the relevant line: MainNetHomesteadBlock = big.NewInt(1150000) Just change this to to ...
user avatar
  • 34.4k
5 votes
Accepted

Disable block mining reward in private testnet

You can change source file consensus to implement. As follows: clone [go-ethereum] source file open consensus/ethash/consensus.go file, then find AccumulateRewards function and annotation tow lines. ...
user avatar
  • 2,121
5 votes
Accepted

Issue in truffle migration with Quorum

inside module.exports, add Gas and gasPrice. network_id: "*", // Match any network id gasPrice: 0, gas: 4500000
user avatar
  • 1,014
4 votes

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

- How is it different than networkID? networkId is for node communication and chainId is used for target chain identification in signature - ETC and ETH chainId is different and networkId is same - Is ...
user avatar
4 votes
Accepted

What algorithm is used to generate nonce hash in genesis file?

There's really no hashing involved in this nonce, the value is arbitrary and the definition "64-bit string hash" is misleading, IMHO. A better definition for nonce in this specific context can be ...
user avatar
3 votes

What geth command options have been depreciated/removed?

You do everything right with init. As far as I understand you updated geth to last release, where hardware wallets support was added. So it requires libusb to be installed in your system. You should ...
user avatar
3 votes

How do I get `gasLimit` in web3?

Here is the exact answer: var block = await web3js.eth.getBlock("latest"); var gasLimit = block.gasLimit/block.transactions.length;
user avatar
3 votes
Accepted

Parity and Geth node as peers

The connection will drop if they are on different chains, you can run Parity with -lsync=trace to see what is going on. It probably has to do with hard fork transitions, Geth does not include them ...
user avatar
  • 56
3 votes
Accepted

Geth --dev mode; define reward account for mining

Shut down geth using Control-C for instance #1 and Control-D for instance #2. Then type geth account new to create a new account. Enter in a passphrase that you will need to remember if you want to ...
user avatar
3 votes

What do the parameters in the Ropsten genesis file mean?

What do the other config values mean? Ethereum has been live for a long time. Over time, patches and improvements are applied to the chain for better stability or more features. This goes for ...
user avatar
  • 131
3 votes
Accepted

genesis.json missing

Since you want to create a private Ethereum network, you need to create your own genesis file with customized parameters suitable for you. This ensures that you're running your version of the ...
user avatar
  • 3,855
3 votes

Genesis block mismatch using a converted geth genesis file with parity

I haven't actually looked through your hand-crafted chainspec... But what I'd suggest, to save time in the long run (and to discourage others from doing it by hand), is to use a translation tool to do ...
user avatar
3 votes

Setting Block Gas Limit in private blockchain?

In private network you can increase block gas limit by using gasLimit parameter in genesis file. "gasLimit": "0x8000000", gasLimit in genesis file: A scalar value equal to the current chain-...
user avatar

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