Documentation
¶
Index ¶
- Variables
- func ClearPreResetHeight() error
- func LoadPreResetHeight() (map[string]uint64, error)
- func NewProvider() (ledger.PeerLedgerProvider, error)
- func ResetAllKVLedgers() error
- func RollbackKVLedger(ledgerID string, blockNum uint64) error
- type Provider
- func (provider *Provider) Close()
- func (provider *Provider) Create(genesisBlock *common.Block) (ledger.PeerLedger, error)
- func (provider *Provider) Exists(ledgerID string) (bool, error)
- func (provider *Provider) Initialize(initializer *ledger.Initializer) error
- func (provider *Provider) List() ([]string, error)
- func (provider *Provider) Open(ledgerID string) (ledger.PeerLedger, error)
Constants ¶
This section is empty.
Variables ¶
var ( // ErrLedgerIDExists is thrown by a CreateLedger call if a ledger with the given id already exists ErrLedgerIDExists = errors.New("LedgerID already exists") // ErrNonExistingLedgerID is thrown by a OpenLedger call if a ledger with the given id does not exist ErrNonExistingLedgerID = errors.New("LedgerID does not exist") // ErrLedgerNotOpened is thrown by a CloseLedger call if a ledger with the given id has not been opened ErrLedgerNotOpened = errors.New("ledger is not opened yet") )
Functions ¶
func ClearPreResetHeight ¶ added in v1.4.2
func ClearPreResetHeight() error
func LoadPreResetHeight ¶ added in v1.4.2
LoadPreResetHeight returns the pre-reset height of all ledgers.
func NewProvider ¶
func NewProvider() (ledger.PeerLedgerProvider, error)
NewProvider instantiates a new Provider. This is not thread-safe and assumed to be synchronized be the caller
func ResetAllKVLedgers ¶ added in v1.4.2
func ResetAllKVLedgers() error
ResetAllKVLedgers resets all ledger to the genesis block.
func RollbackKVLedger ¶ added in v1.4.2
RollbackKVLedger rollbacks a ledger to a specified block number
Types ¶
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider implements interface ledger.PeerLedgerProvider
func (*Provider) Close ¶
func (provider *Provider) Close()
Close implements the corresponding method from interface ledger.PeerLedgerProvider
func (*Provider) Create ¶
Create implements the corresponding method from interface ledger.PeerLedgerProvider This functions sets a under construction flag before doing any thing related to ledger creation and upon a successful ledger creation with the committed genesis block, removes the flag and add entry into created ledgers list (atomically). If a crash happens in between, the 'recoverUnderConstructionLedger' function is invoked before declaring the provider to be usable
func (*Provider) Exists ¶
Exists implements the corresponding method from interface ledger.PeerLedgerProvider
func (*Provider) Initialize ¶ added in v1.1.1
func (provider *Provider) Initialize(initializer *ledger.Initializer) error
Initialize implements the corresponding method from interface ledger.PeerLedgerProvider
Source Files
¶
Directories
¶
Path | Synopsis |
---|---|
history
|
|
historydb/historyleveldb/fakes
Code generated by counterfeiter.
|
Code generated by counterfeiter. |
txmgmt
|
|
privacyenabledstate
Package privacyenabledstate is a generated protocol buffer package.
|
Package privacyenabledstate is a generated protocol buffer package. |
queryutil/mock
Code generated by counterfeiter.
|
Code generated by counterfeiter. |
statedb/mock
Code generated by counterfeiter.
|
Code generated by counterfeiter. |