Versions in this module Expand all Collapse all v0 v0.7.0 Nov 27, 2020 Changes in this version + const ActiveReconciliationCounter + const AddressesCreatedCounter + const BlockCounter + const DefaultBlockCacheSize + const DefaultCompressionMode + const DefaultIndexCacheSize + const DefaultLogValueSize + const DefaultMaxTableSize + const ExemptReconciliationCounter + const FailedBroadcastsCounter + const FailedReconciliationCounter + const InactiveReconciliationCounter + const OperationCounter + const OrphanCounter + const SkippedReconciliationsCounter + const StaleBroadcastsCounter + const TinyIndexCacheSize + const TransactionCounter + const TransactionsConfirmedCounter + const TransactionsCreatedCounter + var BadgerStorageErrs = []error + var BalanceStorageErrs = []error + var BlockStorageErrs = []error + var BroadcastStorageErrs = []error + var CoinStorageErrs = []error + var CompressorErrs = []error + var ErrAccountCoinQueryFailed = errors.New("unable to query coins for account") + var ErrAccountCoinStoreFailed = errors.New("unable to store account coin") + var ErrAccountIdentifierQueryFailed = errors.New("unable to query account identifier") + var ErrAccountMissing = errors.New("block nil") + var ErrAddrCheckIfExistsFailed = errors.New("unable to check if address exists") + var ErrAddrExists = errors.New("address already exists") + var ErrAddrGetFailed = errors.New("unable to get address") + var ErrAddrImportFailed = errors.New("unable to import prefunded account") + var ErrAddrNotFound = errors.New("address not found") + var ErrAddrsGetAllFailed = errors.New("unable to get addresses") + var ErrBalancePruned = errors.New("balance pruned") + var ErrBlockCopyFailed = errors.New("unable to copy block") + var ErrBlockDataDecodeFailed = errors.New("unable to decode block data for transaction") + var ErrBlockDeleteFailed = errors.New("unable to delete block") + var ErrBlockEncodeFailed = errors.New("unable to encode block") + var ErrBlockGetFailed = errors.New("unable to get block") + var ErrBlockIdentifierUpdateFailed = errors.New("unable to update head block identifier") + var ErrBlockIndexDeleteFailed = errors.New("unable to delete block index") + var ErrBlockIndexStoreFailed = errors.New("unable to store block index") + var ErrBlockNil = errors.New("block nil") + var ErrBlockNotFound = errors.New("block not found") + var ErrBlockStoreFailed = errors.New("unable to store block") + var ErrBroadcastAlreadyExists = errors.New("already broadcasting transaction") + var ErrBroadcastAtTipFailed = errors.New("unable to determine if at tip") + var ErrBroadcastCommitDeleteFailed = errors.New("unable to commit broadcast delete") + var ErrBroadcastCommitUpdateFailed = errors.New("unable to commit broadcast update") + var ErrBroadcastDBGetFailed = errors.New("unable to determine if already broadcasting transaction") + var ErrBroadcastDecodeFailed = errors.New("unable to decode broadcast") + var ErrBroadcastDeleteConfirmedTxFailed = errors.New("unable to delete confirmed broadcast") + var ErrBroadcastDeleteFailed = errors.New("unable to delete broadcast") + var ErrBroadcastEncodeFailed = errors.New("unable to encode broadcast") + var ErrBroadcastEncodeUpdateFailed = errors.New("unable to encode updated broadcast") + var ErrBroadcastFailed = errors.New("unable to broadcast pending transactions") + var ErrBroadcastFindTxFailed = errors.New("unable to determine if transaction was seen") + var ErrBroadcastGetAllFailed = errors.New("unable to get all broadcasts") + var ErrBroadcastGetCurrentBlockIdentifierFailed = errors.New("unable to get current block identifier") + var ErrBroadcastHandleFailureUnsuccessful = errors.New("unable to handle broadcast failure") + var ErrBroadcastIdentifierMismatch = errors.New("unexpected transaction hash returned by broadcast") + var ErrBroadcastInvokeBlockHandlersFailed = errors.New("unable to handle block") + var ErrBroadcastPerformFailed = errors.New("unable to perform broadcast") + var ErrBroadcastScanFailed = errors.New("unable to scan for all broadcasts") + var ErrBroadcastSetFailed = errors.New("unable to set broadcast") + var ErrBroadcastTxConfirmed = errors.New("unable to handle confirmed transaction") + var ErrBroadcastTxStale = errors.New("unable to handle stale transaction") + var ErrBroadcastUpdateFailed = errors.New("unable to update broadcast") + var ErrBufferWriteFailed = errors.New("unable to write to buffer") + var ErrCannotAccessPrunedData = errors.New("cannot access pruned data") + var ErrCannotPruneTransaction = errors.New("cannot prune transaction") + var ErrCannotRemoveOldest = errors.New("cannot remove oldest index") + var ErrCoinAddFailed = errors.New("unable to add coin") + var ErrCoinDataEncodeFailed = errors.New("unable to encode coin data") + var ErrCoinDecodeFailed = errors.New("unable to decode coin") + var ErrCoinDeleteFailed = errors.New("unable to delete coin") + var ErrCoinGetFailed = errors.New("unable to get coin") + var ErrCoinImportFailed = errors.New("unable to import coins") + var ErrCoinLookupFailed = errors.New("unable to lookup coin") + var ErrCoinNotFound = errors.New("coin not found") + var ErrCoinParseFailed = errors.New("unable to parse amount for coin") + var ErrCoinQueryFailed = errors.New("unable to query for coin") + var ErrCoinRemoveFailed = errors.New("unable to remove coin") + var ErrCoinStoreFailed = errors.New("unable to store coin") + var ErrCommitFailed = errors.New("unable to commit transaction") + var ErrCommitKeyFailed = errors.New("unable to commit new key to db") + var ErrCompressNormalFailed = errors.New("unable to compress normal") + var ErrCompressWithDictFailed = errors.New("unable to compress with dictionary") + var ErrCompressorLoadFailed = errors.New("unable to load compressor") + var ErrCopyBlockFailed = errors.New("unable to copy block") + var ErrCreateTempDirectoryFailed = errors.New("unable to create temporary directory") + var ErrCurrentBlockGetFailed = errors.New("unable to get current block identifier") + var ErrDBCloseFailed = errors.New("unable to close database") + var ErrDatabaseOpenFailed = errors.New("unable to open database") + var ErrDecompressFailed = errors.New("unable to decompress") + var ErrDecompressOutputMismatch = errors.New("decompressed dictionary output does not match") + var ErrDecompressSaveUnsuccessful = errors.New("unable to store decompressed file") + var ErrDecompressWithDictFailed = errors.New("unable to decompress with dictionary") + var ErrDetermineSigTypeFailed = errors.New("cannot determine signature type for payload") + var ErrDuplicateCoinFound = errors.New("duplicate coin found") + var ErrDuplicateKey = errors.New("duplicate key") + var ErrDuplicateTransactionHash = errors.New("duplicate transaction hash") + var ErrHeadBlockGetFailed = errors.New("unable to get head block") + var ErrHeadBlockIdentifierUpdateFailed = errors.New("unable to update head block identifier") + var ErrHeadBlockNotFound = errors.New("head block not found") + var ErrInvalidLiveBalance = errors.New("invalid live balance") + var ErrInvokeZSTDFailed = errors.New("unable to start zstd") + var ErrJobAddFailed = errors.New("unable to add job") + var ErrJobDecodeFailed = errors.New("unable to decode job") + var ErrJobDoesNotExist = errors.New("job does not exist") + var ErrJobEncodeFailed = errors.New("unable to encode job") + var ErrJobGetFailed = errors.New("unable to get job") + var ErrJobIdentifierDecodeFailed = errors.New("unable to decode existing identifier") + var ErrJobIdentifierEncodeFailed = errors.New("unable to encode job identifier") + var ErrJobIdentifierGetFailed = errors.New("unable to get next identifier") + var ErrJobIdentifierNotFound = errors.New("identifier not found") + var ErrJobIdentifierRemoveFailed = errors.New("unable to remove identifier") + var ErrJobIdentifierUpdateFailed = errors.New("unable to update job identifier") + var ErrJobIdentifiersEncodeAllFailed = errors.New("unable to encode identifiers") + var ErrJobIdentifiersSetAllFailed = errors.New("unable to set identifiers") + var ErrJobMetadataUpdateFailed = errors.New("unable to update metadata") + var ErrJobRemoveFailed = errors.New("unable to remove job") + var ErrJobUpdateFailed = errors.New("unable to update job") + var ErrJobUpdateOldFailed = errors.New("unable to update terminal job") + var ErrJobsGetAllFailed = errors.New("unable to get all jobs") + var ErrKeyGetFailed = errors.New("unable to get key") + var ErrKeyScanFailed = errors.New("database scan for keys failed") + var ErrLastProcessedBlockPrecedesStart = errors.New("last processed block is less than start index") + var ErrLoadDictFailed = errors.New("unable to load dictionary") + var ErrLoadFileUnsuccessful = errors.New("unable to load file") + var ErrMaxEntries = errors.New("max entries reached") + var ErrNegativeBalance = errors.New("negative balance") + var ErrNoAddrAvailable = errors.New("no addresses available") + var ErrNoEntriesFoundInNamespace = errors.New("found 0 entries for namespace") + var ErrNothingToPrune = errors.New("nothing to prune") + var ErrObjectDecodeFailed = errors.New("unable to decode object") + var ErrObjectEncodeFailed = errors.New("unable to encode object") + var ErrOldestIndexMissing = errors.New("oldest index missing") + var ErrOldestIndexRead = errors.New("cannot read oldest index") + var ErrOldestIndexUpdateFailed = errors.New("oldest index update failed") + var ErrOperationParseFailed = errors.New("unable to parse operation success") + var ErrParseKeyPairFailed = errors.New("unable to parse key pair") + var ErrParseSavedKeyFailed = errors.New("unable to parse saved key") + var ErrPrefundedAcctStoreFailed = errors.New("unable to store prefunded account") + var ErrPruningFailed = errors.New("pruning failed") + var ErrRawCompressFailed = errors.New("unable to compress raw bytes") + var ErrRawDecodeFailed = errors.New("unable to decode bytes") + var ErrRawDecompressFailed = errors.New("unable to decompress raw bytes") + var ErrReaderCloseFailed = errors.New("unable to close reader") + var ErrRecompressFailed = errors.New("unable to recompress") + var ErrReconciliationUpdateCommitFailed = errors.New("unable to commit last reconciliation update") + var ErrScanFailed = errors.New("unable to scan") + var ErrScanGetValueFailed = errors.New("unable to get value for key") + var ErrScanWorkerFailed = errors.New("worker failed") + var ErrSerializeKeyFailed = errors.New("unable to serialize key") + var ErrSignPayloadFailed = errors.New("unable to to sign payload") + var ErrSignerCreateFailed = errors.New("unable to create signer") + var ErrStoreKeyFailed = errors.New("unable to store key") + var ErrTrainZSTDFailed = errors.New("unable to train zstd") + var ErrTransactionDBQueryFailed = errors.New("unable to query database for transaction") + var ErrTransactionDataEncodeFailed = errors.New("unable to encode transaction data") + var ErrTransactionDeleteFailed = errors.New("could not remove transaction") + var ErrTransactionDoesNotExistInBlock = errors.New("transaction does not exist in block") + var ErrTransactionGetFailed = errors.New("could not get transaction") + var ErrTransactionHashContentsDecodeFailed = errors.New("could not decode transaction hash contents") + var ErrTransactionHashNotFound = errors.New("saved blocks at transaction does not contain transaction hash") + var ErrTransactionHashStoreFailed = errors.New("unable to store transaction hash") + var ErrTransactionNotFound = errors.New("unable to find transaction") + var ErrUTXOBalanceGetFailed = errors.New("unable to get utxo balance") + var ErrUnableToDetermineIfSkipOperation = errors.New("unable to to determine if should skip operation") + var ErrWalkFilesFailed = errors.New("unable to walk files") + var ErrWriterCloseFailed = errors.New("unable to close writer") + var JobStorageErrs = []error + var KeyStorageErrs = []error + func BadgerTrain(ctx context.Context, namespace string, db string, output string, ...) (float64, float64, error) + func DefaultBadgerOptions(dir string) badger.Options + func Err(err error) (bool, string) + func GetAccountKey(account *types.AccountIdentifier, currency *types.Currency) []byte + func GetHistoricalBalanceKey(account *types.AccountIdentifier, currency *types.Currency, blockIndex int64) []byte + func GetHistoricalBalancePrefix(account *types.AccountIdentifier, currency *types.Currency) []byte + func PerformanceBadgerOptions(dir string) badger.Options + type AccountCoin struct + Account *types.AccountIdentifier + Coin *types.Coin + type BadgerOption func(b *BadgerStorage) + func WithCompressorEntries(entries []*CompressorEntry) BadgerOption + func WithCustomSettings(settings badger.Options) BadgerOption + func WithIndexCacheSize(size int64) BadgerOption + func WithWriterShards(shards int) BadgerOption + func WithoutCompression() BadgerOption + type BadgerStorage struct + func (b *BadgerStorage) Close(ctx context.Context) error + func (b *BadgerStorage) Encoder() *Encoder + func (b *BadgerStorage) ReadTransaction(ctx context.Context) DatabaseTransaction + func (b *BadgerStorage) Transaction(ctx context.Context) DatabaseTransaction + func (b *BadgerStorage) WriteTransaction(ctx context.Context, identifier string, priority bool) DatabaseTransaction + type BadgerTransaction struct + func (b *BadgerTransaction) Commit(context.Context) error + func (b *BadgerTransaction) Delete(ctx context.Context, key []byte) error + func (b *BadgerTransaction) Discard(context.Context) + func (b *BadgerTransaction) Get(ctx context.Context, key []byte) (bool, []byte, error) + func (b *BadgerTransaction) Scan(ctx context.Context, prefix []byte, seekStart []byte, ...) (int, error) + func (b *BadgerTransaction) Set(ctx context.Context, key []byte, value []byte, reclaimValue bool) error + type BalanceStorage struct + func NewBalanceStorage(db Database) *BalanceStorage + func (b *BalanceStorage) AddingBlock(ctx context.Context, block *types.Block, transaction DatabaseTransaction) (CommitWorker, error) + func (b *BalanceStorage) BootstrapBalances(ctx context.Context, bootstrapBalancesFile string, ...) error + func (b *BalanceStorage) GetAllAccountCurrency(ctx context.Context) ([]*types.AccountCurrency, error) + func (b *BalanceStorage) GetBalance(ctx context.Context, account *types.AccountIdentifier, ...) (*types.Amount, error) + func (b *BalanceStorage) GetBalanceTransactional(ctx context.Context, dbTx DatabaseTransaction, ...) (*types.Amount, error) + func (b *BalanceStorage) GetOrSetBalance(ctx context.Context, account *types.AccountIdentifier, ...) (*types.Amount, error) + func (b *BalanceStorage) GetOrSetBalanceTransactional(ctx context.Context, dbTx DatabaseTransaction, ...) (*types.Amount, error) + func (b *BalanceStorage) Initialize(helper BalanceStorageHelper, handler BalanceStorageHandler) + func (b *BalanceStorage) OrphanBalance(ctx context.Context, dbTransaction DatabaseTransaction, ...) error + func (b *BalanceStorage) PruneBalances(ctx context.Context, account *types.AccountIdentifier, ...) error + func (b *BalanceStorage) Reconciled(ctx context.Context, account *types.AccountIdentifier, ...) error + func (b *BalanceStorage) ReconciliationCoverage(ctx context.Context, minimumIndex int64) (float64, error) + func (b *BalanceStorage) RemovingBlock(ctx context.Context, block *types.Block, transaction DatabaseTransaction) (CommitWorker, error) + func (b *BalanceStorage) SetBalance(ctx context.Context, dbTransaction DatabaseTransaction, ...) error + func (b *BalanceStorage) SetBalanceImported(ctx context.Context, helper BalanceStorageHelper, ...) error + func (b *BalanceStorage) UpdateBalance(ctx context.Context, dbTransaction DatabaseTransaction, ...) error + func (b *BalanceStorage) UpdateBalances(ctx context.Context, dbTransaction DatabaseTransaction, ...) error + type BalanceStorageHandler interface + BlockAdded func(ctx context.Context, block *types.Block, changes []*parser.BalanceChange) error + BlockRemoved func(ctx context.Context, block *types.Block, changes []*parser.BalanceChange) error + type BalanceStorageHelper interface + AccountBalance func(ctx context.Context, account *types.AccountIdentifier, ...) (*types.Amount, error) + Asserter func() *asserter.Asserter + BalanceExemptions func() []*types.BalanceExemption + ExemptFunc func() parser.ExemptOperation + type BlockStorage struct + func NewBlockStorage(db Database) *BlockStorage + func (b *BlockStorage) AddBlock(ctx context.Context, block *types.Block) error + func (b *BlockStorage) AtTip(ctx context.Context, tipDelay int64) (bool, *types.BlockIdentifier, error) + func (b *BlockStorage) AtTipTransactional(ctx context.Context, tipDelay int64, txn DatabaseTransaction) (bool, *types.BlockIdentifier, error) + func (b *BlockStorage) CanonicalBlock(ctx context.Context, blockIdentifier *types.BlockIdentifier) (bool, error) + func (b *BlockStorage) CanonicalBlockTransactional(ctx context.Context, blockIdentifier *types.BlockIdentifier, ...) (bool, error) + func (b *BlockStorage) CreateBlockCache(ctx context.Context, blocks int) []*types.BlockIdentifier + func (b *BlockStorage) FindTransaction(ctx context.Context, transactionIdentifier *types.TransactionIdentifier, ...) (*types.BlockIdentifier, *types.Transaction, error) + func (b *BlockStorage) GetBlock(ctx context.Context, blockIdentifier *types.PartialBlockIdentifier) (*types.Block, error) + func (b *BlockStorage) GetBlockLazy(ctx context.Context, blockIdentifier *types.PartialBlockIdentifier) (*types.BlockResponse, error) + func (b *BlockStorage) GetBlockLazyTransactional(ctx context.Context, blockIdentifier *types.PartialBlockIdentifier, ...) (*types.BlockResponse, error) + func (b *BlockStorage) GetBlockTransaction(ctx context.Context, blockIdentifier *types.BlockIdentifier, ...) (*types.Transaction, error) + func (b *BlockStorage) GetBlockTransactional(ctx context.Context, dbTx DatabaseTransaction, ...) (*types.Block, error) + func (b *BlockStorage) GetHeadBlockIdentifier(ctx context.Context) (*types.BlockIdentifier, error) + func (b *BlockStorage) GetHeadBlockIdentifierTransactional(ctx context.Context, transaction DatabaseTransaction) (*types.BlockIdentifier, error) + func (b *BlockStorage) GetOldestBlockIndex(ctx context.Context) (int64, error) + func (b *BlockStorage) GetOldestBlockIndexTransactional(ctx context.Context, dbTx DatabaseTransaction) (int64, error) + func (b *BlockStorage) IndexAtTip(ctx context.Context, tipDelay int64, index int64) (bool, error) + func (b *BlockStorage) Initialize(workers []BlockWorker) + func (b *BlockStorage) Prune(ctx context.Context, index int64, minDepth int64) (int64, int64, error) + func (b *BlockStorage) RemoveBlock(ctx context.Context, blockIdentifier *types.BlockIdentifier) error + func (b *BlockStorage) SetNewStartIndex(ctx context.Context, startIndex int64) error + func (b *BlockStorage) StoreHeadBlockIdentifier(ctx context.Context, transaction DatabaseTransaction, ...) error + type BlockWorker interface + AddingBlock func(context.Context, *types.Block, DatabaseTransaction) (CommitWorker, error) + RemovingBlock func(context.Context, *types.Block, DatabaseTransaction) (CommitWorker, error) + type BootstrapBalance struct + Account *types.AccountIdentifier + Currency *types.Currency + Value string + type Broadcast struct + Broadcasts int + ConfirmationDepth int64 + Identifier string + Intent []*types.Operation + LastBroadcast *types.BlockIdentifier + NetworkIdentifier *types.NetworkIdentifier + Payload string + TransactionIdentifier *types.TransactionIdentifier + type BroadcastStorage struct + func NewBroadcastStorage(db Database, staleDepth int64, broadcastLimit int, tipDelay int64, ...) *BroadcastStorage + func (b *BroadcastStorage) AddingBlock(ctx context.Context, block *types.Block, transaction DatabaseTransaction) (CommitWorker, error) + func (b *BroadcastStorage) Broadcast(ctx context.Context, dbTx DatabaseTransaction, identifier string, ...) error + func (b *BroadcastStorage) BroadcastAll(ctx context.Context, onlyEligible bool) error + func (b *BroadcastStorage) ClearBroadcasts(ctx context.Context) ([]*Broadcast, error) + func (b *BroadcastStorage) GetAllBroadcasts(ctx context.Context) ([]*Broadcast, error) + func (b *BroadcastStorage) Initialize(helper BroadcastStorageHelper, handler BroadcastStorageHandler) + func (b *BroadcastStorage) LockedAccounts(ctx context.Context, dbTx DatabaseTransaction) ([]*types.AccountIdentifier, error) + func (b *BroadcastStorage) RemovingBlock(ctx context.Context, block *types.Block, transaction DatabaseTransaction) (CommitWorker, error) + type BroadcastStorageHandler interface + BroadcastFailed func(context.Context, DatabaseTransaction, string, *types.TransactionIdentifier, ...) error + TransactionConfirmed func(context.Context, DatabaseTransaction, string, *types.BlockIdentifier, ...) error + TransactionStale func(context.Context, DatabaseTransaction, string, *types.TransactionIdentifier) error + type BroadcastStorageHelper interface + AtTip func(context.Context, int64) (bool, error) + BroadcastTransaction func(context.Context, *types.NetworkIdentifier, string) (*types.TransactionIdentifier, error) + CurrentBlockIdentifier func(context.Context) (*types.BlockIdentifier, error) + FindTransaction func(context.Context, *types.TransactionIdentifier, DatabaseTransaction) (*types.BlockIdentifier, *types.Transaction, error) + type BufferPool struct + func NewBufferPool() *BufferPool + func (p *BufferPool) Get() *bytes.Buffer + func (p *BufferPool) Put(buffer *bytes.Buffer) + func (p *BufferPool) PutByteSlice(buffer []byte) + type CoinStorage struct + func NewCoinStorage(db Database, helper CoinStorageHelper, asserter *asserter.Asserter) *CoinStorage + func (c *CoinStorage) AddCoins(ctx context.Context, accountCoins []*AccountCoin) error + func (c *CoinStorage) AddingBlock(ctx context.Context, block *types.Block, transaction DatabaseTransaction) (CommitWorker, error) + func (c *CoinStorage) GetCoin(ctx context.Context, coinIdentifier *types.CoinIdentifier) (*types.Coin, *types.AccountIdentifier, error) + func (c *CoinStorage) GetCoinTransactional(ctx context.Context, dbTx DatabaseTransaction, ...) (*types.Coin, *types.AccountIdentifier, error) + func (c *CoinStorage) GetCoins(ctx context.Context, accountIdentifier *types.AccountIdentifier) ([]*types.Coin, *types.BlockIdentifier, error) + func (c *CoinStorage) GetCoinsTransactional(ctx context.Context, dbTx DatabaseTransaction, ...) ([]*types.Coin, *types.BlockIdentifier, error) + func (c *CoinStorage) GetLargestCoin(ctx context.Context, accountIdentifier *types.AccountIdentifier, ...) (*big.Int, *types.CoinIdentifier, *types.BlockIdentifier, error) + func (c *CoinStorage) RemovingBlock(ctx context.Context, block *types.Block, transaction DatabaseTransaction) (CommitWorker, error) + func (c *CoinStorage) SetCoinsImported(ctx context.Context, accountBalances []*utils.AccountBalance) error + type CoinStorageHelper interface + CurrentBlockIdentifier func(context.Context, DatabaseTransaction) (*types.BlockIdentifier, error) + type CommitWorker func(context.Context) error + type CompressorEntry struct + DictionaryPath string + Namespace string + type CounterStorage struct + func NewCounterStorage(db Database) *CounterStorage + func (c *CounterStorage) AddingBlock(ctx context.Context, block *types.Block, transaction DatabaseTransaction) (CommitWorker, error) + func (c *CounterStorage) Get(ctx context.Context, counter string) (*big.Int, error) + func (c *CounterStorage) RemovingBlock(ctx context.Context, block *types.Block, transaction DatabaseTransaction) (CommitWorker, error) + func (c *CounterStorage) Update(ctx context.Context, counter string, amount *big.Int) (*big.Int, error) + func (c *CounterStorage) UpdateTransactional(ctx context.Context, dbTx DatabaseTransaction, counter string, amount *big.Int) (*big.Int, error) + type Database interface + Close func(context.Context) error + Encoder func() *Encoder + ReadTransaction func(context.Context) DatabaseTransaction + Transaction func(context.Context) DatabaseTransaction + WriteTransaction func(ctx context.Context, identifier string, priority bool) DatabaseTransaction + func NewBadgerStorage(ctx context.Context, dir string, storageOptions ...BadgerOption) (Database, error) + type DatabaseTransaction interface + Commit func(context.Context) error + Delete func(context.Context, []byte) error + Discard func(context.Context) + Get func(context.Context, []byte) (bool, []byte, error) + Scan func(context.Context, []byte, []byte, func([]byte, []byte) error, bool, bool) (int, error) + Set func(context.Context, []byte, []byte, bool) error + type Encoder struct + func NewEncoder(entries []*CompressorEntry, pool *BufferPool, compress bool) (*Encoder, error) + func (e *Encoder) Decode(namespace string, input []byte, object interface{}, reclaimInput bool) error + func (e *Encoder) DecodeAccountCoin(b []byte, accountCoin *AccountCoin, reclaimInput bool) error + func (e *Encoder) DecodeRaw(namespace string, input []byte) ([]byte, error) + func (e *Encoder) Encode(namespace string, object interface{}) ([]byte, error) + func (e *Encoder) EncodeAccountCoin(accountCoin *AccountCoin) ([]byte, error) + func (e *Encoder) EncodeRaw(namespace string, input []byte) ([]byte, error) + type JobStorage struct + func NewJobStorage(db Database) *JobStorage + func (j *JobStorage) AllCompleted(ctx context.Context) ([]*job.Job, error) + func (j *JobStorage) AllFailed(ctx context.Context) ([]*job.Job, error) + func (j *JobStorage) AllProcessing(ctx context.Context) ([]*job.Job, error) + func (j *JobStorage) Broadcasting(ctx context.Context, dbTx DatabaseTransaction) ([]*job.Job, error) + func (j *JobStorage) Completed(ctx context.Context, workflow string) ([]*job.Job, error) + func (j *JobStorage) Failed(ctx context.Context, workflow string) ([]*job.Job, error) + func (j *JobStorage) Get(ctx context.Context, dbTx DatabaseTransaction, identifier string) (*job.Job, error) + func (j *JobStorage) Processing(ctx context.Context, dbTx DatabaseTransaction, workflow string) ([]*job.Job, error) + func (j *JobStorage) Ready(ctx context.Context, dbTx DatabaseTransaction) ([]*job.Job, error) + func (j *JobStorage) Update(ctx context.Context, dbTx DatabaseTransaction, v *job.Job) (string, error) + type Key struct + Account *types.AccountIdentifier + KeyPair *keys.KeyPair + type KeyStorage struct + func NewKeyStorage(db Database) *KeyStorage + func (k *KeyStorage) Get(ctx context.Context, account *types.AccountIdentifier) (*keys.KeyPair, error) + func (k *KeyStorage) GetAllAccounts(ctx context.Context) ([]*types.AccountIdentifier, error) + func (k *KeyStorage) GetAllAccountsTransactional(ctx context.Context, dbTx DatabaseTransaction) ([]*types.AccountIdentifier, error) + func (k *KeyStorage) GetTransactional(ctx context.Context, dbTx DatabaseTransaction, ...) (*keys.KeyPair, error) + func (k *KeyStorage) ImportAccounts(ctx context.Context, accounts []*PrefundedAccount) error + func (k *KeyStorage) RandomAccount(ctx context.Context) (*types.AccountIdentifier, error) + func (k *KeyStorage) Sign(ctx context.Context, payloads []*types.SigningPayload) ([]*types.Signature, error) + func (k *KeyStorage) Store(ctx context.Context, account *types.AccountIdentifier, keyPair *keys.KeyPair) error + func (k *KeyStorage) StoreTransactional(ctx context.Context, account *types.AccountIdentifier, keyPair *keys.KeyPair, ...) error + type PrefundedAccount struct + AccountIdentifier *types.AccountIdentifier + Currency *types.Currency + CurveType types.CurveType + PrivateKeyHex string