Documentation ¶
Index ¶
- func GetAnchorSuccessRatio(coreID string, state *types.AnchorState) (float64, error)
- func GetCalSuccessRatio(coreID string, state *types.AnchorState) (float64, error)
- func GetJWKChanges(coreID string, state *types.AnchorState) (int64, error)
- func GetLastNSubmitters(n int64, state types.AnchorState) map[string]int64
- func GetPubKeyHex(coreID string, state types.AnchorState) string
- func GetValidationRecord(coreID string, state types.AnchorState) (string, types.TxValidation, error)
- func IncrementFailedAnchor(coreID string, state *types.AnchorState) error
- func IncrementSuccessAnchor(coreID string, state *types.AnchorState) error
- func IsHabitualViolator(limit types.RateLimit) bool
- func IsValidBtcc(tx types.Tx, state types.AnchorState) bool
- func IsValidator(ID string, state *types.AnchorState) (amValidator bool)
- func NewTxValidation() types.TxValidation
- func NewTxValidationMap() map[string]types.TxValidation
- func RateLimitUpdate(currHeight int64, limit *types.RateLimit)
- func SetValidationRecord(coreID string, validationRecord types.TxValidation, state *types.AnchorState) error
- func UpdateAcceptTx(limit *types.RateLimit)
- func Validate(incoming []byte, state *types.AnchorState) (types.Tx, bool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAnchorSuccessRatio ¶
func GetAnchorSuccessRatio(coreID string, state *types.AnchorState) (float64, error)
func GetCalSuccessRatio ¶
func GetCalSuccessRatio(coreID string, state *types.AnchorState) (float64, error)
func GetJWKChanges ¶
func GetJWKChanges(coreID string, state *types.AnchorState) (int64, error)
func GetLastNSubmitters ¶
func GetLastNSubmitters(n int64, state types.AnchorState) map[string]int64
GetLastNSubmitters : Given a past block range, get map of Cores that have submitted CAL tx
func GetPubKeyHex ¶
func GetPubKeyHex(coreID string, state types.AnchorState) string
GetPubKeyHex : Gets the public key of a core, given the CoreID string
func GetValidationRecord ¶
func GetValidationRecord(coreID string, state types.AnchorState) (string, types.TxValidation, error)
GetValidationRecord : Gets a validation record for a Core, given the CoreID
func IncrementFailedAnchor ¶
func IncrementFailedAnchor(coreID string, state *types.AnchorState) error
IncrementFailedAnchor : increments the successful anchor record, given a coreID string and a pointer to state db
func IncrementSuccessAnchor ¶
func IncrementSuccessAnchor(coreID string, state *types.AnchorState) error
IncrementSuccessAnchor : increments the successful anchor record, given a coreID string and a pointer to state db
func IsHabitualViolator ¶
IsHabitualViolator : find out if the core has been violating rate limits
func IsValidBtcc ¶
func IsValidBtcc(tx types.Tx, state types.AnchorState) bool
IsValidBtcc : Check if BTCC tx corresponds to a previous BTC-A
func IsValidator ¶
func IsValidator(ID string, state *types.AnchorState) (amValidator bool)
IsValidator : determines if a node is a validator by checking an external ID
func NewTxValidation ¶
func NewTxValidation() types.TxValidation
NewTxValidation : initialize values for validation of tx
func NewTxValidationMap ¶
func NewTxValidationMap() map[string]types.TxValidation
NewTxValidationMap : initialize record keeping for validations
func RateLimitUpdate ¶
RateLimitUpdate : simple token bucket rate limiter
func SetValidationRecord ¶
func SetValidationRecord(coreID string, validationRecord types.TxValidation, state *types.AnchorState) error
SetValidationRecord : sets a validation record on the state db pointer
func UpdateAcceptTx ¶
UpdateAcceptTx : Update successful acceptance of Tx for rate limiting
Types ¶
This section is empty.