Blocks
難度和總難度
這是我的私有區塊鏈中一個區塊的資訊:
{ difficulty: 759585, extraData: "0xd783010409844765746887676f312e362e32856c696e7578", gasLimit: 4712388, gasUsed: 0, hash: "0xcf3366fbf4b6c9adf63386b1cc1ed03957df28c57f576a5a4ceef4041011d0c0", logsBloom: "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", miner: "0x37e5a459dbd48d4d9874e13cc334dab30373cece", nonce: "0x40f805725d02472c", number: 17000, parentHash: "0xaeb4da768e9e9cb4838e37128ffe895a2f8a684bf2a66339659bbb25a6e44a69", receiptRoot: "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", sha3Uncles: "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", size: 537, stateRoot: "0x8e61e87fbe4df30634472018ffb7c3f7a8315901ace91f9244958e067bf84a6b", timestamp: 1467943085, totalDifficulty: 10000790891, transactions: [], transactionsRoot: "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", uncles: [] }
在此,
difficulty
和totalDifficulty
參數是什麼意思?
這些在JSON RPC README中的 wiki 中進行了解釋,位於
eth_getBlockByHash()
.難度:QUANTITY - 此塊難度的整數。
totalDifficulty: QUANTITY - 直到這個塊的鏈的總難度的整數。
[ 難度本身是衡量礦工通過找到低於給定目標的雜湊來探勘新區塊的難度。用於設置乙太坊難度的計算解釋可以在之前的執行緒中找到。]
正如理查德已經指出的那樣,困難在於目前的量化衡量方法是蠻力(“我的”)一個塊有多難。
總難度是您查詢的區塊之前所有區塊難度的累積總和。我最近了解到,這是最長鏈的最佳指標,即讓客戶確定在分叉的情況下堅持哪條鏈。它將堅持總難度最高的鏈條。