Все world state
и transaction log
хранятся в контейнере peer
.
LevelDB or CouchDB
сохраняет состояние мира, а transaction log
сохраняется как ledger
.
Я не знаю, где именно он сохраняет регистр.
Блок сохраняет в формате protobuf. Определение данных блока - fabri c -node-sdk
Для получения данных блока .
An object of a fully decoded protobuf message "Block".
A Block may contain the configuration of the channel or transactions on the channel.
A Block object will have the following object structure.
header
number -- {int}
previous_hash -- {byte[]}
data_hash -- {byte[]}
data
data -- {array}
signature -- {byte[]}
payload
header -- {Header}
data -- {ConfigEnvelope | Transaction}
metadata
metadata -- {array} #each array item has it's own layout
[0] #SIGNATURES
signatures -- {MetadataSignature[]}
[1] #LAST_CONFIG
value
index -- {number}
signatures -- {MetadataSignature[]}
[2] #TRANSACTIONS_FILTER
{int[]} #see TxValidationCode in proto/peer/transaction.proto
Алгоритм
SHA256
используется для шифрования блока. Блок шифруется с использованием:
block number, current block hash, previous block hash, block data and block metadata
.
То же, что в пункте 2.