Documentation ¶
Index ¶
- Constants
- func CloseEventReporter()
- func EventHook() func(entry zapcore.Entry) error
- func InitializeReporter()
- func ReportAccountUpdate(a types.Address)
- func ReportError(err NodeError)
- func ReportLayerUpdate(layer LayerUpdate)
- func ReportNewActivation(activation *types.ActivationTx)
- func ReportNewTx(layerID types.LayerID, tx *types.Transaction)
- func ReportNodeStatusUpdate()
- func ReportProposal(status ProposalStatus, proposal *types.Proposal)
- func ReportReceipt(r TxReceipt)
- func ReportRewardReceived(r Reward)
- func ReportTxWithValidity(layerID types.LayerID, tx *types.Transaction, valid bool)
- func SubscribeToLayers(newLayerCh timesync.LayerTimer)
- type Account
- type ActivationTx
- type EventProposal
- type EventReporter
- type LayerUpdate
- type NodeError
- type ProposalStatus
- type Reward
- type Status
- type Subscription
- func SubcribeProposals() Subscription
- func SubscribeAccount() Subscription
- func SubscribeActivations() Subscription
- func SubscribeErrors() Subscription
- func SubscribeLayers() Subscription
- func SubscribeReceipts() Subscription
- func SubscribeRewards() Subscription
- func SubscribeStatus() Subscription
- func SubscribeTxs() Subscription
- type Transaction
- type TxReceipt
Constants ¶
const ( LayerStatusTypeUnknown = iota LayerStatusTypeApproved // approved by Hare LayerStatusTypeConfirmed // confirmed by Tortoise )
The status of a layer TODO: this list is woefully inadequate and does not map to reality. See https://github.com/spacemeshos/api/issues/144.
Variables ¶
This section is empty.
Functions ¶
func CloseEventReporter ¶ added in v0.1.15
func CloseEventReporter()
CloseEventReporter shuts down the event reporting service and closes open channels.
func InitializeReporter ¶ added in v1.0.0
func InitializeReporter()
InitializeReporter initializes the event reporting interface with a nonzero channel buffer. This is useful for testing, where we want reporting to block.
func ReportAccountUpdate ¶ added in v0.1.15
ReportAccountUpdate reports an account whose data has been updated.
func ReportLayerUpdate ¶ added in v1.0.0
func ReportLayerUpdate(layer LayerUpdate)
ReportLayerUpdate reports a new layer, or an update to an existing layer.
func ReportNewActivation ¶ added in v0.1.15
func ReportNewActivation(activation *types.ActivationTx)
ReportNewActivation reports a new activation.
func ReportNewTx ¶ added in v0.1.15
func ReportNewTx(layerID types.LayerID, tx *types.Transaction)
ReportNewTx dispatches incoming events to the reporter singleton.
func ReportNodeStatusUpdate ¶ added in v0.1.15
func ReportNodeStatusUpdate()
ReportNodeStatusUpdate reports an update to the node status. It just pings the listener to notify them that there is an update; the listener is responsible for fetching the new status details. This is because status contains disparate information coming from different services, and the listener already knows how to gather that information so there is no point in duplicating that logic here. Note: There is some overlap with channelLayer here, as a new latest or verified layer should be sent over that channel as well. However, that happens inside the Mesh, at the source. It doesn't currently happen here because the status update includes only a layer ID, not full layer data, and the Reporter currently has no way to retrieve full layer data.
func ReportProposal ¶ added in v1.0.0
func ReportProposal(status ProposalStatus, proposal *types.Proposal)
ReportProposal reports a proposal.
func ReportReceipt ¶ added in v0.1.15
func ReportReceipt(r TxReceipt)
ReportReceipt reports creation or receipt of a new tx receipt.
func ReportRewardReceived ¶ added in v0.1.15
func ReportRewardReceived(r Reward)
ReportRewardReceived reports a new reward.
func ReportTxWithValidity ¶ added in v0.1.15
func ReportTxWithValidity(layerID types.LayerID, tx *types.Transaction, valid bool)
ReportTxWithValidity reports a tx along with whether it was just invalidated.
func SubscribeToLayers ¶ added in v0.1.15
func SubscribeToLayers(newLayerCh timesync.LayerTimer)
SubscribeToLayers is used to track and report automatically every time a new layer is reached.
Types ¶
type ActivationTx ¶ added in v1.0.0
type ActivationTx struct {
*types.ActivationTx
}
ActivationTx wraps *types.ActivationTx.
type EventProposal ¶ added in v1.0.0
type EventProposal struct { Status ProposalStatus Proposal *types.Proposal }
EventProposal includes proposal and proposal status.
type EventReporter ¶ added in v0.1.15
type EventReporter struct {
// contains filtered or unexported fields
}
EventReporter is the struct that receives incoming events and dispatches them.
type LayerUpdate ¶ added in v1.0.0
LayerUpdate packages up a layer with its status (which a layer does not ordinarily contain).
func (LayerUpdate) Field ¶ added in v1.0.0
func (nl LayerUpdate) Field() log.Field
Field returns a log field. Implements the LoggableField interface.
type ProposalStatus ¶ added in v1.0.0
type ProposalStatus int
ProposalStatus is a type for proposal status.
const ( // ProposalCreated is a status of the proposal that was created. ProposalCreated ProposalStatus = iota // ProposalIncluded is a status of the proposal when it is included into the block. ProposalIncluded )
func (ProposalStatus) String ¶ added in v1.0.0
func (s ProposalStatus) String() string
type Subscription ¶ added in v1.0.0
type Subscription = event.Subscription
Subscription is a subscription to events. Consumer must be aware that publish will block if subsription is not read fast enough.
func SubcribeProposals ¶ added in v1.0.0
func SubcribeProposals() Subscription
SubcribeProposals subscribes to the proposals.
func SubscribeAccount ¶ added in v1.0.0
func SubscribeAccount() Subscription
SubscribeAccount subscribes to account data updates.
func SubscribeActivations ¶ added in v1.0.0
func SubscribeActivations() Subscription
SubscribeActivations subscribes to activations.
func SubscribeErrors ¶ added in v1.0.0
func SubscribeErrors() Subscription
SubscribeErrors subscribes to node errors.
func SubscribeLayers ¶ added in v1.0.0
func SubscribeLayers() Subscription
SubscribeLayers subscribes to all layer data.
func SubscribeReceipts ¶
func SubscribeReceipts() Subscription
SubscribeReceipts subscribes to receipts.
func SubscribeRewards ¶ added in v1.0.0
func SubscribeRewards() Subscription
SubscribeRewards subscribes to rewards.
func SubscribeStatus ¶ added in v1.0.0
func SubscribeStatus() Subscription
SubscribeStatus subscribes to node status messages.
func SubscribeTxs ¶ added in v1.0.0
func SubscribeTxs() Subscription
SubscribeTxs subscribes to new transactions.
type Transaction ¶ added in v1.0.0
type Transaction struct { Transaction *types.Transaction LayerID types.LayerID Valid bool }
Transaction wraps a tx with its layer ID and validity info.