node

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2022 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MemPool

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

func NewMemPool

func NewMemPool() MemPool

func (*MemPool) AddSubscriber

func (m *MemPool) AddSubscriber(id string) <-chan TxEvent

func (*MemPool) AddTx

func (m *MemPool) AddTx(tx protocol.MsgTx)

func (*MemPool) CheckTxConfirmed

func (m *MemPool) CheckTxConfirmed(block block.Block)

func (*MemPool) GetMemPool

func (m *MemPool) GetMemPool() map[string]transaction.Transaction

func (*MemPool) Start

func (m *MemPool) Start()

func (*MemPool) Stop

func (m *MemPool) Stop()

type NodeConfig

type NodeConfig struct {
	Network        string
	UserAgent      string
	FiltersDB      repository.FilterRepository
	BlockHeadersDB repository.BlockHeaderRepository
}

type NodeService

type NodeService interface {
	Start(initialOutboundPeerAddr string) error
	Stop() error
	AddOutboundPeer(peer.Peer) error
	SendTransaction(txhex string) error
	GetChainTip() (*block.Header, error)
}

func New

func New(config NodeConfig) (NodeService, error)

New returns a new Node.

type TxConfirmedEvent

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

func (TxConfirmedEvent) TxID

func (t TxConfirmedEvent) TxID() string

func (TxConfirmedEvent) Type

func (t TxConfirmedEvent) Type() TxEventType

type TxEvent

type TxEvent interface {
	Type() TxEventType
	TxID() string
}

type TxEventType

type TxEventType int
const (
	TxConfirmed TxEventType = iota
	TxUnConfirmed
)

type TxUnConfirmedEvent

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

func (TxUnConfirmedEvent) TxID

func (t TxUnConfirmedEvent) TxID() string

func (TxUnConfirmedEvent) Type

Jump to

Keyboard shortcuts

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