Building Ethereum private chain under blockchain learning--win10

Source: Internet
Author: User

Building the Ethereum private chain
1, the environment is win10, download the corresponding latest version Ethereum-wallet-win64-0-10-0.zip
Https://github.com/ethereum/mist/releases

2, extract to the specified directory, run Ethereum-wallet initialization data, private chain to build without synchronization

3, initialization of related data, such as the user is: Administrator, then the system generated directory: C:\Users\administror\AppData\Roaming\Ethereum Wallet
C:\Users\heheiscool\AppData\Roaming\Ethereum
Two files

4, find the Geth.exe command, in this C:\Users\administrator\AppData\Roaming\Ethereum wallet\binaries\geth\unpacked directory

5, the configuration of their own creation block is to distinguish the public chain, in the above 4 directory under the new founding block file Genesis.json, the same network node group of the original block must be the same, or can not unicom:

{
"Config": {
"Chainid": 10,
"Homesteadblock": 0,
"Eip155block": 0,
"Eip158block": 0
},
"Alloc": {},
"Coinbase": "0x0000000000000000000000000000000000000000",
"Difficulty": "0x02000000",
"Extradata": "",
"Gaslimit": "0x2fefd8",
"Nonce": "0x0000000000000042",
"Mixhash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"Parenthash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"Timestamp": "0x00"

}

The parameter indicators are as follows:

A .
Mixhashhash that is generated by a portion of the previous block in conjunction with a nonce for mining. This is the initial chunk
Nonce A nonce is a 64-bit random number for mining.
Difficulty The difficulty of setting the current block, if the difficulty is too large, the CPU mining is difficult, here set a small difficulty
Alloc The number of etheric coins used to pre-provision accounts and account numbers, because the private chain mining is easier, so we do not need to pre-set the account of the currency, when needed to create their own.
Coinbase Miner's account, any definition
Timestamp Set the time stamp of the Genesis block
Parenthash The hash value of the previous chunk, because it is a Genesis block, so this value is 0
Extradata Additional information, please fill in, can fill in your personal information
Gaslimit This value sets the total consumption limit for gas, which is used to limit the sum of the transaction information that the block can contain, since we are the private chain, so fill the maximum.

6. Run the command in the 4 directory:

Geth--datadir "C:\Users\administrator\AppData\Roaming\Ethereum\dev" Init Genesis.json

This creates a directory and stores the Genesis chunk data.

Start run private chain, command line input: Geth--identity "Mydev"--datadir "C:\Users\heheiscool\AppData\Roaming\Ethereum\dev"--networkid 1111-- RPC--rpcapi "admin,personal,db,eth,net,web3"--nodiscover--rpccorsdomain "*" Console

The name of the
Identityblockchain, which is used to mark the current network
Init Specify the location of the Genesis block file and create the initial block
DataDir Sets the location of the current blockchain network data storage
Port Network Listening port
Rpc Initiate RPC communication to deploy and debug smart contracts
Rpcapi Sets the client that allows RPC to be connected, typically DB,ETH,NET,WEB3
Networkid Sets the network ID of the current blockchain to distinguish between different networks, which is a number
Console Start command line mode, you can execute commands in Geth

Enter the relevant commands in the console, such as: Personal.newaccount () to create your first wallet account

7, start Ethereum Wallet Wallet, the upper right corner shows "private-net", indicating the success of the private chain start

The account created in 6 is displayed when the wallet is opened

Building Ethereum private chain under blockchain learning--win10

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.