Фабри c Внутренние блоки данных - PullRequest
1 голос
/ 12 февраля 2020

Ledger имеет журнал состояния и транзакций в мире.

Заинтересован,

1) Where exactly transaction log file is stored

2) How can I view the complete content of Block (any example, how it looks instead of diagrams). Is the block data saved in JSON format ??

3) Please share the documentation on how the data hash and previous block hash are created using the specific algorithm


4) What is the exact type of data structure is used to create the transaction log 

Эта ссылка предоставит базовый обзор c: https://hyperledger-fabric.readthedocs.io/en/release-2.0/ledger/ledger.html#blockchain

Любая документация для понимания внутреннего.

1 Ответ

1 голос
/ 12 февраля 2020
  1. Все world state и transaction log хранятся в контейнере peer.
    LevelDB or CouchDB сохраняет состояние мира, а transaction log сохраняется как ledger.

    Я не знаю, где именно он сохраняет регистр.

  2. Блок сохраняет в формате 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.
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...