Documentation ¶
Index ¶
- type Store
- func (s *Store) AddHostScans(scans []explorer.HostScan) error
- func (s *Store) AddressEvents(address types.Address, offset, limit uint64) (events []explorer.Event, err error)
- func (s *Store) Balance(address types.Address) (sc types.Currency, immatureSC types.Currency, sf uint64, err error)
- func (s *Store) BestTip(height uint64) (result types.ChainIndex, err error)
- func (s *Store) Block(id types.BlockID) (result explorer.Block, err error)
- func (s *Store) Close() error
- func (s *Store) ContractRevisions(id types.FileContractID) (revisions []explorer.ExtendedFileContract, err error)
- func (s *Store) Contracts(ids []types.FileContractID) (result []explorer.ExtendedFileContract, err error)
- func (s *Store) ContractsKey(key types.PublicKey) (result []explorer.ExtendedFileContract, err error)
- func (s *Store) HostMetrics() (result explorer.HostMetrics, err error)
- func (st *Store) Hosts(pks []types.PublicKey) (result []explorer.Host, err error)
- func (s *Store) HostsForScanning(maxLastScan, minLastAnnouncement time.Time, offset, limit uint64) (result []explorer.Host, err error)
- func (s *Store) MerkleProof(leafIndex uint64) (proof []types.Hash256, err error)
- func (s *Store) Metrics(id types.BlockID) (result explorer.Metrics, err error)
- func (s *Store) SiacoinElements(ids []types.SiacoinOutputID) (result []explorer.SiacoinOutput, err error)
- func (s *Store) SiafundElements(ids []types.SiafundOutputID) (result []explorer.SiafundOutput, err error)
- func (s *Store) Tip() (result types.ChainIndex, err error)
- func (s *Store) TransactionChainIndices(txnID types.TransactionID, offset, limit uint64) (indices []types.ChainIndex, err error)
- func (s *Store) Transactions(ids []types.TransactionID) (results []explorer.Transaction, err error)
- func (s *Store) UnspentSiacoinOutputs(address types.Address, offset, limit uint64) (result []explorer.SiacoinOutput, err error)
- func (s *Store) UnspentSiafundOutputs(address types.Address, offset, limit uint64) (result []explorer.SiafundOutput, err error)
- func (s *Store) UpdateChainState(reverted []chain.RevertUpdate, applied []chain.ApplyUpdate) error
- func (s *Store) V2ContractRevisions(id types.FileContractID) (revisions []explorer.V2FileContract, err error)
- func (s *Store) V2Contracts(ids []types.FileContractID) (result []explorer.V2FileContract, err error)
- func (s *Store) V2ContractsKey(key types.PublicKey) (result []explorer.V2FileContract, err error)
- func (s *Store) V2TransactionChainIndices(txnID types.TransactionID, offset, limit uint64) (indices []types.ChainIndex, err error)
- func (s *Store) V2Transactions(ids []types.TransactionID) (results []explorer.V2Transaction, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
A Store is a persistent store that uses a SQL database as its backend.
func OpenDatabase ¶
OpenDatabase creates a new SQLite store and initializes the database. If the database does not exist, it is created.
func (*Store) AddHostScans ¶
AddHostScans implements explorer.Store
func (*Store) AddressEvents ¶
func (s *Store) AddressEvents(address types.Address, offset, limit uint64) (events []explorer.Event, err error)
AddressEvents returns the events of a single address.
func (*Store) Balance ¶
func (s *Store) Balance(address types.Address) (sc types.Currency, immatureSC types.Currency, sf uint64, err error)
Balance implements explorer.Store.
func (*Store) BestTip ¶
func (s *Store) BestTip(height uint64) (result types.ChainIndex, err error)
BestTip implements explorer.Store.
func (*Store) ContractRevisions ¶
func (s *Store) ContractRevisions(id types.FileContractID) (revisions []explorer.ExtendedFileContract, err error)
ContractRevisions implements explorer.Store.
func (*Store) Contracts ¶
func (s *Store) Contracts(ids []types.FileContractID) (result []explorer.ExtendedFileContract, err error)
Contracts implements explorer.Store.
func (*Store) ContractsKey ¶
func (s *Store) ContractsKey(key types.PublicKey) (result []explorer.ExtendedFileContract, err error)
ContractsKey implements explorer.Store.
func (*Store) HostMetrics ¶
func (s *Store) HostMetrics() (result explorer.HostMetrics, err error)
HostMetrics implements explorer.Store
func (*Store) HostsForScanning ¶
func (s *Store) HostsForScanning(maxLastScan, minLastAnnouncement time.Time, offset, limit uint64) (result []explorer.Host, err error)
HostsForScanning returns hosts ordered by the transaction they were created in. Note that only the PublicKey, NetAddress, and V2NetAddresses fields are populated.
func (*Store) MerkleProof ¶
MerkleProof implements explorer.Store.
func (*Store) SiacoinElements ¶
func (s *Store) SiacoinElements(ids []types.SiacoinOutputID) (result []explorer.SiacoinOutput, err error)
SiacoinElements implements explorer.Store.
func (*Store) SiafundElements ¶
func (s *Store) SiafundElements(ids []types.SiafundOutputID) (result []explorer.SiafundOutput, err error)
SiafundElements implements explorer.Store.
func (*Store) Tip ¶
func (s *Store) Tip() (result types.ChainIndex, err error)
Tip implements explorer.Store.
func (*Store) TransactionChainIndices ¶
func (s *Store) TransactionChainIndices(txnID types.TransactionID, offset, limit uint64) (indices []types.ChainIndex, err error)
TransactionChainIndices returns the chain indices of the blocks the transaction was included in. If the transaction has not been included in any blocks, the result will be nil,nil.
func (*Store) Transactions ¶
func (s *Store) Transactions(ids []types.TransactionID) (results []explorer.Transaction, err error)
Transactions implements explorer.Store.
func (*Store) UnspentSiacoinOutputs ¶
func (s *Store) UnspentSiacoinOutputs(address types.Address, offset, limit uint64) (result []explorer.SiacoinOutput, err error)
UnspentSiacoinOutputs implements explorer.Store.
func (*Store) UnspentSiafundOutputs ¶
func (s *Store) UnspentSiafundOutputs(address types.Address, offset, limit uint64) (result []explorer.SiafundOutput, err error)
UnspentSiafundOutputs implements explorer.Store.
func (*Store) UpdateChainState ¶
func (s *Store) UpdateChainState(reverted []chain.RevertUpdate, applied []chain.ApplyUpdate) error
UpdateChainState implements explorer.Store
func (*Store) V2ContractRevisions ¶
func (s *Store) V2ContractRevisions(id types.FileContractID) (revisions []explorer.V2FileContract, err error)
V2ContractRevisions implements explorer.Store.
func (*Store) V2Contracts ¶
func (s *Store) V2Contracts(ids []types.FileContractID) (result []explorer.V2FileContract, err error)
V2Contracts implements explorer.Store.
func (*Store) V2ContractsKey ¶
V2ContractsKey implements explorer.Store.
func (*Store) V2TransactionChainIndices ¶
func (s *Store) V2TransactionChainIndices(txnID types.TransactionID, offset, limit uint64) (indices []types.ChainIndex, err error)
V2TransactionChainIndices returns the chain indices of the blocks the v2 transaction was included in. If the transaction has not been included in any blocks, the result will be nil,nil.
func (*Store) V2Transactions ¶
func (s *Store) V2Transactions(ids []types.TransactionID) (results []explorer.V2Transaction, err error)
V2Transactions implements explorer.Store.