Documentation ¶
Index ¶
- Variables
- type DevnetGroupedExplorer
- type Explorer
- func (e *Explorer) CheckAddress(addr types.UnlockHash) ([]api.ExplorerBlock, []api.ExplorerTransaction, error)
- func (e *Explorer) CurrentHeight() (types.BlockHeight, error)
- func (e *Explorer) Get(endpoint string) error
- func (e *Explorer) GetChainConstants() (modules.DaemonConstants, error)
- func (e *Explorer) GetWithResponse(endpoint string, responseBody interface{}) error
- func (e *Explorer) Post(endpoint, data string) error
- func (e *Explorer) PostWithResponse(endpoint, data string, responseBody interface{}) error
- func (e *Explorer) SendTxn(tx types.Transaction) (types.TransactionID, error)
- type GroupedExplorer
- func (e *GroupedExplorer) CheckAddress(addr types.UnlockHash) ([]api.ExplorerBlock, []api.ExplorerTransaction, error)
- func (e *GroupedExplorer) CurrentHeight() (types.BlockHeight, error)
- func (e *GroupedExplorer) Get(endpoint string) error
- func (e *GroupedExplorer) GetChainConstants() (modules.DaemonConstants, error)
- func (e *GroupedExplorer) GetWithResponse(endpoint string, responseBody interface{}) error
- func (e *GroupedExplorer) Post(endpoint, data string) error
- func (e *GroupedExplorer) PostWithResponse(endpoint, data string, responseBody interface{}) error
- func (e *GroupedExplorer) SendTxn(tx types.Transaction) (types.TransactionID, error)
- type MainnetGroupedExplorer
- type TestnetGroupedExplorer
Constants ¶
This section is empty.
Variables ¶
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 ¶
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) GetChainConstants ¶
func (e *Explorer) GetChainConstants() (modules.DaemonConstants, error)
GetChainConstants fetches the chainconstants used by the explorer
func (*Explorer) GetWithResponse ¶
func (*Explorer) PostWithResponse ¶
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 ¶
func (e *GroupedExplorer) CheckAddress(addr types.UnlockHash) ([]api.ExplorerBlock, []api.ExplorerTransaction, error)
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 ¶
func (e *GroupedExplorer) SendTxn(tx types.Transaction) (types.TransactionID, error)
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