bootstrap

package
v2.0.0+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 29, 2020 License: Apache-2.0 Imports: 1 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Helper

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
}

Helper defines the functions a bootstrapping implementation should provide.

type Replacer added in v1.4.1

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
}

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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL