explorer

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: May 9, 2018 License: MIT Imports: 10 Imported by: 1

Documentation

Overview

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

Index

Constants

View Source
const (
	// ActiveBSEstimationBlocks is the number of blocks that are used to
	// estimate the active block stake used to generate blocks.
	ActiveBSEstimationBlocks = 200
)

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, bcInfo types.BlockchainInfo, chainCts types.ChainConstants) (*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) BlockStakeOutput

func (e *Explorer) BlockStakeOutput(id types.BlockStakeOutputID) (types.BlockStakeOutput, bool)

BlockStakeOutput returns the blockstake output associated with the specified ID.

func (*Explorer) BlockStakeOutputID

func (e *Explorer) BlockStakeOutputID(id types.BlockStakeOutputID) []types.TransactionID

BlockStakeOutputID returns all of the transactions that contain the specified blockstake output ID. An empty set indicates that the blockstake output ID does not appear in the blockchain.

func (*Explorer) Close

func (e *Explorer) Close() error

Close closes the explorer.

func (*Explorer) CoinOutput added in v0.1.0

func (e *Explorer) CoinOutput(id types.CoinOutputID) (types.CoinOutput, bool)

CoinOutput returns the coin output associated with the specified ID.

func (*Explorer) CoinOutputID added in v0.1.0

func (e *Explorer) CoinOutputID(id types.CoinOutputID) []types.TransactionID

CoinOutputID returns all of the transactions that contain the specified coin output ID. An empty set indicates that the siacoin output ID does not appear in the blockchain.

func (*Explorer) Constants added in v1.0.5

func (e *Explorer) Constants() modules.ExplorerConstants

Constants retuns all of the constants in use by the chain

func (*Explorer) HistoryStats added in v1.0.5

func (e *Explorer) HistoryStats(history types.BlockHeight) (*modules.ChainStats, error)

HistoryStats return the stats for the last `history` amount of blocks

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) 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) RangeStats added in v1.0.5

func (e *Explorer) RangeStats(start types.BlockHeight, end types.BlockHeight) (*modules.ChainStats, error)

RangeStats return the stats for the range [`start`, `end`]

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.

Jump to

Keyboard shortcuts

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