이 더 리 움 블록 과 블록 헤드 데이터 구조 분석

3564 단어 블록 체인
블록 데이터 구조 분석
소스 코드

// Block represents an entire block in the Ethereum blockchain.
type Block struct {
    header       *Header
    uncles       []*Header
    transactions Transactions
 
    // caches
    hash atomic.Value
    size atomic.Value
 
    // Td is used by package core to store the total difficulty
    // of the chain up to and including the block.
    td *big.Int
 
    // These fields are used by package eth to track
    // inter-peer block relay.
    ReceivedAt   time.Time
    ReceivedFrom interface{}
}

- header:          

- uncles:          

- transactions:  

- td:                   , ( )

- ReceivedAt:           

- ReceivedFrom:

 

 

Header


// Header represents a block header in the Ethereum blockchain.
type Header struct {
   ParentHash  common.Hash    `json:"parentHash"       gencodec:"required"`
   UncleHash   common.Hash    `json:"sha3Uncles"       gencodec:"required"`
   Coinbase    common.Address `json:"miner"            gencodec:"required"`
   Root        common.Hash    `json:"stateRoot"        gencodec:"required"`
   TxHash      common.Hash    `json:"transactionsRoot" gencodec:"required"`
   ReceiptHash common.Hash    `json:"receiptsRoot"     gencodec:"required"`
   Bloom       Bloom          `json:"logsBloom"        gencodec:"required"`
   Difficulty  *big.Int       `json:"difficulty"       gencodec:"required"`
   Number      *big.Int       `json:"number"           gencodec:"required"`
   GasLimit    uint64         `json:"gasLimit"         gencodec:"required"`
   GasUsed     uint64         `json:"gasUsed"          gencodec:"required"`
   Time        *big.Int       `json:"timestamp"        gencodec:"required"`
   Extra       []byte         `json:"extraData"        gencodec:"required"`
   Extra2      []byte         `json:"extraData2"       gencodec:"required"`
   MixDigest   common.Hash    `json:"mixHash"          gencodec:"required"`
   Nonce       BlockNonce     `json:"nonce"            gencodec:"required"`
}

- ParentHash:  

- UncleHash:  

- Coinbase:     ,

- Root:             Merkle

- TxHash:         Merkle

- ReceiptHash: Merkle

- Bloom:           ,

- Difficulty:      

- Number:       , ,

- GasLimit:       (gas)

- GasUsed:     (gas)

- Time:             ( Engine.Prepare )

- MixDigest:     Nonce ,

- Nonce:         MixDigest ,

- Extra:           ( Clique )

좋은 웹페이지 즐겨찾기