Skip to content

Commit

Permalink
Merge "[FAB-1773] Add metadata field for orderer use"
Browse files Browse the repository at this point in the history
  • Loading branch information
binhn authored and Gerrit Code Review committed Jan 20, 2017
2 parents 57b42ab + d5a70d1 commit 051229a
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 11 deletions.
8 changes: 6 additions & 2 deletions protos/common/block.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,13 @@ func NewBlock(seqNum uint64, previousHash []byte) *Block {
block.Header.Number = seqNum
block.Header.PreviousHash = previousHash
block.Data = &BlockData{}
block.Metadata = &BlockMetadata{
Metadata: [][]byte{[]byte{}, []byte{}, []byte{}},

var metadataContents [][]byte
for i := 0; i < len(BlockMetadataIndex_name); i++ {
metadataContents = append(metadataContents, []byte{})
}
block.Metadata = &BlockMetadata{Metadata: metadataContents}

return block
}

Expand Down
19 changes: 11 additions & 8 deletions protos/common/common.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion protos/common/common.proto
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,13 @@ enum HeaderType {
DELIVER_SEEK_INFO = 5; // Used as the type for Envelope messages submitted to instruct the Deliver API to seek
}

// This enum enlist indexes of the block metadata array
// This enum enlists indexes of the block metadata array
enum BlockMetadataIndex {
SIGNATURES = 0; // Block metadata array position for block signatures
LAST_CONFIGURATION = 1; // Block metadata array poistion to store last configuration block sequence number
TRANSACTIONS_FILTER = 2; // Block metadata array poistion to store serialized bit array filter of invalid transactions
ORDERER = 3; // Block metadata array position to store operational metadata for orderers
// e.g. For Kafka, this is where we store the last offset written to the local ledger.
}

// LastConfiguration is the encoded value for the Metadata message which is encoded in the LAST_CONFIGURATION block metadata index
Expand Down

0 comments on commit 051229a

Please sign in to comment.