Documentation ¶
Index ¶
- func ConvertUTXOOutpointEntryPairsToUTXOsByAddressesEntries(address string, pairs utxoindex.UTXOOutpointEntryPairs) []*appmessage.UTXOsByAddressesEntry
- type Context
- func (ctx *Context) BuildBlockVerboseData(blockHeader externalapi.BlockHeader, includeTransactionVerboseData bool) (*appmessage.BlockVerboseData, error)
- func (ctx *Context) BuildTransactionVerboseData(tx *externalapi.DomainTransaction, txID string, ...) (*appmessage.TransactionVerboseData, error)
- func (ctx *Context) ConvertVirtualSelectedParentChainChangesToChainChangedNotificationMessage(selectedParentChainChanges *externalapi.SelectedParentChainChanges) (*appmessage.VirtualSelectedParentChainChangedNotificationMessage, error)
- func (ctx *Context) GetDifficultyRatio(bits uint32, params *dagconfig.Params) float64
- type NotificationListener
- func (nl *NotificationListener) PropagateBlockAddedNotifications()
- func (nl *NotificationListener) PropagateFinalityConflictNotifications()
- func (nl *NotificationListener) PropagateFinalityConflictResolvedNotifications()
- func (nl *NotificationListener) PropagateUTXOsChangedNotifications(addresses []*UTXOsChangedNotificationAddress)
- func (nl *NotificationListener) PropagateVirtualSelectedParentBlueScoreChangedNotifications()
- func (nl *NotificationListener) PropagateVirtualSelectedParentChainChangedNotifications()
- type NotificationManager
- func (nm *NotificationManager) AddListener(router *routerpkg.Router)
- func (nm *NotificationManager) Listener(router *routerpkg.Router) (*NotificationListener, error)
- func (nm *NotificationManager) NotifyBlockAdded(notification *appmessage.BlockAddedNotificationMessage) error
- func (nm *NotificationManager) NotifyFinalityConflict(notification *appmessage.FinalityConflictNotificationMessage) error
- func (nm *NotificationManager) NotifyFinalityConflictResolved(notification *appmessage.FinalityConflictResolvedNotificationMessage) error
- func (nm *NotificationManager) NotifyUTXOsChanged(utxoChanges *utxoindex.UTXOChanges) error
- func (nm *NotificationManager) NotifyVirtualSelectedParentBlueScoreChanged(...) error
- func (nm *NotificationManager) NotifyVirtualSelectedParentChainChanged(notification *appmessage.VirtualSelectedParentChainChangedNotificationMessage) error
- func (nm *NotificationManager) RemoveListener(router *routerpkg.Router)
- type UTXOsChangedNotificationAddress
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertUTXOOutpointEntryPairsToUTXOsByAddressesEntries ¶
func ConvertUTXOOutpointEntryPairsToUTXOsByAddressesEntries(address string, pairs utxoindex.UTXOOutpointEntryPairs) []*appmessage.UTXOsByAddressesEntry
ConvertUTXOOutpointEntryPairsToUTXOsByAddressesEntries converts UTXOOutpointEntryPairs to a slice of UTXOsByAddressesEntry
Types ¶
type Context ¶
type Context struct { Config *config.Config NetAdapter *netadapter.NetAdapter Domain domain.Domain ProtocolManager *protocol.Manager ConnectionManager *connmanager.ConnectionManager AddressManager *addressmanager.AddressManager UTXOIndex *utxoindex.UTXOIndex ShutDownChan chan<- struct{} NotificationManager *NotificationManager }
Context represents the RPC context
func NewContext ¶
func NewContext(cfg *config.Config, domain domain.Domain, netAdapter *netadapter.NetAdapter, protocolManager *protocol.Manager, connectionManager *connmanager.ConnectionManager, addressManager *addressmanager.AddressManager, utxoIndex *utxoindex.UTXOIndex, shutDownChan chan<- struct{}) *Context
NewContext creates a new RPC context
func (*Context) BuildBlockVerboseData ¶
func (ctx *Context) BuildBlockVerboseData(blockHeader externalapi.BlockHeader, includeTransactionVerboseData bool) (*appmessage.BlockVerboseData, error)
BuildBlockVerboseData builds a BlockVerboseData from the given block.
func (*Context) BuildTransactionVerboseData ¶
func (ctx *Context) BuildTransactionVerboseData(tx *externalapi.DomainTransaction, txID string, blockHeader externalapi.BlockHeader, blockHash string) ( *appmessage.TransactionVerboseData, error)
BuildTransactionVerboseData builds a TransactionVerboseData from the given parameters
func (*Context) ConvertVirtualSelectedParentChainChangesToChainChangedNotificationMessage ¶
func (ctx *Context) ConvertVirtualSelectedParentChainChangesToChainChangedNotificationMessage( selectedParentChainChanges *externalapi.SelectedParentChainChanges) (*appmessage.VirtualSelectedParentChainChangedNotificationMessage, error)
ConvertVirtualSelectedParentChainChangesToChainChangedNotificationMessage converts VirtualSelectedParentChainChanges to VirtualSelectedParentChainChangedNotificationMessage
type NotificationListener ¶
type NotificationListener struct {
// contains filtered or unexported fields
}
NotificationListener represents a registered RPC notification listener
func (*NotificationListener) PropagateBlockAddedNotifications ¶
func (nl *NotificationListener) PropagateBlockAddedNotifications()
PropagateBlockAddedNotifications instructs the listener to send block added notifications to the remote listener
func (*NotificationListener) PropagateFinalityConflictNotifications ¶
func (nl *NotificationListener) PropagateFinalityConflictNotifications()
PropagateFinalityConflictNotifications instructs the listener to send finality conflict notifications to the remote listener
func (*NotificationListener) PropagateFinalityConflictResolvedNotifications ¶
func (nl *NotificationListener) PropagateFinalityConflictResolvedNotifications()
PropagateFinalityConflictResolvedNotifications instructs the listener to send finality conflict resolved notifications to the remote listener
func (*NotificationListener) PropagateUTXOsChangedNotifications ¶
func (nl *NotificationListener) PropagateUTXOsChangedNotifications(addresses []*UTXOsChangedNotificationAddress)
PropagateUTXOsChangedNotifications instructs the listener to send UTXOs changed notifications to the remote listener
func (*NotificationListener) PropagateVirtualSelectedParentBlueScoreChangedNotifications ¶
func (nl *NotificationListener) PropagateVirtualSelectedParentBlueScoreChangedNotifications()
PropagateVirtualSelectedParentBlueScoreChangedNotifications instructs the listener to send virtual selected parent blue score notifications to the remote listener
func (*NotificationListener) PropagateVirtualSelectedParentChainChangedNotifications ¶
func (nl *NotificationListener) PropagateVirtualSelectedParentChainChangedNotifications()
PropagateVirtualSelectedParentChainChangedNotifications instructs the listener to send chain changed notifications to the remote listener
type NotificationManager ¶
NotificationManager manages notifications for the RPC
func NewNotificationManager ¶
func NewNotificationManager() *NotificationManager
NewNotificationManager creates a new NotificationManager
func (*NotificationManager) AddListener ¶
func (nm *NotificationManager) AddListener(router *routerpkg.Router)
AddListener registers a listener with the given router
func (*NotificationManager) Listener ¶
func (nm *NotificationManager) Listener(router *routerpkg.Router) (*NotificationListener, error)
Listener retrieves the listener registered with the given router
func (*NotificationManager) NotifyBlockAdded ¶
func (nm *NotificationManager) NotifyBlockAdded(notification *appmessage.BlockAddedNotificationMessage) error
NotifyBlockAdded notifies the notification manager that a block has been added to the DAG
func (*NotificationManager) NotifyFinalityConflict ¶
func (nm *NotificationManager) NotifyFinalityConflict(notification *appmessage.FinalityConflictNotificationMessage) error
NotifyFinalityConflict notifies the notification manager that there's a finality conflict in the DAG
func (*NotificationManager) NotifyFinalityConflictResolved ¶
func (nm *NotificationManager) NotifyFinalityConflictResolved(notification *appmessage.FinalityConflictResolvedNotificationMessage) error
NotifyFinalityConflictResolved notifies the notification manager that a finality conflict in the DAG has been resolved
func (*NotificationManager) NotifyUTXOsChanged ¶
func (nm *NotificationManager) NotifyUTXOsChanged(utxoChanges *utxoindex.UTXOChanges) error
NotifyUTXOsChanged notifies the notification manager that UTXOs have been changed
func (*NotificationManager) NotifyVirtualSelectedParentBlueScoreChanged ¶
func (nm *NotificationManager) NotifyVirtualSelectedParentBlueScoreChanged( notification *appmessage.VirtualSelectedParentBlueScoreChangedNotificationMessage) error
NotifyVirtualSelectedParentBlueScoreChanged notifies the notification manager that the DAG's virtual selected parent blue score has changed
func (*NotificationManager) NotifyVirtualSelectedParentChainChanged ¶
func (nm *NotificationManager) NotifyVirtualSelectedParentChainChanged(notification *appmessage.VirtualSelectedParentChainChangedNotificationMessage) error
NotifyVirtualSelectedParentChainChanged notifies the notification manager that the DAG's selected parent chain has changed
func (*NotificationManager) RemoveListener ¶
func (nm *NotificationManager) RemoveListener(router *routerpkg.Router)
RemoveListener unregisters the given router
type UTXOsChangedNotificationAddress ¶
type UTXOsChangedNotificationAddress struct { Address string ScriptPublicKeyString utxoindex.ScriptPublicKeyString }
UTXOsChangedNotificationAddress represents a kaspad address. This type is meant to be used in UTXOsChanged notifications