Position: Home page » Ethereum » Ethereum builds private chain in Linux

Ethereum builds private chain in Linux

Publish: 2021-04-27 19:37:53
1. This needs to be recharged, but we must pay attention to the risk. This chain is not particularly mainstream. It may be the capital disk or counterfeit currency.
2. The first part: build your own blockchain directory from 0 to 1: 1.1 start from imitation, first understand the basis of blockchain 1.2: analysis of consensus mechanism 1.3 design principles and methods of consensus mechanism 1.4 how to quickly clone a blockchain 1.5 how to turn bitcoin into your own private chain - how to turn Ethereum into your own
3. Wait, Ethereum is a public chain. Do you mean the token issued above? You can set the total amount
4.

How to use the Linux system mining, to use the service of the HA Yu miner, only need two steps, you can mine on the Linux system

  1. open the website, input the mobile phone number, select how many CPUs you want to use for mining, the default is to use 50% of the CPU for mining, click to generate your exclusive command and

    1. in two steps, you can mine on Linux system, the money you dig only needs to go to the website of hayu miner, enter your mobile phone number to withdraw< br />

5. Build / env.sh go run build / ci.go install. / CMD / geth
make: * * [geth] error 1
there is no such directory, or the directory has insufficient permissions
6. Yes, but it is better to use overseas servers. In addition, the server configuration should be medium or above.
7. To create a Genesis configuration file:
first, you need to create a "Genesis" JSON configuration file, which describes some parameters of the genesis block. The following is the content of the file:
{
& quot; coinbase": & quot;& quot;,< br />" config": {< br />" homesteadBlock": 5
},
" difficulty": & quot; 0x20000",< br />" extraData": & quot; 0x",< br />" gasLimit": & quot; 0x2FEFD8",< br />" mixhash": & quot;& quot;,< br />" nonce": & quot; 0x0",< br />" parentHash": & quot; 000000000000000000000000",< br />" timestamp": & quot; 0x00",< br />" alloc": {< br />"& quot;:< br />{
" balance":& quot;& quot;
}
}
} 1234567891011213141516171819

the above code into a text file and name it genesis.json

Genesis!:
in order not to conflict with the data of the main chain, it is recommended to establish your own private chain data folder. On my computer, I built an ethdbspace as the Ethereum experimental work area on disk e, and created a privchain folder as the data storage folder of my first private chain
here, in order to facilitate management, I put genesis.json under the ethdbspace folder
open the windows command line

type the following command
geth -- dataDir & quot; E:\ EthDBSpace\ PrivChain" init " E:\ EthDBSpace\ genesis.json" 1

– the dataDir option is used to specify the data directory of our private chain. On my computer, it's E: &; EthDBSpace\ Privchain
init is the genesis command, followed by our Genesis configuration file path
after clicking enter, the execution result is as follows

at this time, genesis is complete
create an account:
in order to do experiments on the private chain, we also need to create our own account on the private chain
windows command line, type
geth -- dataDir & quot; E:\ EthDBSpace\ PrivChain" Console1

we have successfully created the world, so when we enter the client for the second time, we do not need to specify the genesis.json file path again, but directly – dataDir to indicate the private link data path
the console command is used to open the command line of geth
after clicking enter, the client will be initialized for a while. After the command prompt appears, it means that you have entered the geth console

type
personal. Newaccount (& #) in the geth command line; Your Password') 1

the personal.newaccount function is used to create an account, in which the parameter is the account password.
after clicking enter, the account creation address will be listed in green below the command, that is, the public key of the account.
we can check the account balance first, In the geth command line, type:
My = eth. Accounts [0]
eth. Getbalance (my) 12

My = eth. Accounts [0]. The purpose of this sentence is to assign the account address we just created to my variable. This can simplify the subsequent account address input. Among them, eth.accounts records the addresses of all accounts on this machine. Since we created an account for the first time, there is only one account on the computer at present. So here we use eth. Accounts [0] to extract the first account address. The eth.getbalance function is used to obtain the account balance, and the parameters are filled in the account address. The my variable here records the address of the first account

I hope my answer can help you
8. "This is how to learn Linux" is a self-study book focusing on practical Linux system technology. Let's learn it together.
9. In the development process, it is inevitable that many people work and cooperate at the same time, which is more common in embedded development projects. This can speed up the project cycle and take the time to market. At present, the use of Linux as the operating system of development procts is more and more widely used. In order to cross compile and get closest to the development goal, we usually build a Linux development server ourselves. Some common functions of Linux development server must be supported, such as samba, NFS, TFTP, httpd, etc.
10. Hardware solution 1: two computers can establish local area network through one switch
two standard network cables are made according to the distance between two computers. Now generally, 568B is used as the network cable, and both ends of a line are made according to 568B standard. This kind of cable is connected to the computer at one end and the exchange machine at the other. In this way, after the two computers are connected with the switch through the network cable, the hardware connection of the local area network is completed
note here: the length of the network cable from the computer end to the switch should not exceed 80 meters. If the length exceeds 80 meters, the signal will be attenuated, and sometimes the networking may not be successful
hardware scheme 2:
check the interconnection method through a network cable (network card to network card)
two computers do not need a switch or hub, and two ends of a line are directly connected to the computer. The purpose of this line is to facilitate the interconnection of two computers together. One end of this line should be made according to 568a standard, and the other end should be made according to 586B standard This method is suitable for two adjacent computers, and the interconnection network cable should not be too long (there is no standard for this, but according to my practical experience, it is difficult to connect successfully if it is more than 5 meters.)
this method is the most economical
two kinds of wire sequence:
568a standard: white green, green, white orange, blue, white blue, orange, white brown, brown
568B standard: white orange, orange, white green, blue, white blue, green, white brown, brown
no matter through which hardware scheme, after the two computers are connected, the computer should be set up to realize the LAN composed of two computers The software setting of the computer is completely applicable to the above two schemes)
IP address setting of the network card:
to form a LAN, the IP address of the computer in the LAN should be in the same network segment, Here we want to set the IP addresses of the two computers to 192.168.1.2 and 192.168.1.3 respectively (take Windows XP as an example)
setting of local network on the computer side:
taking XP as an example:
Start - > control panel - > network connection - > right click "local connection" and select "properties", Find "Internet Protocol (TCP / IP)" and click "properties"
finally, make sure to complete the setting and exit. A computer only needs to change the IP address: 192.168.1.2 to 192.168.1.3, and other settings are the same
after all the above settings are set, it is necessary to verify whether the two computers are connected through a ping program command
shortcut key: Win + R, call up the running window, enter the following command: Ping 192.168.1.3 - t and press enter or click "OK"
note: the above ping program command is operated on the computer IP address 192.168.1.2, if it is on the computer 192.168.1.3, the ping command should be changed from 192.168.1.3 to 192.168.1.2 If you make a mistake, if you Ping your own computer, it will always be connected, and you will not be able to reflect the connection of the target computer)
the network firewall of the two computers will be closed, and the network firewall will intercept the data sent by the ping command
so far, the two computers have successfully formed a LAN. Computers in the same LAN can realize many functions, such as sharing folder, sharing printer, LAN game and so on.
Hot content
Inn digger Publish: 2021-05-29 20:04:36 Views: 341
Purchase of virtual currency in trust contract dispute Publish: 2021-05-29 20:04:33 Views: 942
Blockchain trust machine Publish: 2021-05-29 20:04:26 Views: 720
Brief introduction of ant mine Publish: 2021-05-29 20:04:25 Views: 848
Will digital currency open in November Publish: 2021-05-29 19:56:16 Views: 861
Global digital currency asset exchange Publish: 2021-05-29 19:54:29 Views: 603
Mining chip machine S11 Publish: 2021-05-29 19:54:26 Views: 945
Ethereum algorithm Sha3 Publish: 2021-05-29 19:52:40 Views: 643
Talking about blockchain is not reliable Publish: 2021-05-29 19:52:26 Views: 754
Mining machine node query Publish: 2021-05-29 19:36:37 Views: 750