Documentation ¶
Index ¶
- Variables
- func GotAllActiveSporksImplemented(store store.Momentum) (justNow *definition.Spork, unimplemented []*definition.Spork, err error)
- func NewChain(chainManager db.Manager, genesis store.Genesis) *chain
- func NewMomentumPool(chainManager db.Manager, genesis store.Genesis) *momentumPool
- type AccountPool
- type Chain
- type MomentumEventListener
- type MomentumEventManager
- type MomentumPool
- type Stable
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrFailedToAddAccountBlockTransaction = errors.Errorf("failed to insert account-block-transaction") ErrPlasmaRatioIsWorse = errors.Errorf("plasma ratio is smaller for current block") ErrHashTieBreak = errors.Errorf("hash tie-break is worse for current block") // MaxAccountBlocksInMomentum takes into account batched account-blocks MaxAccountBlocksInMomentum = 100 )
Functions ¶
func GotAllActiveSporksImplemented ¶
func GotAllActiveSporksImplemented(store store.Momentum) (justNow *definition.Spork, unimplemented []*definition.Spork, err error)
Checks whatever or not all active sporks are implemented
Types ¶
type AccountPool ¶
type AccountPool interface { // AddAccountBlockTransaction implements the whole logic required to manage an account-chain. // When inserting a new account-block-transaction, is possible to trigger rollbacks of other unconfirmed account-blocks. // // Note: A confirmed account-block will never be rollback. // // In case a fork is detected, there is a deterministic way to find the longest chain, as follows: // - the account-block with the biggest TotalPlasma/BasePlasma is selected // - the account-block with the smallest hash AddAccountBlockTransaction(insertLocker sync.Locker, transaction *nom.AccountBlockTransaction) error ForceAddAccountBlockTransaction(insertLocker sync.Locker, transaction *nom.AccountBlockTransaction) error GetPatch(address types.Address, identifier types.HashHeight) db.Patch GetAccountStore(address types.Address, identifier types.HashHeight) store.Account GetFrontierAccountStore(address types.Address) store.Account GetNewMomentumContent() []*nom.AccountBlock GetAllUncommittedAccountBlocks() []*nom.AccountBlock GetUncommittedAccountBlocksByAddress(address types.Address) []*nom.AccountBlock }
func NewAccountPool ¶
func NewAccountPool(stable Stable) AccountPool
type Chain ¶
type Chain interface { Init() error Start() error Stop() error // AcquireInsert is used to limit insert operations in a global way inside the chain module. // The actual sync.Locker object returned is used for logging purposes and any method receiving such argument // does not enforce in any way the validity, only the fact that is non-nil. AcquireInsert(reason string) sync.Locker store.Genesis AccountPool MomentumPool MomentumEventManager }
type MomentumEventListener ¶
type MomentumEventListener interface { InsertMomentum(*nom.DetailedMomentum) DeleteMomentum(*nom.DetailedMomentum) }
type MomentumEventManager ¶
type MomentumEventManager interface { Register(MomentumEventListener) UnRegister(MomentumEventListener) }
type MomentumPool ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.