Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrDatastoreNotSet = fmt.Errorf("database not set") ErrRecorderDisabled = fmt.Errorf("recorder disabled") )
View Source
var ( // MaxRecordPerQuery is the max record can be query in one time MaxRecordPerQuery uint = 288 // ExpireEpoch is the num of epoch that record will be expired, default is 7 * 2880 epoch, about 7 days ExpireEpoch = abi.ChainEpoch(7 * 2880) DatastoreNamespaceKey = datastore.NewKey("/mine-record") )
View Source
var ( ErrorRecordNotFound = datastore.ErrNotFound ErrorExceedMaxRecordPerQuery = fmt.Errorf("query exceed MaxRecordPerQuery(%d)", MaxRecordPerQuery) )
Functions ¶
func SetDatastore ¶
func SetDatastore(ds datastore.Datastore)
Types ¶
type DefaultRecorder ¶
type DefaultRecorder struct {
// contains filtered or unexported fields
}
func NewDefaultRecorder ¶
func NewDefaultRecorder(ds datastore.Datastore) *DefaultRecorder
func (*DefaultRecorder) Query ¶
func (d *DefaultRecorder) Query(ctx context.Context, miner address.Address, from abi.ChainEpoch, limit uint) ([]Records, error)
func (*DefaultRecorder) Record ¶
func (d *DefaultRecorder) Record(ctx context.Context, miner address.Address, epoch abi.ChainEpoch, r Records) error
type SubRecorder ¶
func Sub ¶
func Sub(miner address.Address, epoch abi.ChainEpoch) SubRecorder
Click to show internal directories.
Click to hide internal directories.