1.block_header
eos_read/libraries/chain/include/eosio/chain/block_header.hpp
struct block_header
{
block_timestamp_type timestamp;
account_name producer;
/**
* By signing this block this producer is confirming blocks [block_num() - confirmed, blocknum())
* as being the best blocks for that range and that he has not signed any other
* statements that would contradict.
*
* No producer should sign a block with overlapping ranges or it is proof of byzantine
* behavior. When producing a block a producer is always confirming at least the block he
* is building off of. A producer cannot confirm "this" block, only prior blocks.
*/
uint16_t confirmed = 1;
block_id_type previous;
checksum256_type transaction_mroot; /// mroot of cycles_summary
checksum256_type action_mroot; /// mroot of all delivered action receipts
/** The producer schedule version that should validate this block, this is used to
* indicate that the prior block which included new_producers->version has been marked
* irreversible and that it the new producer schedule takes effect this block.
*/
uint32_t schedule_version = 0;
optional<producer_schedule_type> new_producers;
extensions_type header_extensions;
digest_type digest()const;
block_id_type id() const;
uint32_t block_num() const { return num_from_id(previous) + 1; }
static uint32_t num_from_id(const block_id_type& id);
};
2.signed_block_header
struct signed_block_header : public block_header
{
signature_type producer_signature;
};
3.signed_block
eos_read/libraries/chain/include/eosio/chain/block.hpp
struct signed_block : public signed_block_header {
using signed_block_header::signed_block_header;
signed_block() = default;
signed_block( const signed_block_header& h ):signed_block_header(h){}
vector<transaction_receipt> transactions; /// new or generated transactions
extensions_type block_extensions;
};
4.
eos_read/plugins/chain_plugin/chain_plugin.cpp
fc::variant read_only::get_block(const read_only::get_block_params& params) const {
return fc::mutable_variant_object(pretty_output.get_object())
("id", block->id())
("block_num",block->block_num())
("ref_block_prefix", ref_block_prefix);
}