代码拉取完成,页面将自动刷新
// Copyright IBM Corp. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
package bootstrap
import (
ab "github.com/hyperledger/fabric-protos-go/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
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。