Hot answers tagged

112

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 network 1: Classic, the (un)forked public Ethereum Classic PoW main network, chain ID 61 1: Expanse, an alternative Ethereum implementation, chain ID 2 2: Morden ...


25

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 additional way to tell chains apart. Subsequent to EIP-155, ETH has a chainID of 1, while ETC has a chainID of 61 (even though they still have the same networkID of 1)....


24

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 basis. This means // that any network, identified by its genesis block, can have its own // set of configuration options. The available fields and their ...


16

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 in the latest version of geth you need a config section. Add the following and you should be good to go. "config": { }


12

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 have to know the enodeid of the nodes you want to connect to. In case of open Ethereum networks like mainnet or testnet, you have a set of bootnodes hardcoded ...


11

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 large open bounty. It's like a pinata for mathematicians and quantum computers. Hope it helps.


11

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; assembly { id := chainid() } return id; } To use it, ensure you set the compiler's EVM version to Istanbul with the --evm-version istanbul flag. ...


9

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"); console.log("gasLimit: " + block.gasLimit);


8

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-funding, by putting it in the genesis file, now go for the init of datadir. so steps are 1) Creation of account in datadir geth --datadir <...


8

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/units-and-global-variables.html Solidity update PR is here. https://github.com/ethereum/solidity/pull/10557


7

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: Genesis block JSON handling is stricter and safer. Notably, most JSON fields now require the "0x" prefix. (#3794) I found this documentation page: https://...


7

Use something like this: { "config": { "chainId": <yourChainId>, "homesteadBlock": 0, "eip150Block": 0, "eip155Block": 0, "eip158Block": 0, "byzantiumBlock": 0, "clique": { "period": <yourPeriodInSecs>, "epoch": <yourEpochInBlocks> } }, "...


6

Despite the fact that this question has accepted answer, original question does not seem to be answered, so I will add my two cents. How is it different than networkID? Network identifier (networkID) protects a node from connecting to the nodes that are synchronizing with other networks. When connection between two nodes is established, these ...


5

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 MainNetHomesteadBlock = big.NewInt(0) and recompile using the instrutions You can test that Homestead is enabled by compiling this contract: contract TestHomestead{ ...


5

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.Finance.


5

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. The result is func AccumulateRewards(state *state.StateDB, header *types.Header, uncles []*types.Header) { reward := new(big.Int).Set(blockReward) r := ...


5

inside module.exports, add Gas and gasPrice. network_id: "*", // Match any network id gasPrice: 0, gas: 4500000


5

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 anymore. Ethereum's geth has hardcoded the value 1 in the files I told you , so this is why you have these problems. The chain id is now part of transaction as ...


4

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 creating the contract. This code returns the actual code that is stored in the blockchain


4

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 this address and people can use it as proof-of-burn account on the Ethereum blockchain.


4

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 found in the Ethereum Yellowpaper (page 5, top right). There, the nonce is defined as "A 64-bit value (...)". It's actually just any value between 0 and ...


3

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 install it.


3

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


3

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 by default. Have a look here and try using the linked generator.


3

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 unlock the account. Then restart geth and you should see your first account (or coinbase) listed.


3

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 Homestead (which added e.g. the longest-chain rule) and many Ethereum Improvement Proposals (EIP). When the rules change, new transactions and blocks comply to those ...


3

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 blockchain. Not the public ethereum blockchain. Here are some useful links: http://tech.lab.carl.pro/kb/ethereum/testnet_setup http://ethdocs.org/en/latest/network/...


3

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 it for you. In the README of the repository you link to, under the See also section, there's a link to keorn's translation tool, which will convert Geth -> ...


3

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-wide limit of Gas expenditure per block. High in our case to avoid being limited by this threshold during tests. Note: this does not indicate that we should ...


3

I think it's mostly a nomenclature debate. I think the Bitcoin wiki sums it up pretty well (and it's the same case with Ethereum, at least in terms of naming): A genesis block is the first block of a block chain. Modern versions of Bitcoin (or Ethereum) number it as block 0, though very early versions counted it as block 1. The genesis block is almost ...


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