Documentation ¶
Index ¶
- Constants
- type BadgerStore
- func (s *BadgerStore) AddNodeOperation(tx *common.VersionedTransaction, timestamp, threshold uint64) error
- func (s *BadgerStore) CacheGetTransaction(hash crypto.Hash) (*common.VersionedTransaction, error)
- func (s *BadgerStore) CachePutTransaction(tx *common.VersionedTransaction) error
- func (s *BadgerStore) CacheRemoveTransactions(hashes []crypto.Hash) error
- func (s *BadgerStore) CacheRetrieveTransactions(limit int) ([]*common.VersionedTransaction, error)
- func (s *BadgerStore) CheckDepositInput(deposit *common.DepositData, tx crypto.Hash) error
- func (s *BadgerStore) CheckGenesisLoad(snapshots []*common.SnapshotWithTopologicalOrder) (bool, error)
- func (store *BadgerStore) Close() error
- func (s *BadgerStore) ListAggregatedRoundSpaceCheckpoints(cids []crypto.Hash) (map[crypto.Hash]*common.RoundSpace, error)
- func (s *BadgerStore) ListCustodianUpdates() ([]*common.CustodianUpdateRequest, error)
- func (s *BadgerStore) ListNodeWorks(cids []crypto.Hash, day uint32) (map[crypto.Hash][2]uint64, error)
- func (s *BadgerStore) ListWorkOffsets(cids []crypto.Hash) (map[crypto.Hash]uint64, error)
- func (s *BadgerStore) LoadGenesis(rounds []*common.Round, snapshots []*common.SnapshotWithTopologicalOrder, ...) error
- func (s *BadgerStore) LockDepositInput(deposit *common.DepositData, tx crypto.Hash, fork bool) error
- func (s *BadgerStore) LockGhostKeys(keys []*crypto.Key, tx crypto.Hash, fork bool) error
- func (s *BadgerStore) LockMintInput(mint *common.MintData, tx crypto.Hash, fork bool) error
- func (s *BadgerStore) LockUTXOs(inputs []*common.Input, tx crypto.Hash, fork bool) error
- func (s *BadgerStore) OneTimeFixMintPrefix() error
- func (s *BadgerStore) ReadAllNodes(threshold uint64, withState bool) []*common.Node
- func (s *BadgerStore) ReadCustodian(ts uint64) (*common.CustodianUpdateRequest, error)
- func (s *BadgerStore) ReadDomains() []*common.Domain
- func (s *BadgerStore) ReadGhostKeyLock(key crypto.Key) (*crypto.Hash, error)
- func (s *BadgerStore) ReadLastMintDistribution(batch uint64) (*common.MintDistribution, error)
- func (s *BadgerStore) ReadLink(from, to crypto.Hash) (uint64, error)
- func (s *BadgerStore) ReadMintDistributions(offset, count uint64) ([]*common.MintDistribution, []*common.VersionedTransaction, error)
- func (s *BadgerStore) ReadNodeRoundSpacesForBatch(nodeId crypto.Hash, batch uint64) ([]*common.RoundSpace, error)
- func (s *BadgerStore) ReadRound(hash crypto.Hash) (*common.Round, error)
- func (s *BadgerStore) ReadRoundSpaceCheckpoint(nodeId crypto.Hash) (uint64, uint64, error)
- func (s *BadgerStore) ReadSnapshot(hash crypto.Hash) (*common.SnapshotWithTopologicalOrder, error)
- func (s *BadgerStore) ReadSnapshotWithTransactionsSinceTopology(topologyOffset, count uint64) ([]*common.SnapshotWithTopologicalOrder, []*common.VersionedTransaction, error)
- func (s *BadgerStore) ReadSnapshotWorksForNodeRound(nodeId crypto.Hash, round uint64) ([]*common.SnapshotWork, error)
- func (s *BadgerStore) ReadSnapshotsForNodeRound(nodeId crypto.Hash, round uint64) ([]*common.SnapshotWithTopologicalOrder, error)
- func (s *BadgerStore) ReadSnapshotsSinceTopology(topologyOffset, count uint64) ([]*common.SnapshotWithTopologicalOrder, error)
- func (s *BadgerStore) ReadTransaction(hash crypto.Hash) (*common.VersionedTransaction, string, error)
- func (s *BadgerStore) ReadUTXOKeys(hash crypto.Hash, index int) (*common.UTXOKeys, error)
- func (s *BadgerStore) ReadUTXOLock(hash crypto.Hash, index int) (*common.UTXOWithLock, error)
- func (s *BadgerStore) ReadWorkOffset(nodeId crypto.Hash) (uint64, error)
- func (s *BadgerStore) RemoveGraphEntries(prefix string) (int, error)
- func (s *BadgerStore) StartNewRound(node crypto.Hash, number uint64, references *common.RoundLink, ...) error
- func (s *BadgerStore) TopologySequence() uint64
- func (s *BadgerStore) UpdateEmptyHeadRound(node crypto.Hash, number uint64, references *common.RoundLink) error
- func (s *BadgerStore) ValidateGraphEntries(networkId crypto.Hash, depth uint64) (int, int, error)
- func (s *BadgerStore) WriteRoundSpaceAndState(space *common.RoundSpace) error
- func (s *BadgerStore) WriteRoundWork(nodeId crypto.Hash, round uint64, snapshots []*common.SnapshotWork) error
- func (s *BadgerStore) WriteSnapshot(snap *common.SnapshotWithTopologicalOrder, signers []crypto.Hash) error
- func (s *BadgerStore) WriteTransaction(ver *common.VersionedTransaction) error
- type Store
Constants ¶
View Source
const DAY_U64 = uint64(time.Hour) * 24
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BadgerStore ¶
type BadgerStore struct {
// contains filtered or unexported fields
}
func NewBadgerStore ¶
func NewBadgerStore(custom *config.Custom, dir string) (*BadgerStore, error)
func (*BadgerStore) AddNodeOperation ¶ added in v0.3.0
func (s *BadgerStore) AddNodeOperation(tx *common.VersionedTransaction, timestamp, threshold uint64) error
func (*BadgerStore) CacheGetTransaction ¶
func (s *BadgerStore) CacheGetTransaction(hash crypto.Hash) (*common.VersionedTransaction, error)
func (*BadgerStore) CachePutTransaction ¶
func (s *BadgerStore) CachePutTransaction(tx *common.VersionedTransaction) error
func (*BadgerStore) CacheRemoveTransactions ¶ added in v0.12.4
func (s *BadgerStore) CacheRemoveTransactions(hashes []crypto.Hash) error
func (*BadgerStore) CacheRetrieveTransactions ¶ added in v0.14.5
func (s *BadgerStore) CacheRetrieveTransactions(limit int) ([]*common.VersionedTransaction, error)
func (*BadgerStore) CheckDepositInput ¶
func (s *BadgerStore) CheckDepositInput(deposit *common.DepositData, tx crypto.Hash) error
func (*BadgerStore) CheckGenesisLoad ¶
func (s *BadgerStore) CheckGenesisLoad(snapshots []*common.SnapshotWithTopologicalOrder) (bool, error)
func (*BadgerStore) Close ¶
func (store *BadgerStore) Close() error
func (*BadgerStore) ListAggregatedRoundSpaceCheckpoints ¶ added in v0.14.0
func (s *BadgerStore) ListAggregatedRoundSpaceCheckpoints(cids []crypto.Hash) (map[crypto.Hash]*common.RoundSpace, error)
func (*BadgerStore) ListCustodianUpdates ¶ added in v0.16.0
func (s *BadgerStore) ListCustodianUpdates() ([]*common.CustodianUpdateRequest, error)
func (*BadgerStore) ListNodeWorks ¶ added in v0.11.0
func (*BadgerStore) ListWorkOffsets ¶ added in v0.11.6
func (*BadgerStore) LoadGenesis ¶
func (s *BadgerStore) LoadGenesis(rounds []*common.Round, snapshots []*common.SnapshotWithTopologicalOrder, transactions []*common.VersionedTransaction) error
func (*BadgerStore) LockDepositInput ¶
func (s *BadgerStore) LockDepositInput(deposit *common.DepositData, tx crypto.Hash, fork bool) error
func (*BadgerStore) LockGhostKeys ¶ added in v0.16.0
func (*BadgerStore) LockMintInput ¶ added in v0.1.1
func (*BadgerStore) OneTimeFixMintPrefix ¶ added in v0.16.0
func (s *BadgerStore) OneTimeFixMintPrefix() error
FIXME remove this in the future
func (*BadgerStore) ReadAllNodes ¶ added in v0.5.6
func (s *BadgerStore) ReadAllNodes(threshold uint64, withState bool) []*common.Node
func (*BadgerStore) ReadCustodian ¶ added in v0.16.0
func (s *BadgerStore) ReadCustodian(ts uint64) (*common.CustodianUpdateRequest, error)
func (*BadgerStore) ReadDomains ¶
func (s *BadgerStore) ReadDomains() []*common.Domain
func (*BadgerStore) ReadGhostKeyLock ¶ added in v0.16.0
func (*BadgerStore) ReadLastMintDistribution ¶ added in v0.1.1
func (s *BadgerStore) ReadLastMintDistribution(batch uint64) (*common.MintDistribution, error)
func (*BadgerStore) ReadMintDistributions ¶ added in v0.1.2
func (s *BadgerStore) ReadMintDistributions(offset, count uint64) ([]*common.MintDistribution, []*common.VersionedTransaction, error)
func (*BadgerStore) ReadNodeRoundSpacesForBatch ¶ added in v0.14.0
func (s *BadgerStore) ReadNodeRoundSpacesForBatch(nodeId crypto.Hash, batch uint64) ([]*common.RoundSpace, error)
func (*BadgerStore) ReadRoundSpaceCheckpoint ¶ added in v0.14.0
func (*BadgerStore) ReadSnapshot ¶ added in v0.2.14
func (s *BadgerStore) ReadSnapshot(hash crypto.Hash) (*common.SnapshotWithTopologicalOrder, error)
func (*BadgerStore) ReadSnapshotWithTransactionsSinceTopology ¶ added in v0.1.1
func (s *BadgerStore) ReadSnapshotWithTransactionsSinceTopology(topologyOffset, count uint64) ([]*common.SnapshotWithTopologicalOrder, []*common.VersionedTransaction, error)
func (*BadgerStore) ReadSnapshotWorksForNodeRound ¶ added in v0.11.7
func (s *BadgerStore) ReadSnapshotWorksForNodeRound(nodeId crypto.Hash, round uint64) ([]*common.SnapshotWork, error)
func (*BadgerStore) ReadSnapshotsForNodeRound ¶
func (s *BadgerStore) ReadSnapshotsForNodeRound(nodeId crypto.Hash, round uint64) ([]*common.SnapshotWithTopologicalOrder, error)
func (*BadgerStore) ReadSnapshotsSinceTopology ¶
func (s *BadgerStore) ReadSnapshotsSinceTopology(topologyOffset, count uint64) ([]*common.SnapshotWithTopologicalOrder, error)
func (*BadgerStore) ReadTransaction ¶
func (s *BadgerStore) ReadTransaction(hash crypto.Hash) (*common.VersionedTransaction, string, error)
func (*BadgerStore) ReadUTXOKeys ¶ added in v0.12.18
func (*BadgerStore) ReadUTXOLock ¶ added in v0.12.18
func (s *BadgerStore) ReadUTXOLock(hash crypto.Hash, index int) (*common.UTXOWithLock, error)
func (*BadgerStore) ReadWorkOffset ¶ added in v0.11.0
func (s *BadgerStore) ReadWorkOffset(nodeId crypto.Hash) (uint64, error)
func (*BadgerStore) RemoveGraphEntries ¶ added in v0.1.1
func (s *BadgerStore) RemoveGraphEntries(prefix string) (int, error)
func (*BadgerStore) StartNewRound ¶
func (*BadgerStore) TopologySequence ¶
func (s *BadgerStore) TopologySequence() uint64
func (*BadgerStore) UpdateEmptyHeadRound ¶
func (*BadgerStore) ValidateGraphEntries ¶ added in v0.1.14
func (*BadgerStore) WriteRoundSpaceAndState ¶ added in v0.14.0
func (s *BadgerStore) WriteRoundSpaceAndState(space *common.RoundSpace) error
func (*BadgerStore) WriteRoundWork ¶ added in v0.11.0
func (s *BadgerStore) WriteRoundWork(nodeId crypto.Hash, round uint64, snapshots []*common.SnapshotWork) error
func (*BadgerStore) WriteSnapshot ¶
func (s *BadgerStore) WriteSnapshot(snap *common.SnapshotWithTopologicalOrder, signers []crypto.Hash) error
func (*BadgerStore) WriteTransaction ¶
func (s *BadgerStore) WriteTransaction(ver *common.VersionedTransaction) error
type Store ¶
type Store interface { Close() error CheckGenesisLoad(snapshots []*common.SnapshotWithTopologicalOrder) (bool, error) LoadGenesis(rounds []*common.Round, snapshots []*common.SnapshotWithTopologicalOrder, transactions []*common.VersionedTransaction) error ReadAllNodes(threshold uint64, withState bool) []*common.Node AddNodeOperation(tx *common.VersionedTransaction, timestamp, threshold uint64) error ReadTransaction(hash crypto.Hash) (*common.VersionedTransaction, string, error) WriteTransaction(tx *common.VersionedTransaction) error StartNewRound(node crypto.Hash, number uint64, references *common.RoundLink, finalStart uint64) error UpdateEmptyHeadRound(node crypto.Hash, number uint64, references *common.RoundLink) error TopologySequence() uint64 ReadUTXOKeys(hash crypto.Hash, index int) (*common.UTXOKeys, error) ReadUTXOLock(hash crypto.Hash, index int) (*common.UTXOWithLock, error) LockUTXOs(inputs []*common.Input, tx crypto.Hash, fork bool) error CheckDepositInput(deposit *common.DepositData, tx crypto.Hash) error LockDepositInput(deposit *common.DepositData, tx crypto.Hash, fork bool) error ReadGhostKeyLock(key crypto.Key) (*crypto.Hash, error) LockGhostKeys(keys []*crypto.Key, tx crypto.Hash, fork bool) error ReadSnapshot(hash crypto.Hash) (*common.SnapshotWithTopologicalOrder, error) ReadSnapshotsSinceTopology(offset, count uint64) ([]*common.SnapshotWithTopologicalOrder, error) ReadSnapshotWithTransactionsSinceTopology(topologyOffset, count uint64) ([]*common.SnapshotWithTopologicalOrder, []*common.VersionedTransaction, error) ReadSnapshotsForNodeRound(nodeIdWithNetwork crypto.Hash, round uint64) ([]*common.SnapshotWithTopologicalOrder, error) ReadRound(hash crypto.Hash) (*common.Round, error) ReadLink(from, to crypto.Hash) (uint64, error) WriteSnapshot(*common.SnapshotWithTopologicalOrder, []crypto.Hash) error ReadDomains() []*common.Domain ReadCustodian(ts uint64) (*common.CustodianUpdateRequest, error) ListCustodianUpdates() ([]*common.CustodianUpdateRequest, error) CachePutTransaction(tx *common.VersionedTransaction) error CacheGetTransaction(hash crypto.Hash) (*common.VersionedTransaction, error) CacheRetrieveTransactions(limit int) ([]*common.VersionedTransaction, error) CacheRemoveTransactions([]crypto.Hash) error ReadLastMintDistribution(batch uint64) (*common.MintDistribution, error) LockMintInput(mint *common.MintData, tx crypto.Hash, fork bool) error ReadMintDistributions(offset, count uint64) ([]*common.MintDistribution, []*common.VersionedTransaction, error) ReadSnapshotWorksForNodeRound(nodeId crypto.Hash, round uint64) ([]*common.SnapshotWork, error) ListWorkOffsets(cids []crypto.Hash) (map[crypto.Hash]uint64, error) ListNodeWorks(cids []crypto.Hash, day uint32) (map[crypto.Hash][2]uint64, error) ReadWorkOffset(nodeId crypto.Hash) (uint64, error) WriteRoundWork(nodeId crypto.Hash, round uint64, snapshots []*common.SnapshotWork) error ReadRoundSpaceCheckpoint(nodeId crypto.Hash) (uint64, uint64, error) WriteRoundSpaceAndState(space *common.RoundSpace) error ListAggregatedRoundSpaceCheckpoints(cids []crypto.Hash) (map[crypto.Hash]*common.RoundSpace, error) ReadNodeRoundSpacesForBatch(nodeId crypto.Hash, batch uint64) ([]*common.RoundSpace, error) RemoveGraphEntries(prefix string) (int, error) ValidateGraphEntries(networkId crypto.Hash, depth uint64) (int, int, error) }
Source Files ¶
- badger.go
- badger_cache.go
- badger_custodian.go
- badger_deposit.go
- badger_domain.go
- badger_genesis.go
- badger_graph.go
- badger_mint.go
- badger_mint_fix.go
- badger_node.go
- badger_round.go
- badger_space.go
- badger_topology.go
- badger_transaction.go
- badger_utxo.go
- badger_validation.go
- badger_work.go
- interface.go
Click to show internal directories.
Click to hide internal directories.