6 Star 47 Fork 28

Hyperledger/fabric

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
bootstrap.go 1.62 KB
一键复制 编辑 原始数据 按行查看 历史
// 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
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/hyperledger/fabric.git
git@gitee.com:hyperledger/fabric.git
hyperledger
fabric
fabric
v1.4.1

搜索帮助

0d507c66 1850385 C8b1a773 1850385