Documentation
¶
Index ¶
- Constants
- Variables
- func Backup(db *bolt.DB) error
- func CreateBuckets(db *bolt.DB) error
- func Delete(db *bolt.DB, bucket, key []byte) error
- func DisableLog()
- func ErrBucketNotFound(bucket []byte) error
- func ErrValueNotFound(key []byte) error
- func OpenDB(storage string) (*bolt.DB, error)
- func Purge(db *bolt.DB) error
- func Upgrade(db *bolt.DB) error
- func UseLogger(logger slog.Logger)
Constants ¶
View Source
const ( // DBVersion is the latest version of the database that is understood by the // program. Databases with recorded versions higher than this will fail to // open (meaning any upgrades prevent reverting to older software). DBVersion = initialVersion )
Variables ¶
View Source
var ( // PoolBkt is the main bucket of mining pool, all other buckets // are nested within it. PoolBkt = []byte("poolbkt") // AccountBkt stores all registered accounts for the mining pool. AccountBkt = []byte("accountbkt") ShareBkt = []byte("sharebkt") // JobBkt stores jobs delivered to clients, it is periodically pruned by the // current chain tip height. JobBkt = []byte("jobbkt") // WorkBkt stores work submissions from pool clients and confirmed mined // work from the pool, it is periodically pruned by the current chain tip // adjusted by the max reorg height and by chain reorgs. WorkBkt = []byte("workbkt") // PaymentBkt stores all payments. PaymentBkt = []byte("paymentbkt") // PaymentArchiveBkt stores all processed payments for auditing purposes. PaymentArchiveBkt = []byte("paymentarchivebkt") // VersionK is the key of the current version of the database. VersionK = []byte("version") // LastPaymentCreatedOn is the key of the last time a payment was // persisted. LastPaymentCreatedOn = []byte("lastpaymentcreatedon") // LastPaymentPaidOn is the key of the last time a payment was // paid. LastPaymentPaidOn = []byte("lastpaymentpaidon") // LastPaymentHeight is the key of the last payment height. LastPaymentHeight = []byte("lastpaymentheight") // TxFeeReserve is the key of the tx fee reserve. TxFeeReserve = []byte("txfeereserve") // SoloPool is the solo pool mode key. SoloPool = []byte("solopool") // CSRFSecret is the CSRF secret key. CSRFSecret = []byte("csrfsecret") )
Functions ¶
func CreateBuckets ¶
CreateBuckets creates all storage buckets of the mining pool.
func DisableLog ¶
func DisableLog()
DisableLog disables all library log output. Logging output is disabled by default until either UseLogger or SetLogWriter are called.
func ErrBucketNotFound ¶
ErrBucketNotFound is returned when a provided database bucket cannot be found.
func ErrValueNotFound ¶
ErrValueNotFound is returned when a provided database key does not map to any value.
func OpenDB ¶
OpenDB creates a connection to the provided bolt storage, the returned connection storage should always be closed after use.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.