Creation of Ethereum light client
BTC bitcoin
bitcoin is the first distributed digital asset platform created. Since its launch in 2009, it has proven to be not only the most popular, but also the largest market capital value. In addition, it is also the most expensive, with a value of $10710 per coin on February 17, 2018. Bitcoin introces the first blockchain distributed ledger dedicated to recording all transactions, and gets rid of the function that users need a central authority to process or verify transactions
its goal is to provide a platform for users to conct cross-border transactions without any intermediary, which is what we call decentralization. The platform's largest money (BTC) supply is about 21 million. Of this figure, about 16.5 million have been mined and are now in circulation. It is mined all the time around the world to ensure the circulation of coins
Advantages:1. Its distributed system provides users with great freedom
2. High portability
This is a secure networkdisadvantages:
1
2. The user may lose the key
eth Ethereum
Ethereum is also a distributed platform, which was created by Network Programmer vitalik buterin in July 2015. Ethereum aims to enable users to create and deploy smart contracts. One of the main functions of smart contracts is to allow the creation of encrypted assets or tokens running on Ethereum networks. Ethereum token is used to purchase various functions such as cloud storage space. These tokens are stored in a digital wallet compatible with Ethereum blockchain
Ethereum's digital currency ether serves as the medium for executing smart contracts. At present, about 98 million ether coins have been mined and circulated, and the circulation supply increases by about 18 million every year. Ethernet coin is created to run on the Ethereum network. It can be used to compensate the participant nodes or transfer from one user to another
advantages:
1
2
The safety was very highdisadvantages: large circulation
< H2 > extended data:generation principle:
starting from the essence of bitcoin, the essence of bitcoin is actually a special solution generated by a bunch of complex algorithms. A special solution is one of the finite solutions of a system of equations. Every particular solution can solve the equation and is unique
in the metaphor of banknotes, bitcoin is the number of the top word of a banknote. The number of the top word on a banknote owns the banknote. The process of mining is to constantly seek the special solution of the equation system through huge amount of calculation. The equation system is designed to have only 21 million special solutions, so the upper limit of bitcoin is 21 million
to mine bitcoin, you can download the special bitcoin computing tools, register various cooperation websites, fill the registered user name and password into the computing program, and then click the operation to officially start
after completing the installation of bitcoin client, you can directly obtain a bitcoin address. When others pay, you only need to post the address to others, and you can pay through the same client
after installing the bitcoin client, it will assign a private key and a public key. You need to back up the wallet data containing your private key to ensure that your property is not lost. Unfortunately, if the hard disk is completely formatted, personal bitcoin will be completely lost
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
The
Ethereum mining
Berlin hard fork will mark the end of the metropolitan era. This is a key stage in Ethereum's history, which is divided into two stages (Byzantine and Constantinople), including several branches, including Atlantis, Istanbul, and finally reached its peak in Berlin
In practical work, we often encounter the operation of restarting the network card in Linux system. There are three methods as follows:
1, service network restart
< UL >you can use CRT tools to connect to the Linux command line interface; You can also enter the operating system interface, and then select the terminal input:
3, ifconfig eth0 up can be used to start the network card
Ifconfig eth0 down can be used to disable the NIC