Hot answers tagged

123 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 ...
35 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
29 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/...
taijusanagi's 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 ...
Richard Horrocks's user avatar
17 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; ...
iamdefinitelyahuman's 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 ...
Brad Lucas's user avatar
13 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 ...
joifsi's user avatar
  • 1,019
12 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"); ...
denisgranha's user avatar
12 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 ...
Rob Hitchens's user avatar
  • 54.7k
10 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 (...
Mikhail Vladimirov's user avatar
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-...
Ajay's user avatar
  • 499
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:...
Atrophy's user avatar
  • 86
7 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....
Paul Razvan Berg's user avatar
7 votes

Clique: Genesis File

Use something like this: { "config": { "chainId": <yourChainId>, "homesteadBlock": 0, "eip150Block": 0, "eip155Block": 0, "eip158Block": 0, "...
Gerhard's user avatar
  • 231
7 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 ...
Nulik's user avatar
  • 4,021
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 ...
Archi's user avatar
  • 370
6 votes
Accepted

What is the meaning of Ethereum mainnet genesis block extradata value?

From the Ethereum Blog post Final Steps Block #1028201 is formed on the Ethereum tesnet, and is given a hash. The hash is used by users around the world as a unique parameter to the Genesis block ...
Ismael's user avatar
  • 31k
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 ...
Aleksandar Aramov's 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 ...
Tjaden Hess's user avatar
  • 36.7k
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. ...
BinGoBinBin's user avatar
  • 2,161
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
Luiz Soares's user avatar
  • 1,064
5 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 ...
Itération 122442's 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 ...
Daniel Portugal's 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 ...
Alexey Barsuk's 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;
Muhammad Waqas's 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 ...
keorn's 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 ...
BokkyPooBah's user avatar
  • 40.1k
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 ...
Jodiug's user avatar
  • 141
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 ...
galahad's user avatar
  • 3,920
3 votes

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

NETWORK CHAIN ID RPC EXPLORER ARBITRUM (mainnet) 42161 https://arb1.arbitrum.io/rpc https://arbiscan.io/| ARBITRUM (testnet) 421611 https://rinkeby.arbitrum.io/rpc https://rinkeby-explorer.arbitrum....
Prosperity's user avatar

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