mqtt

package
v0.0.0-...-fa2bc5f Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2021 License: ISC Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// TransactionsTopic is an MQTT topic for transactions
	TransactionsTopic = "transactions"

	// AcceptedTransactionsTopic is an MQTT topic for accepted transactions
	AcceptedTransactionsTopic = "transactions/accepted"

	// UnacceptedTransactionsTopic is an MQTT topic for unaccepted transactions
	UnacceptedTransactionsTopic = "transactions/unaccepted"
)
View Source
const BlocksTopic = "dag/blocks"

BlocksTopic is an MQTT topic for new blocks

View Source
const SelectedParentChainTopic = "dag/selected-parent-chain"

SelectedParentChainTopic is an MQTT topic for changes in the selected parent chain

View Source
const (
	// SelectedTipTopic is an MQTT topic for DAG selected tips
	SelectedTipTopic = "dag/selected-tip"
)

Variables

This section is empty.

Functions

func Close

func Close()

Close closes the connection to the MQTT server, if previously connected

func Connect

func Connect() error

Connect initiates a connection to the MQTT server, if defined

func GetClient

func GetClient() (mqtt.Client, error)

GetClient returns an instance of the MQTT client, in case we have an active connection

func PublishBlockAddedNotifications

func PublishBlockAddedNotifications(hash string) error

PublishBlockAddedNotifications publishes notifications for the block that was added, and notifications for its transactions.

func PublishSelectedParentChainNotifications

func PublishSelectedParentChainNotifications(removedChainHashes []string, addedChainBlocks []*appmessage.ChainBlock) error

PublishSelectedParentChainNotifications publishes notifications for changes in the selected parent chain

func PublishSelectedTipNotification

func PublishSelectedTipNotification(selectedTipHash string) error

PublishSelectedTipNotification publishes notification for a new selected tip

func PublishUnacceptedTransactionsNotifications

func PublishUnacceptedTransactionsNotifications(unacceptedTransactions []*dbmodels.Transaction) error

PublishUnacceptedTransactionsNotifications publishes notification for each unaccepted transaction of the given chain-block

Types

This section is empty.

Jump to

Keyboard shortcuts

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