Implements schema and functions related to Etheruem's block.
npm install ethereumjs-block
This module work with browserify
Creates a new block object
data
- the serialized block (usually from the network) in a array of buffers as described in the wire protocol
header
- the block'sheader
transactionReceipt
- an array ofTransactionReceipt
in the blockuncleList
- an array of uncleheaders
raw
- an array of buffers containing the raw blocks.
Generates the transaction trie. This must be done before doing validation
cb
- the callback
Returns the sha3-256 hash of the RLP encoding of the serialized block
Returns the RLP serialization of the block.
Validates the entire block. Returns a string
to the callback if block is invalid
blockchain
- an instance of theBlockchain
cb
- the callback
Validates the uncles that are in the block if any. Returns a string
to the callback if uncles are invalid
blockchain
- an instance of theBlockchain
cb
- the callback
Validates all of the transactions in the block. Returns a Boolean
Validates the transaction trie. Returns a Boolean
Returns a Boolean
determining if the block is a genesis block
Sets the parameters of the block to the genesis block.
Returns the block as a JSON object.
label
- ABoolean
. If true returns an JSON object with properties corresponding to the block properties if false it just returns a JSON array.
A object that repersents the block header.
parentHash
- the blocks' parnet's hashuncleHash
- sha3(rlp_encode(uncle_list))coinbase
- the miner addressstateRoot
- The root of a Merkle Patricia treetransactionTrie
- the root of a Trie containing the transactionsreceiptTrie
- the root of a Trie containing the transaction Recieptbloom
difficulty
number
- the heightgasLimit
gasUsed
timestamp
extraData
raw
- anArray
ofBuffers
forming the raw header
Validates the entire block headers
blockchain
- blockChain the blockchain that this block is validating againstheight
if this is an uncle header, this is the height of the block that is including itcb
the callback function
Validates the difficutly returning a Boolean
Validates the gasLimit, returning a Boolean
Returns the canonical gas limit of the block
parentBlock
- the parentBlock
of the header
Returns the canoncical difficulty of the block
parentBlock
- the parentBlock
of the header
Returns the sha3 hash of the blockheader