Commit 2a16532c authored by manish's avatar manish
Browse files

Move Blockstorage code under /fabric/common package

https://jira.hyperledger.org/browse/FAB-2022



This changes introduced by this CR
- Moves the block storage code from package
core/ledger/blkstorage to common/ledger/blkstorage

- Splits the ledger_interface.go so as to move common interfaces
and data type to common/ledger package

- Moves some of the util functions to common/ledger package

- Moves core/ledger/ordererledger package to orderer/ledger/fsledger
orderer folks can futher rename/refactor this as seems suitable to them

Change-Id: I759e16f00dc2ec9bb62196121083cf48eae76948
Signed-off-by: default avatarmanish <manish.sethi@gmail.com>
parent e67a2382
...@@ -44,23 +44,9 @@ func (m *PeerEndpoint) GetID() *PeerID { ...@@ -44,23 +44,9 @@ func (m *PeerEndpoint) GetID() *PeerID {
return nil return nil
} }
// Contains information about the blockchain ledger such as height, current
// block hash, and previous block hash.
type BlockchainInfo struct {
Height uint64 `protobuf:"varint,1,opt,name=height" json:"height,omitempty"`
CurrentBlockHash []byte `protobuf:"bytes,2,opt,name=currentBlockHash,proto3" json:"currentBlockHash,omitempty"`
PreviousBlockHash []byte `protobuf:"bytes,3,opt,name=previousBlockHash,proto3" json:"previousBlockHash,omitempty"`
}
func (m *BlockchainInfo) Reset() { *m = BlockchainInfo{} }
func (m *BlockchainInfo) String() string { return proto.CompactTextString(m) }
func (*BlockchainInfo) ProtoMessage() {}
func (*BlockchainInfo) Descriptor() ([]byte, []int) { return fileDescriptor5, []int{2} }
func init() { func init() {
proto.RegisterType((*PeerID)(nil), "protos.PeerID") proto.RegisterType((*PeerID)(nil), "protos.PeerID")
proto.RegisterType((*PeerEndpoint)(nil), "protos.PeerEndpoint") proto.RegisterType((*PeerEndpoint)(nil), "protos.PeerEndpoint")
proto.RegisterType((*BlockchainInfo)(nil), "protos.BlockchainInfo")
} }
// Reference imports to suppress errors if they are not otherwise used. // Reference imports to suppress errors if they are not otherwise used.
...@@ -138,24 +124,20 @@ var _Endorser_serviceDesc = grpc.ServiceDesc{ ...@@ -138,24 +124,20 @@ var _Endorser_serviceDesc = grpc.ServiceDesc{
func init() { proto.RegisterFile("peer/peer.proto", fileDescriptor5) } func init() { proto.RegisterFile("peer/peer.proto", fileDescriptor5) }
var fileDescriptor5 = []byte{ var fileDescriptor5 = []byte{
// 297 bytes of a gzipped FileDescriptorProto // 235 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x64, 0x51, 0x4d, 0x6b, 0xf2, 0x40, 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x54, 0x90, 0x4f, 0x4b, 0xc4, 0x30,
0x10, 0x7e, 0xf5, 0x15, 0xdb, 0x4e, 0x45, 0xdb, 0x2d, 0x48, 0x10, 0x29, 0x25, 0xa7, 0x7e, 0x61, 0x10, 0xc5, 0xdd, 0x22, 0xab, 0x8e, 0xe2, 0x42, 0x04, 0x29, 0x65, 0x11, 0xe9, 0x49, 0x11, 0x5a,
0xc0, 0xfe, 0x03, 0x51, 0x30, 0x37, 0x9b, 0xde, 0x7a, 0x29, 0x31, 0x19, 0x93, 0xa5, 0xba, 0xb3, 0x58, 0xbf, 0x81, 0xb4, 0x60, 0x6f, 0xb5, 0xde, 0xbc, 0x48, 0xdb, 0x8c, 0xdd, 0xc0, 0x6e, 0x26,
0xcc, 0xc4, 0x42, 0xaf, 0xfd, 0xe5, 0xc5, 0xdd, 0xa4, 0xa5, 0x78, 0xd9, 0x9d, 0x79, 0xbe, 0x60, 0xcc, 0xd4, 0x83, 0xdf, 0x5e, 0x9a, 0xb4, 0x82, 0x97, 0xfc, 0x79, 0xbf, 0xcc, 0xcb, 0xe3, 0xc1,
0x66, 0x60, 0x60, 0x11, 0x39, 0x3a, 0x3c, 0x13, 0xcb, 0x54, 0x91, 0xea, 0xba, 0x4f, 0x46, 0x57, 0xc6, 0x21, 0x72, 0x3e, 0x2d, 0x99, 0x63, 0x1a, 0x49, 0xad, 0xfd, 0x26, 0xc9, 0x4d, 0x00,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xdb, 0xc1, 0x01, 0x00, 0x00,
} }
...@@ -31,16 +31,6 @@ message PeerEndpoint { ...@@ -31,16 +31,6 @@ message PeerEndpoint {
string address = 2; string address = 2;
} }
// Contains information about the blockchain ledger such as height, current
// block hash, and previous block hash.
message BlockchainInfo {
uint64 height = 1;
bytes currentBlockHash = 2;
bytes previousBlockHash = 3;
}
//-------- the Endorser service ------------ //-------- the Endorser service ------------
service Endorser { service Endorser {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment