Hot answers tagged

99

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


21

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


20

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


15

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.


9

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


8

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);


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

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


6

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


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

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


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

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

There is now a website dedicated to tracking all EVM Networks and their corresponding chain and network ids: chainid.network This is thanks to the Ethereum Lists initiative started by Ligi.


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

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


3

- How is it different than networkID? It is not. chainID is a different name but refers to the same thing. - Is chainID and networkID needed in every block or just the genesis block? This is only in the genesis file, not in blocks. Here is the description of the very first block of the mainnet (yeah, I'm currently syncing in fast mode :D ) > eth....


3

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


3

Block 0 wasn't mined. It was "manually" written by geth. Mining occur only when the process does pass through consensus stage, since block 0 never goes through consensus, nobody gets mining rewards. The processing of the genesis block is special and you can see it in core/genesis.go, the function is DefaultGenesisBlock() Current versions of geth reject ...


3

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


3

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 generation script There's a repo for the script used to generate the genesis block https://github.com/ethereum/genesis_block_generator. From the README Genesis ...


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