63 Star 183 Fork 3

Gitee 极速下载/hyperledger-fabric

Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/hyperledger/fabric
Clone or Download
bootstrap.go 1.62 KB
Copy Edit Raw Blame History
// Copyright IBM Corp. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
package bootstrap
import (
ab "github.com/hyperledger/fabric/protos/common"
)
// Helper defines the functions a bootstrapping implementation should provide.
type Helper interface {
// GenesisBlock should return the genesis block required to bootstrap
// the ledger (be it reading from the filesystem, generating it, etc.)
GenesisBlock() *ab.Block
}
// Replacer provides the ability to to replace the current genesis block used
// for bootstrapping with the supplied block. It is used during consensus-type
// migration in order to replace the original genesis block used for
// bootstrapping with the latest config block of the system channel, which
// contains the new consensus-type. This will ensure the instantiation of the
// correct consenter type when the server restarts.
type Replacer interface {
// ReplaceGenesisBlockFile should first copy the current file to a backup
// file: <genesis-file-name> => <genesis-file-name>.bak
// and then overwrite the original file with the content of the given block.
// If something goes wrong during migration, the original file could be
// restored from the backup.
// An error is returned if the operation was not completed successfully.
ReplaceGenesisBlockFile(block *ab.Block) error
// CheckReadWrite checks whether the current file is readable and writable,
// because if it is not, there is no point in attempting to replace. This
// check is performed at the beginning of the consensus-type migration
// process.
// An error is returned if the file is not readable and writable.
CheckReadWrite() error
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/mirrors/hyperledger-fabric.git
git@gitee.com:mirrors/hyperledger-fabric.git
mirrors
hyperledger-fabric
hyperledger-fabric
v1.4.5

Search