fabric: github.com/hyperledger/fabric/common/ledger/dataformat Index | Files

package dataformat

import "github.com/hyperledger/fabric/common/ledger/dataformat"


Package Files



const (
    // PreviousFormat specifies the data format in previous fabric version
    PreviousFormat = ""

    // CurrentFormat specifies the data format in current fabric version
    CurrentFormat = "2.0"

The data format stored in ledger databases may be changed in a new release to support new features. This file defines the constants to check whether or not the data format on the ledger matches the CurrentFormat. If not matched, peer start will fail and the ledger must be upgraded to the CurrentFormat. If a Fabric version does not introduce a new data format, CurrentFormat will remain the same as the latest format prior to the Fabric version.

func IsVersionMismatch Uses

func IsVersionMismatch(err error) bool

IsVersionMismatch returns true if err is an ErrFormatMismatch

type ErrFormatMismatch Uses

type ErrFormatMismatch struct {
    DBInfo         string
    ExpectedFormat string
    Format         string

ErrFormatMismatch is returned if it is detected that the version of the format recorded in the internal database is different from what is specified in the `Conf` that is used for opening the db

func (*ErrFormatMismatch) Error Uses

func (e *ErrFormatMismatch) Error() string

Package dataformat imports 1 packages (graph) and is imported by 8 packages. Updated 2020-09-28. Refresh now. Tools for package owners.