Documentation ¶
Index ¶
- Constants
- func BlockStorePath(rootFSPath string) string
- func BookkeeperDBPath(rootFSPath string) string
- func ClearPreResetHeight(rootFSPath string, ledgerIDs []string) error
- func CompletedSnapshotsPath(snapshotRootDir string) string
- func ConfigHistoryDBPath(rootFSPath string) string
- func HistoryDBPath(rootFSPath string) string
- func LedgerProviderPath(rootFSPath string) string
- func LoadPreResetHeight(rootFSPath string, ledgerIDs []string) (map[string]uint64, error)
- func PauseChannel(rootFSPath, ledgerID string) error
- func PvtDataStorePath(rootFSPath string) string
- func RebuildDBs(config *ledger.Config) error
- func ResetAllKVLedgers(rootFSPath string) error
- func ResumeChannel(rootFSPath, ledgerID string) error
- func RollbackKVLedger(rootFSPath, ledgerID string, blockNum uint64) error
- func SnapshotDirForLedgerBlockNum(snapshotRootDir, ledgerID string, blockNumber uint64) string
- func SnapshotsDirForLedger(snapshotRootDir, ledgerID string) string
- func SnapshotsTempDirPath(snapshotRootDir string) string
- func StateDBPath(rootFSPath string) string
- func UnjoinChannel(config *ledger.Config, ledgerID string) error
- func UpgradeDBs(config *ledger.Config) error
- func UpgradeIDStoreFormat(t *testing.T, rootFSPath string)
- type Provider
- func (p *Provider) Close()
- func (p *Provider) CreateFromGenesisBlock(genesisBlock *common.Block) (ledger.PeerLedger, error)
- func (p *Provider) CreateFromSnapshot(snapshotDir string) (ledger.PeerLedger, string, error)
- func (p *Provider) Exists(ledgerID string) (bool, error)
- func (p *Provider) List() ([]string, error)
- func (p *Provider) Open(ledgerID string) (ledger.PeerLedger, error)
- type SnapshotMetadata
- type SnapshotMetadataJSONs
- type SnapshotSignableMetadata
Constants ¶
const (
SnapshotSignableMetadataFileName = "_snapshot_signable_metadata.json"
)
Variables ¶
This section is empty.
Functions ¶
func BlockStorePath ¶
BlockStorePath returns the absolute path of block storage
func BookkeeperDBPath ¶
BookkeeperDBPath return the absolute path of bookkeeper DB
func ClearPreResetHeight ¶
ClearPreResetHeight removes the prereset height recorded in the file system for the specified ledgers.
func CompletedSnapshotsPath ¶
CompletedSnapshotsPath returns the absolute path that is used for persisting the snapshots
func ConfigHistoryDBPath ¶
ConfigHistoryDBPath returns the absolute path of configHistory DB
func HistoryDBPath ¶
HistoryDBPath returns the absolute path of history DB
func LedgerProviderPath ¶
LedgerProviderPath returns the absolute path of ledgerprovider
func LoadPreResetHeight ¶
LoadPreResetHeight returns the prereset height for the specified ledgers.
func PauseChannel ¶
PauseChannel updates the channel status to inactive in ledgerProviders.
func PvtDataStorePath ¶
PvtDataStorePath returns the absolute path of pvtdata storage
func RebuildDBs ¶
RebuildDBs drops existing ledger databases. Dropped database will be rebuilt upon server restart
func ResetAllKVLedgers ¶
ResetAllKVLedgers resets all ledger to the genesis block.
func ResumeChannel ¶
ResumeChannel updates the channel status to active in ledgerProviders
func RollbackKVLedger ¶
RollbackKVLedger rollbacks a ledger to a specified block number
func SnapshotDirForLedgerBlockNum ¶
SnapshotDirForLedgerBlockNum returns the absolute path for a particular snapshot for a ledger
func SnapshotsDirForLedger ¶
SnapshotsDirForLedger returns the absolute path of the dir for the snapshots for a specified ledger
func SnapshotsTempDirPath ¶
SnapshotsTempDirPath returns the dir path that is used temporarily during the genration or import of the snapshots for a ledger
func StateDBPath ¶
StateDBPath returns the absolute path of state level DB
func UnjoinChannel ¶
UnjoinChannel removes the data for a ledger and sets the status to UNDER_DELETION. This function is to be invoked while the peer is shut down.
func UpgradeDBs ¶
UpgradeDBs upgrades existing ledger databases to the latest formats. It checks the format of idStore and does not drop any databases if the format is already the latest version. Otherwise, it drops ledger databases and upgrades the idStore format.
func UpgradeIDStoreFormat ¶
UpgradeIDStoreFormat updates ledger idStore to current format
Types ¶
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider implements interface ledger.PeerLedgerProvider
func NewProvider ¶
func NewProvider(initializer *ledger.Initializer) (pr *Provider, e error)
NewProvider instantiates a new Provider. This is not thread-safe and assumed to be synchronized by the caller
func (*Provider) Close ¶
func (p *Provider) Close()
Close implements the corresponding method from interface ledger.PeerLedgerProvider
func (*Provider) CreateFromGenesisBlock ¶
CreateFromGenesisBlock implements the corresponding method from interface ledger.PeerLedgerProvider This function creates a new ledger and commits the genesis block. If a failure happens during this process, the partially created ledger is deleted
func (*Provider) CreateFromSnapshot ¶
CreateFromSnapshot implements the corresponding method from interface ledger.PeerLedgerProvider This function creates a new ledger from the supplied snapshot. If a failure happens during this process, the partially created ledger is deleted
func (*Provider) Exists ¶
Exists implements the corresponding method from interface ledger.PeerLedgerProvider
type SnapshotMetadata ¶
type SnapshotMetadata struct { *SnapshotSignableMetadata // contains filtered or unexported fields }
type SnapshotMetadataJSONs ¶
type SnapshotMetadataJSONs struct {
// contains filtered or unexported fields
}
func (*SnapshotMetadataJSONs) ToMetadata ¶
func (j *SnapshotMetadataJSONs) ToMetadata() (*SnapshotMetadata, error)
type SnapshotSignableMetadata ¶
type SnapshotSignableMetadata struct { ChannelName string `json:"channel_name"` LastBlockNumber uint64 `json:"last_block_number"` LastBlockHashInHex string `json:"last_block_hash"` PreviousBlockHashInHex string `json:"previous_block_hash"` FilesAndHashes map[string]string `json:"snapshot_files_raw_hashes"` StateDBType string `json:"state_db_type"` }
SnapshotSignableMetadata is used to build a JSON that represents a unique snapshot and can be signed by the peer. Hashsum of the resultant JSON is intended to be used as a single hash of the snapshot, if need be.
func (*SnapshotSignableMetadata) ToJSON ¶
func (m *SnapshotSignableMetadata) ToJSON() ([]byte, error)
Source Files ¶
- channelinfo_provider.go
- coll_elg_notifier.go
- drop_dbs.go
- hashcheck_pvtdata.go
- kv_ledger.go
- kv_ledger_provider.go
- ledger_data_remover.go
- ledger_filepath.go
- metrics.go
- pause_resume.go
- rebuild_dbs.go
- recovery.go
- reset.go
- rollback.go
- snapshot.go
- snapshot_mgmt.go
- test_exports.go
- unjoin_channel.go
- upgrade_dbs.go
Directories ¶
Path | Synopsis |
---|---|
benchmark
|
|
Code generated by counterfeiter.
|
Code generated by counterfeiter. |
fakes
Code generated by counterfeiter.
|
Code generated by counterfeiter. |
txmgmt
|
|
privacyenabledstate/mock
Code generated by counterfeiter.
|
Code generated by counterfeiter. |
queryutil/mock
Code generated by counterfeiter.
|
Code generated by counterfeiter. |
statedb/mock
Code generated by counterfeiter.
|
Code generated by counterfeiter. |
validation/mock
Code generated by counterfeiter.
|
Code generated by counterfeiter. |