explorer

package
v0.2.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 11, 2018 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package explorer provides a glimpse into what the Sia network currently looks like.

Index

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, tpool modules.TransactionPool, 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) Close

func (e *Explorer) Close() error

Close closes the explorer.

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

FileContractID 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) FileContractPayouts

func (e *Explorer) FileContractPayouts(id types.FileContractID) ([]types.SiacoinOutput, error)

FileContractPayouts returns all of the spendable siacoin outputs which are the result of a FileContract. An empty set indicates that the file contract is still open

func (*Explorer) HashType

func (e *Explorer) HashType(hash crypto.Hash) (hashType string, err error)

HashType returns the string representation of the hashtype.

func (*Explorer) LatestBlockFacts

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) PendingTransactions

func (e *Explorer) PendingTransactions() []types.Transaction

PendingTransactions returns the current list of pending transactions in the mempool

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) ReceiveUpdatedUnconfirmedTransactions

func (e *Explorer) ReceiveUpdatedUnconfirmedTransactions(diff *modules.TransactionPoolDiff)

ReceiveUpdatedUnconfirmedTransactions processes and updates the explorer module with unconfirmed transactions as they come in from the transaction pool

func (*Explorer) SiacoinOutput

func (e *Explorer) SiacoinOutput(id types.SiacoinOutputID) (types.SiacoinOutput, bool)

SiacoinOutput returns the siacoin output associated with the specified ID. This first checks the memPool for the ID, then goes to the DB to see if it's already been stored

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) 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 transacti on 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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL