Position: Home page » Blockchain » Blockchain is stored in each node

Blockchain is stored in each node

Publish: 2021-04-27 13:47:40
1. const SHA256 = require(crypto-js/SHA256);< br />class Block{
constructor(index,timestamp,data,previousHash='&# 39;)< br />{
this.index=index;< br />this.timestamp=timestamp;< br />this.data=data;< br />this.previousHash=previousHash;< br />$this.hash=this.calculateHash();< br />}

calculateHash(){
return SHA256(this,index+this.previousHash+this.timestamp+JSON.stringify(this.data)).tostring();< br />}
}
class blockchain{
constructor(){
this.chain=[this.createGenesisBlock()];<
}
/ / create a generated information block
creategenesis block() {
return new block (0, & quot; 01/01/2019",& quot; Genesis block", 0);
/ / the date is the user's data. In fact, it is the hash value obtained by adding several values together. Here, the information is encrypted and the picture is encrypted. Then the data is still stored in the database, but all the data are hash values. To get this data, you must know the hash value of the previous data block. Then, if the hacker needs to crack all the nodes, the hash value is decrypted, Then all the blocks from the first node to the last node can be decrypted to get the real data. So the security of data stored in the blockchain depends on whether the data is encrypted. If the plaintext is not encrypted, then it is not a blockchain
}
/ / get the last block
getlatesblock() {
return this.chain [this.chain. Length-1]
}
/ / create block
addblock (newblock) {
newblock. Previoushash = this. Getlatesblock(). Hash< br />newBlock.hash=newBlock.calculateHash();< br />this.chain.push(newBlock);< br />}
}
2. The information of each block in the blockchain is different, and the generation time and recorded data of each block are different. You can regard the blockchain as a bookkeeping book. Every once in a while, someone will write all the transaction information on the blockchain network to one page of the ledger, page by page, and record all the transactions on the blockchain network in turn according to the time
on the other hand, all nodes (computers in short) participating in the network will store one account book, which is updated in real time. Even if one node fails, the blockchain will not be affected.
3. One is that each node of the blockchain stores complete data according to the block chain structure. Traditional distributed storage generally divides the data into multiple copies according to certain rules
Second, the storage of each node in the blockchain is independent and has the same status, which relies on the consensus mechanism to ensure the consistency of storage, while the traditional distributed storage generally synchronizes data from the central node to other backup nodes
data nodes can be different physical machines or different instances in the cloud
the above is the difference between the blockchain technology of jinwowo network analysis and the traditional distributed storage, for reference.
4. bitcoin blockchain is a bitcoin blockchain? No, the block stores the transaction. In the early stage, you will get a coin if you successfully build a block. In the later stage, you can only get the fees paid by the exchange. A currency is a string of digital signatures. It is a digital signature sent by the last owner to the receiver. Everyone can see who owns the currency from the transaction
does each node have complete blockchain data? You mean a user node? A user node needs to keep the of the block head of the longest workload proof chain, so it knows the data of all the block heads. It can move forward to know all the data on the block chain, but not all of them are saved. A block header is very small, only 80 bytes, which can be saved completely, because the generation of nodes is very slow. Even with the passage of time, the amount is not too large now.
5.

Blockchain technology is not only the basic technology of bitcoin, but also the core and infrastructure of bitcoin. Bitcoin has never had any centralized organization, operation and management. Later, bitcoin technology was abstracted, called blockchain technology, or distributed ledger technology

{rrrrrrr}


extended data:

the disadvantages of blockchain technology applied to digital currency:

first, there is no circulation management organization for "decentralization". In essence, blockchain technology is a distributed database system, its logical structure is one-way linked list, and its design mode is based on P2P network, which determines that there is no unified virtual currency central control system based on blockchain technology

Second, it is difficult to effectively control the quantity supply. Based on blockchain technology, the virtual currency circulation is fixed. According to Fisher Equation, under a certain price level, there is a certain proportion between the total amount of transactions and the amount of nominal money needed in a certain period of time, and the fixed amount of money obviously can not meet the requirements of the growing total price of social goods

Third, it is difficult for "mining mechanism" to create recognized value. Bitcoin itself has no value and no national credit support. Some people think that "by continuously consuming computing power and energy, the value is injected into the virtual currency", but in order to find the hash value that meets the requirements, it is obviously not the most effective choice to spend millions of calculations

Fourthly, procers and early holders are easy to get high seigniorage. Any virtual currency based on blockchain technology is held by a few people in the early stage of development. Take bitcoin, for example. At first, bitcoin was just a proct of a few people's games. In May 2010, the first purchase of bitcoin was $25 pizza purchased by 10000 bitcoin, and the first transaction completed in July of the same year was $0.04/bitcoin

6. Don't be depressed, it must be conditional to get a fixed IP, and then set up your own network through this IP, it will become your biggest trouble, know how to change the IP of the router, the current use is Avalon's 220 mining machine. That's why laomaozi likes mining very much. Don't take it for granted that a meeting will be OK one day, even if water cooling is installed
when the mining machine starts to operate, you need to be extremely careful, register an account of a mining website, and mining is not as simple as you think, and then you need to register
3-1, the machine has problems again. You have to accept it
if it is possible to install water cooling, there should be a relatively cold environment
if you can pull the wire and the wiring board in the balcony, you need to think carefully first. In actual mining, you will obviously feel the importance of temperature for mining, and have the conditions to repair the chip capacitor in the process of water cooling installation! Need to understand the routing, can accept the noise - mining machine noise is very big, it is not suitable
please don't feel indifferent to the above points
if your home is warm, you will set up the network - not just plug in the Internet, but in the workshop. Don't be confused by interests. Hope it can help you? It can be installed conditionally
let's assume two scenarios, first understand these, and then decide whether to join the miners army? Give up if you can't, or sell it as a second-hand machine and download a multibit to store the bitcoin you get
congratulations? Is it possible to set up a network? Yes
at home
3,
in the company< br />1-1
is it warm in that room
I'm a miner. When I make a rumbling sound, there are some things that I can't solve and overcome. You can buy a miner to dig it up. But there's one that doesn't work. The miner's IP is fixed. I think the electricity charge is the whole province, not a big problem. I want to connect the miner to the network for electricity. For example, if you have the conditions to install water cooling, the installation process of water cooling is not as simple as the online tutorial seems. In the environment with low temperature - in addition to being able to power on and off for 24 hours, you have strong hands-on ability - the noise can be controlled to a certain extent by installing water cooling. As for how to dig, it's the simplest thing. It turns out that the mining machinery can't be connected to the Internet
first list the problems you have to face, then you need to figure out how to explain to your family or girlfriend
and if you work hard to move the mining machine to the company, I'll give you a brief list of the practical difficulties you need to face in mining, and hope they don't mind
I can type these words word by word to get a fixed IP address - if you are mining in the company, because from the moment you buy it. Unless you open the window to let the cold air in, do you have the conditions to set up the network, but the strength is bad, the capacitor on the logic board is easy to touch, get fixed IP? Make complaints about.
these real embarrassment is the misfits of miners in the group quietly, tucking away the water, and constantly running the network environment. Digging is 24 hours. We must find out if you have the conditions to do this. You will find that you are so out of tune with the mine. Visit the IP with computer to make some simple settings. To tell you the truth, if you use the graphics card very early, if the miner can't be integrated into your life now, if you find these items, and later use the butterfly machine, but you need to do it yourself, and then make a decision, and you have to succeed at one time, the removal of water cooling will be disastrous: if you buy a miner, then your miner will never be able to achieve the highest computing power it can achieve
2:
if you can stand the noise, you can't set the route. If you are at home:
if your working environment is very quiet? Can tolerate to a certain extent, just received a new 180 ant miner, for example, to have a fixed IP, the noise will exist for 24 hours, but once you lie down or the balcony can open a window, if you are in the company, you only have the choice to turn it off awkwardly, then you must not rush to buy the miner
1. These chip capacitors are very difficult to weld. If you want to set them according to the IP of the miner, you can only move the miner home silently
is it possible to set up the network and set the network to the fixed IP specified on the chassis? If you can't mine, you will face a real loss. We must make it clear that many companies will cut off the network in the middle of the night
1-2, it's useless to find a seller. The capacitor is easy to drop. It's equivalent to putting the outdoor unit of the air conditioner in the room. Once the refrigerant is added, for example, in a low temperature environment, wait to collect the money< br />2-1 If you are a senior blue collar, you want to mine
7. All nodes can be stored in the same way, but the hardware requirements are very high
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