subscribe

package
v0.0.7-alphanet Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2023 License: GPL-3.0 Imports: 9 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewBlocksByAddressSubscription

func NewBlocksByAddressSubscription(addr types.Address) *subscriptionOptions

func NewBlocksSubscription

func NewBlocksSubscription() *subscriptionOptions

func NewMomentumsSubscription

func NewMomentumsSubscription() *subscriptionOptions

func NewToUnreceivedBlocksSubscription

func NewToUnreceivedBlocksSubscription(addr types.Address) *subscriptionOptions

Types

type AccountBlock

type AccountBlock struct {
	BlockType uint64        `json:"blockType"`
	Hash      types.Hash    `json:"hash"`
	Height    uint64        `json:"height"`
	Address   types.Address `json:"address"`
	ToAddress types.Address `json:"toAddress"`
	FromHash  types.Hash    `json:"fromHash"`
}

type Api

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

func GetSubscribeApi

func GetSubscribeApi() *Api

func (*Api) AccountBlocksByAddress

func (s *Api) AccountBlocksByAddress(ctx context.Context, address types.Address) (*rpc.Subscription, error)

func (*Api) AllAccountBlocks

func (s *Api) AllAccountBlocks(ctx context.Context) (*rpc.Subscription, error)

func (*Api) Momentums

func (s *Api) Momentums(ctx context.Context) (*rpc.Subscription, error)

func (*Api) UnreceivedAccountBlocksByAddress

func (s *Api) UnreceivedAccountBlocksByAddress(ctx context.Context, address types.Address) (*rpc.Subscription, error)

type BroadcastStats

type BroadcastStats struct {
	NumNotify     int
	NumUninstalls int
}

type Momentum

type Momentum struct {
	Hash   types.Hash `json:"hash"`
	Height uint64     `json:"height"`
}

type Server

type Server struct {
	*Api
	// contains filtered or unexported fields
}

func GetSubscribeServer

func GetSubscribeServer(chain chain.Chain) *Server

func (*Server) DeleteMomentum

func (s *Server) DeleteMomentum(*nom.DetailedMomentum)

func (*Server) Init

func (s *Server) Init() error

func (*Server) InsertMomentum

func (s *Server) InsertMomentum(detailed *nom.DetailedMomentum)

func (*Server) Start

func (s *Server) Start() error

func (*Server) Stop

func (s *Server) Stop() error

type Subscription

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

func NewSubscription

func NewSubscription(notifier *rpc.Notifier, options *subscriptionOptions) *Subscription

func (*Subscription) Closed

func (s *Subscription) Closed() bool

func (*Subscription) Notify

func (s *Subscription) Notify(data interface{})

type SubscriptionType

type SubscriptionType byte
const (
	FirstSubscriptionType SubscriptionType = iota
	AllAccountBlocksSubscription
	AccountBlocksSubscriptionByAddress
	UnreceivedAccountBlocksSubscriptionByAddress
	MomentumsSubscription
	LastSubscriptionType
)

Jump to

Keyboard shortcuts

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