github.com/darrenli6/fabric-sdk-example@v0.0.0-20220109053535-94b13b56df8c/core/committer/committer.go (about)

     1  /*
     2  Copyright IBM Corp. 2016 All Rights Reserved.
     3  
     4  Licensed under the Apache License, Version 2.0 (the "License");
     5  you may not use this file except in compliance with the License.
     6  You may obtain a copy of the License at
     7  
     8  		 http://www.apache.org/licenses/LICENSE-2.0
     9  
    10  Unless required by applicable law or agreed to in writing, software
    11  distributed under the License is distributed on an "AS IS" BASIS,
    12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    13  See the License for the specific language governing permissions and
    14  limitations under the License.
    15  */
    16  
    17  package committer
    18  
    19  import "github.com/hyperledger/fabric/protos/common"
    20  
    21  // Committer is the interface supported by committers
    22  // The only committer is noopssinglechain committer.
    23  // The interface is intentionally sparse with the sole
    24  // aim of "leave-everything-to-the-committer-for-now".
    25  // As we solidify the bootstrap process and as we add
    26  // more support (such as Gossip) this interface will
    27  // change
    28  type Committer interface {
    29  
    30  	// Commit block to the ledger
    31  	Commit(block *common.Block) error
    32  
    33  	// Get recent block sequence number
    34  	LedgerHeight() (uint64, error)
    35  
    36  	// Gets blocks with sequence numbers provided in the slice
    37  	GetBlocks(blockSeqs []uint64) []*common.Block
    38  
    39  	// Closes committing service
    40  	Close()
    41  }