ブロック構造
1 回答
- 投票
公式ドキュメントに示されているように(詳細を表示するには、[JSON出力]をクリックしてください)proto003のブロックヘッダーの構造は
です. $block_header
$Chain_id:
/* Network identifier (Base58Check-encoded) */
$unistring
$Context_hash:
/* A hash of context (Base58Check-encoded) */
$unistring
$Operation_list_list_hash:
/* A list of list of operations (Base58Check-encoded) */
$unistring
$Signature:
/* A Ed25519, Secp256k1 or P256 signature (Base58Check-encoded) */
$unistring
$block_hash:
/* A block identifier (Base58Check-encoded) */
$unistring
$block_header:
{ "protocol": "PsddFKi32cMJ2qPjf43Qv5GDWLDPZb3T3bF6fLKiF5HtvHNU7aP",
"chain_id": $Chain_id,
"hash": $block_hash,
"level": integer ∈ [-2^31-2, 2^31+2],
"proto": integer ∈ [0, 255],
"predecessor": $block_hash,
"timestamp": $timestamp,
"validation_pass": integer ∈ [0, 255],
"operations_hash": $Operation_list_list_hash,
"fitness": $fitness,
"context": $Context_hash,
"priority": integer ∈ [0, 2^16-1],
"proof_of_work_nonce": /^[a-zA-Z0-9]+$/,
"seed_nonce_hash"?: $cycle_nonce,
"signature": $Signature }
$cycle_nonce:
/* A nonce hash (Base58Check-encoded) */
$unistring
$fitness:
/* Block fitness
The fitness, or score, of a block, that allow the Tezos to decide
which chain is the best. A fitness value is a list of byte sequences.
They are compared as follows: shortest lists are smaller; lists of the
same length are compared according to the lexicographical order. */
[ /^[a-zA-Z0-9]+$/ ... ]
$int64:
/* 64 bit integers
Decimal representation of 64 bit integers */
string
$timestamp: $timestamp.rfc || $int64
$timestamp.rfc:
/* RFC 3339 formatted timestamp
A date in human readble form as specified in RFC 3339. */
$unistring
$unistring:
/* Universal string representation
Either a plain UTF8 string, or a sequence of bytes for strings that
contain invalid byte sequences. */
string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }
次のrpc呼び出しを使用して、tezosノードからこの情報を直接回復することもできます
./tezos-client rpc schema get /chains/main/blocks/head/header
As show in the official documentation (click "JSON Output" in order to see the details) the structure of the block header in proto 003 is
$block_header
$Chain_id:
/* Network identifier (Base58Check-encoded) */
$unistring
$Context_hash:
/* A hash of context (Base58Check-encoded) */
$unistring
$Operation_list_list_hash:
/* A list of list of operations (Base58Check-encoded) */
$unistring
$Signature:
/* A Ed25519, Secp256k1 or P256 signature (Base58Check-encoded) */
$unistring
$block_hash:
/* A block identifier (Base58Check-encoded) */
$unistring
$block_header:
{ "protocol": "PsddFKi32cMJ2qPjf43Qv5GDWLDPZb3T3bF6fLKiF5HtvHNU7aP",
"chain_id": $Chain_id,
"hash": $block_hash,
"level": integer ∈ [-2^31-2, 2^31+2],
"proto": integer ∈ [0, 255],
"predecessor": $block_hash,
"timestamp": $timestamp,
"validation_pass": integer ∈ [0, 255],
"operations_hash": $Operation_list_list_hash,
"fitness": $fitness,
"context": $Context_hash,
"priority": integer ∈ [0, 2^16-1],
"proof_of_work_nonce": /^[a-zA-Z0-9]+$/,
"seed_nonce_hash"?: $cycle_nonce,
"signature": $Signature }
$cycle_nonce:
/* A nonce hash (Base58Check-encoded) */
$unistring
$fitness:
/* Block fitness
The fitness, or score, of a block, that allow the Tezos to decide
which chain is the best. A fitness value is a list of byte sequences.
They are compared as follows: shortest lists are smaller; lists of the
same length are compared according to the lexicographical order. */
[ /^[a-zA-Z0-9]+$/ ... ]
$int64:
/* 64 bit integers
Decimal representation of 64 bit integers */
string
$timestamp: $timestamp.rfc || $int64
$timestamp.rfc:
/* RFC 3339 formatted timestamp
A date in human readble form as specified in RFC 3339. */
$unistring
$unistring:
/* Universal string representation
Either a plain UTF8 string, or a sequence of bytes for strings that
contain invalid byte sequences. */
string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }
You can also recover this information directly from your tezos node using the following rpc call
./tezos-client rpc schema get /chains/main/blocks/head/header
whitedoc を頭からの出力と比較しています.例:
これらのフィールドの一部はホワイトドキュメントで説明されていますが、
chain_id
とhash
が欠落しているようです.いくつかの質問:context
、fitness
、operations_hash
などの完全な定義を探しています)