explorer

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2020 License: BSD-3-Clause Imports: 13 Imported by: 4 modules, 5 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNoHealthyExplorers is returned if all explorers in the group fail to respond in time
	ErrNoHealthyExplorers = errors.New("No explorer could statisfy the request")
)

Functions

This section is empty.

Types

type DevnetGroupedExplorer

type DevnetGroupedExplorer struct {
	*GroupedExplorer
}

DevnetGroupedExplorer is a GroupedExplorer preconfigured for the official public testnet explorers

func NewDevnetGroupedExplorer

func NewDevnetGroupedExplorer() *DevnetGroupedExplorer

NewDevnetGroupedExplorer creates a preconfigured grouped explorer for the public testnet nodes

func (*DevnetGroupedExplorer) Name

func (te *DevnetGroupedExplorer) Name() string

Name of the backend

type Explorer

type Explorer struct {
	// contains filtered or unexported fields
}

Explorer is a backend which operates by querying a remote public explorer

func NewExplorer

func NewExplorer(url, userAgent, password string) *Explorer

NewExplorer creates a new explorer client for a public explorer running at the given url, expecting the given user agent string. The api can optionally be password protected

func (*Explorer) CheckAddress

func (e *Explorer) CheckAddress(addr types.UnlockHash) ([]api.ExplorerBlock, []api.ExplorerTransaction, error)

CheckAddress returns all interesting transactions and blocks related to a given unlockhash

func (*Explorer) CurrentHeight

func (e *Explorer) CurrentHeight() (types.BlockHeight, error)

CurrentHeight gets the current height of the explorer

func (*Explorer) Get

func (e *Explorer) Get(endpoint string) error

func (*Explorer) GetChainConstants

func (e *Explorer) GetChainConstants() (modules.DaemonConstants, error)

GetChainConstants fetches the chainconstants used by the explorer

func (*Explorer) GetWithResponse

func (e *Explorer) GetWithResponse(endpoint string, responseBody interface{}) error

func (*Explorer) Post

func (e *Explorer) Post(endpoint, data string) error

func (*Explorer) PostWithResponse

func (e *Explorer) PostWithResponse(endpoint, data string, responseBody interface{}) error

func (*Explorer) SendTxn

func (e *Explorer) SendTxn(tx types.Transaction) (types.TransactionID, error)

SendTxn posts a transaction to the explorer to include it in the transactionpool

type GroupedExplorer

type GroupedExplorer struct {
	// contains filtered or unexported fields
}

GroupedExplorer is a Backend which can call multiple explorers, calling another explorer if one is down

func NewGroupedExplorer

func NewGroupedExplorer(explorers ...*Explorer) *GroupedExplorer

NewGroupedExplorer creates a new GroupedExplorer from existing regular Explorers

func (*GroupedExplorer) CheckAddress

CheckAddress returns all interesting transactions and blocks related to a given unlockhash

func (*GroupedExplorer) CurrentHeight

func (e *GroupedExplorer) CurrentHeight() (types.BlockHeight, error)

CurrentHeight returns the current chain height

func (*GroupedExplorer) Get

func (e *GroupedExplorer) Get(endpoint string) error

func (*GroupedExplorer) GetChainConstants

func (e *GroupedExplorer) GetChainConstants() (modules.DaemonConstants, error)

GetChainConstants gets the currently active chain constants for this backend

func (*GroupedExplorer) GetWithResponse

func (e *GroupedExplorer) GetWithResponse(endpoint string, responseBody interface{}) error

func (*GroupedExplorer) Post

func (e *GroupedExplorer) Post(endpoint, data string) error

func (*GroupedExplorer) PostWithResponse

func (e *GroupedExplorer) PostWithResponse(endpoint, data string, responseBody interface{}) error

func (*GroupedExplorer) SendTxn

SendTxn sends a txn to the backend to ultimately include it in the transactionpool

type MainnetGroupedExplorer

type MainnetGroupedExplorer struct {
	*GroupedExplorer
}

MainnetGroupedExplorer is a GroupedExplorer preconfigured for the official public testnet explorers

func NewMainnetGroupedExplorer

func NewMainnetGroupedExplorer() *MainnetGroupedExplorer

NewMainnetGroupedExplorer creates a preconfigured grouped explorer for the public testnet nodes

func (*MainnetGroupedExplorer) Name

func (te *MainnetGroupedExplorer) Name() string

Name of the backend

type TestnetGroupedExplorer

type TestnetGroupedExplorer struct {
	*GroupedExplorer
}

TestnetGroupedExplorer is a GroupedExplorer preconfigured for the official public testnet explorers

func NewTestnetGroupedExplorer

func NewTestnetGroupedExplorer() *TestnetGroupedExplorer

NewTestnetGroupedExplorer creates a preconfigured grouped explorer for the public testnet nodes

func (*TestnetGroupedExplorer) Name

func (te *TestnetGroupedExplorer) Name() string

Name of the backend

Jump to

Keyboard shortcuts

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