Documentation ¶
Index ¶
- Variables
- type BlobStore
- type CachedDB
- func (db *CachedDB) CacheMalfeasanceProof(id types.NodeID, proof *wire.MalfeasanceProof)
- func (db *CachedDB) GetAtxHeader(id types.ATXID) (*types.ActivationTxHeader, error)
- func (db *CachedDB) GetFullAtx(id types.ATXID) (*types.VerifiedActivationTx, error)
- func (db *CachedDB) GetMalfeasanceProof(id types.NodeID) (*wire.MalfeasanceProof, error)
- func (db *CachedDB) IsMalicious(id types.NodeID) (bool, error)
- func (db *CachedDB) IterateEpochATXHeaders(epoch types.EpochID, iter func(*types.ActivationTxHeader) error) error
- func (db *CachedDB) IterateMalfeasanceProofs(iter func(types.NodeID, *wire.MalfeasanceProof) error) error
- func (db *CachedDB) MalfeasanceCacheSize() int
- func (db *CachedDB) MaxHeightAtx() (types.ATXID, error)
- func (db *CachedDB) VRFNonce(id types.NodeID, epoch types.EpochID) (types.VRFPostIndex, error)
- type Config
- type Executor
- type Hint
- type Opt
- type VrfNonceKey
Constants ¶
This section is empty.
Variables ¶
var ErrNotFound = errors.New("not found")
Functions ¶
This section is empty.
Types ¶
type BlobStore ¶
BlobStore gets data as a blob to serve direct fetch requests.
func NewBlobStore ¶
NewBlobStore returns a BlobStore.
func (*BlobStore) GetBlobSizes ¶ added in v1.4.1
GetBlobSizes returns the sizes of the blobs corresponding to the specified ids. For non-existent objects, the corresponding items are set to -1.
type CachedDB ¶
type CachedDB struct { Executor sql.QueryCache // contains filtered or unexported fields }
CachedDB is simply a database injected with cache.
func NewCachedDB ¶
NewCachedDB create an instance of a CachedDB.
func (*CachedDB) CacheMalfeasanceProof ¶
func (db *CachedDB) CacheMalfeasanceProof(id types.NodeID, proof *wire.MalfeasanceProof)
func (*CachedDB) GetAtxHeader ¶
GetAtxHeader returns the ATX header by the given ID. This function is thread safe and will return an error if the ID is not found in the ATX DB.
func (*CachedDB) GetFullAtx ¶
GetFullAtx returns the full atx struct of the given atxId id, it returns an error if the full atx cannot be found in all databases.
func (*CachedDB) GetMalfeasanceProof ¶
GetMalfeasanceProof gets the malfeasance proof associated with the NodeID.
func (*CachedDB) IsMalicious ¶
IsMalicious returns true if the NodeID is malicious.
func (*CachedDB) IterateEpochATXHeaders ¶
func (db *CachedDB) IterateEpochATXHeaders( epoch types.EpochID, iter func(*types.ActivationTxHeader) error, ) error
IterateEpochATXHeaders iterates over ActivationTxs that target an epoch.
func (*CachedDB) IterateMalfeasanceProofs ¶ added in v1.1.0
func (*CachedDB) MalfeasanceCacheSize ¶
type Config ¶ added in v1.1.2
type Config struct { // ATXSize must be larger than the sum of all ATXs in last 2 epochs to be effective ATXSize int `mapstructure:"atx-size"` MalfeasanceSize int `mapstructure:"malfeasance-size"` }
func DefaultConfig ¶ added in v1.1.2
func DefaultConfig() Config