Position: Home page » Ethereum » Creation of Ethereum light client

Creation of Ethereum light client

Publish: 2021-04-21 09:17:58
1.

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 network

disadvantages:

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 high

disadvantages: 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

2. At the top of Ethereum is DAPP. It exchanges with the smart contract layer through Web3. JS. All smart contracts run on EVM (Ethereum virtual machine) and use RPC calls. Below EVM and RPC are the four core contents of Ethereum, including: blockchain, consensus algorithm, mining and network layer. Except DAPP, all other parts are in the Ethereum client. The most popular Ethereum client is geth (go Ethereum)
3. 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
4. Ethereum is not a scam, but there are countless scams designed by criminals around Ethereum. The best way to avoid Ethereum scams is not to trust the guaranteed return on investment and manage your own money bag. Choose a formal digital currency exchange to invest. At present, the mainstream digital currency transactions in the market are all coin security, fire coin network, bitnet, etc.
5. Generally speaking, undefined index is the exact writing problem in the process of writing. Notice generally prompts for errors that are not directly related to the execution of code, but don't forget that notice sometimes returns some rendant error information
6.

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

7.

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:

  • < / UL >

    3, ifconfig eth0 up can be used to start the network card

    Ifconfig eth0 down can be used to disable the NIC

    8. Domestic or foreign? Metamask is popular in foreign countries, clevergo is recommended in China
    9. Oh, 50 years!,?.! Yuan people can be very strong ah ah ah ah ah ah ah ah ah ah ah ah ah ah ah ah ah ah ah ah ah ah ah ah ah ah ah ah ah ah ah ah ah ah ah ah ah ah ah ah ah ah ah ah ah ah ah ah ah ah ah ah ah ah ah ah ah ah ah ah ah ah ah ah ah ah ah ah ah ah ah ah ah ah ah ah ah ah ah ah ah ah ah
    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