Documentation ¶
Overview ¶
The explorer module provides a glimpse into what the Sia network currently looks like.
Index ¶
- type Explorer
- func (e *Explorer) Block(id types.BlockID) (types.Block, types.BlockHeight, bool)
- func (e *Explorer) BlockFacts(height types.BlockHeight) (modules.BlockFacts, bool)
- func (e *Explorer) Close() error
- func (e *Explorer) FileContractHistory(id types.FileContractID) (fc types.FileContract, fcrs []types.FileContractRevision, fcE bool, spE bool)
- func (e *Explorer) FileContractID(id types.FileContractID) []types.TransactionID
- func (e *Explorer) LatestBlockFacts() modules.BlockFacts
- func (e *Explorer) ProcessConsensusChange(cc modules.ConsensusChange)
- func (e *Explorer) SiacoinOutput(id types.SiacoinOutputID) (types.SiacoinOutput, bool)
- func (e *Explorer) SiacoinOutputID(id types.SiacoinOutputID) []types.TransactionID
- func (e *Explorer) SiafundOutput(id types.SiafundOutputID) (types.SiafundOutput, bool)
- func (e *Explorer) SiafundOutputID(id types.SiafundOutputID) []types.TransactionID
- func (e *Explorer) Transaction(id types.TransactionID) (types.Block, types.BlockHeight, bool)
- func (e *Explorer) UnlockHash(uh types.UnlockHash) []types.TransactionID
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Explorer ¶
type Explorer struct {
// contains filtered or unexported fields
}
An Explorer contains a more comprehensive view of the blockchain, including various statistics and metrics.
func New ¶
func New(cs modules.ConsensusSet, persistDir string) (*Explorer, error)
New creates the internal data structures, and subscribes to consensus for changes to the blockchain
func (*Explorer) Block ¶
Block takes a block ID and finds the corresponding block, provided that the block is in the consensus set.
func (*Explorer) BlockFacts ¶
func (e *Explorer) BlockFacts(height types.BlockHeight) (modules.BlockFacts, bool)
BlockFacts returns a set of statistics about the blockchain as they appeared at a given block height, and a bool indicating whether facts exist for the given height.
func (*Explorer) FileContractHistory ¶
func (e *Explorer) FileContractHistory(id types.FileContractID) (fc types.FileContract, fcrs []types.FileContractRevision, fcE bool, spE bool)
FileContractHistory returns the history associated with the specified file contract ID, which includes the file contract itself and all of the revisions that have been submitted to the blockchain. The first bool indicates whether the file contract exists, and the second bool indicates whether a storage proof was successfully submitted for the file contract.
func (*Explorer) FileContractID ¶
func (e *Explorer) FileContractID(id types.FileContractID) []types.TransactionID
FileContractIDs returns all of the transactions that contain the specified file contract ID. An empty set indicates that the file contract ID does not appear in the blockchain.
func (*Explorer) LatestBlockFacts ¶ added in v1.0.3
func (e *Explorer) LatestBlockFacts() modules.BlockFacts
LatestBlockFacts returns a set of statistics about the blockchain as they appeared at the latest block height in the explorer's consensus set.
func (*Explorer) ProcessConsensusChange ¶
func (e *Explorer) ProcessConsensusChange(cc modules.ConsensusChange)
ProcessConsensusChange follows the most recent changes to the consensus set, including parsing new blocks and updating the utxo sets.
func (*Explorer) SiacoinOutput ¶
func (e *Explorer) SiacoinOutput(id types.SiacoinOutputID) (types.SiacoinOutput, bool)
SiacoinOutput returns the siacoin output associated with the specified ID.
func (*Explorer) SiacoinOutputID ¶
func (e *Explorer) SiacoinOutputID(id types.SiacoinOutputID) []types.TransactionID
SiacoinOutputID returns all of the transactions that contain the specified siacoin output ID. An empty set indicates that the siacoin output ID does not appear in the blockchain.
func (*Explorer) SiafundOutput ¶
func (e *Explorer) SiafundOutput(id types.SiafundOutputID) (types.SiafundOutput, bool)
SiafundOutput returns the siafund output associated with the specified ID.
func (*Explorer) SiafundOutputID ¶
func (e *Explorer) SiafundOutputID(id types.SiafundOutputID) []types.TransactionID
SiafundOutputID returns all of the transactions that contain the specified siafund output ID. An empty set indicates that the siafund output ID does not appear in the blockchain.
func (*Explorer) Transaction ¶
func (e *Explorer) Transaction(id types.TransactionID) (types.Block, types.BlockHeight, bool)
Transaction takes a transaction ID and finds the block containing the transaction. Because of the miner payouts, the transaction ID might be a block ID. To find the transaction, iterate through the block.
func (*Explorer) UnlockHash ¶
func (e *Explorer) UnlockHash(uh types.UnlockHash) []types.TransactionID
UnlockHash returns the IDs of all the transactions that contain the unlock hash. An empty set indicates that the unlock hash does not appear in the blockchain.