5. Network
The steps to run the network are as follows:
運(yùn)行該網(wǎng)絡(luò)的步驟如下:
1) New transactions are broadcast to all nodes.
新的交易向全網(wǎng)進(jìn)行廣播;
2) Each node collects new transactions into a block.
每一個(gè)節(jié)點(diǎn)都將收到的交易信息納入一個(gè)區(qū)塊中;
3) Each node works on finding a difficult proof-of-work for its block.
每個(gè)節(jié)點(diǎn)都嘗試在自己的區(qū)塊中找到一個(gè)具有足夠難度的工作量證明漂辐;
4) When a node finds a proof-of-work, it broadcasts the block to all nodes.
當(dāng)一個(gè)節(jié)點(diǎn)找到了一個(gè)工作量證明鼓择,它就向全網(wǎng)進(jìn)行廣播;
5) Nodes accept the block only if all transactions in it are valid and not already spent.
當(dāng)且僅當(dāng)包含在該區(qū)塊中的所有交易都是有效的且之前未存在過的摆霉,其他節(jié)點(diǎn)才認(rèn)同該區(qū)塊的有效性;
6) Nodes express their acceptance of the block by working on creating the next block in the chain, using the hash of the accepted block as the previous hash.
其他節(jié)點(diǎn)表示他們接受該區(qū)塊,而表示接受的方法蹬敲,則是在跟隨該區(qū)塊的末尾,制造新的區(qū)塊以延長該鏈條莺戒,而將被接受區(qū)塊的隨機(jī)散列值視為先于新區(qū)快的隨機(jī)散列值伴嗡。
Nodes always consider the longest chain to be the correct one and will keep working on extending it. If two nodes broadcast different versions of the next block simultaneously, some nodes may receive one or the other first. In that case, they work on the first one they received, but save the other branch in case it becomes longer. The tie will be broken when the next proofof-work is found and one branch becomes longer; the nodes that were working on the other branch will then switch to the longer one.
節(jié)點(diǎn)始終都將最長的鏈條視為正確的鏈條,并持續(xù)工作和延長它从铲。如果有兩個(gè)節(jié)點(diǎn)同時(shí)廣播不同版本的新區(qū)塊瘪校,那么其他節(jié)點(diǎn)在接收到該區(qū)塊的時(shí)間上將存在先后差別。當(dāng)此情形名段,他們將在率先收到的區(qū)塊基礎(chǔ)上進(jìn)行工作阱扬,但也會(huì)保留另外一個(gè)鏈條,以防后者變成最長的鏈條伸辟。該僵局(tie)的打破要等到下一個(gè)工作量證明被發(fā)現(xiàn)麻惶,而其中的一條鏈條被證實(shí)為是較長的一條,那么在另一條分支鏈條上工作的節(jié)點(diǎn)將轉(zhuǎn)換陣營信夫,開始在較長的鏈條上工作窃蹋。
New transaction broadcasts do not necessarily need to reach all nodes. As long as they reach many nodes, they will get into a block before long. Block broadcasts are also tolerant of dropped messages. If a node does not receive a block, it will request it when it receives the next block and realizes it missed one.
所謂“新的交易要廣播”卡啰,實(shí)際上不需要抵達(dá)全部的節(jié)點(diǎn)。只要交易信息能夠抵達(dá)足夠多的節(jié)點(diǎn)警没,那么他們將很快被整合進(jìn)一個(gè)區(qū)塊中匈辱。而區(qū)塊的廣播對(duì)被丟棄的信息是具有容錯(cuò)能力的。如果一個(gè)節(jié)點(diǎn)沒有收到某特定區(qū)塊杀迹,那么該節(jié)點(diǎn)將會(huì)發(fā)現(xiàn)自己缺失了某個(gè)區(qū)塊梅誓,也就可以提出自己下載該區(qū)塊的請求。