nodebridge

package
v1.0.0-beta.5 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2022 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrAlreadyRegistered = errors.New("callback for block ID is already registered")

ErrAlreadyRegistered is returned when a callback for the same block ID has already been registered.

Functions

func INXBlockMetadataCaller

func INXBlockMetadataCaller(handler interface{}, params ...interface{})

func INXMilestoneCaller

func INXMilestoneCaller(handler interface{}, params ...interface{})

Types

type BlockSolidCallback

type BlockSolidCallback = func(*inx.BlockMetadata)

type Events

type Events struct {
	LatestMilestoneChanged    *events.Event
	ConfirmedMilestoneChanged *events.Event
}

type Milestone

type Milestone struct {
	MilestoneID iotago.MilestoneID
	Milestone   *iotago.Milestone
}

type NodeBridge

type NodeBridge struct {
	// the logger used to log events.
	*logger.WrappedLogger

	NodeConfig *inx.NodeConfiguration

	Events *Events
	// contains filtered or unexported fields
}

func NewNodeBridge

func NewNodeBridge(ctx context.Context, address string, log *logger.Logger) (*NodeBridge, error)

func (*NodeBridge) Block

func (n *NodeBridge) Block(blockID iotago.BlockID) (*iotago.Block, error)

func (*NodeBridge) BlockMetadata

func (n *NodeBridge) BlockMetadata(blockID iotago.BlockID) (*inx.BlockMetadata, error)

func (*NodeBridge) Client

func (n *NodeBridge) Client() inx.INXClient

func (*NodeBridge) ConfirmedMilestone

func (n *NodeBridge) ConfirmedMilestone() (*Milestone, error)

func (*NodeBridge) ConfirmedMilestoneIndex

func (n *NodeBridge) ConfirmedMilestoneIndex() uint32

func (*NodeBridge) INXNodeClient

func (n *NodeBridge) INXNodeClient() *nodeclient.Client

func (*NodeBridge) IsNodeAlmostSynced

func (n *NodeBridge) IsNodeAlmostSynced() bool

func (*NodeBridge) IsNodeSynced

func (n *NodeBridge) IsNodeSynced() bool

func (*NodeBridge) LatestMilestone

func (n *NodeBridge) LatestMilestone() (*Milestone, error)

func (*NodeBridge) LatestMilestoneIndex

func (n *NodeBridge) LatestMilestoneIndex() uint32

func (*NodeBridge) ListenToBlocks

func (n *NodeBridge) ListenToBlocks(ctx context.Context, cancel context.CancelFunc, consumer func(block *iotago.Block)) error

func (*NodeBridge) ListenToLedgerUpdates

func (n *NodeBridge) ListenToLedgerUpdates(ctx context.Context, startIndex uint32, endIndex uint32, consume func(update *inx.LedgerUpdate) error) error

func (*NodeBridge) Milestone

func (n *NodeBridge) Milestone(index uint32) (*Milestone, error)

func (*NodeBridge) MilestoneConeMetadata

func (n *NodeBridge) MilestoneConeMetadata(ctx context.Context, cancel context.CancelFunc, index uint32, consumer func(metadata *inx.BlockMetadata)) error

func (*NodeBridge) NodeStatus

func (n *NodeBridge) NodeStatus() (*inx.NodeStatus, error)

func (*NodeBridge) ProtocolParameters

func (n *NodeBridge) ProtocolParameters() *iotago.ProtocolParameters

func (*NodeBridge) RegisterAPIRoute

func (n *NodeBridge) RegisterAPIRoute(route string, bindAddress string) error

func (*NodeBridge) RequestTips

func (n *NodeBridge) RequestTips(ctx context.Context, count uint32, allowSemiLazy bool) (iotago.BlockIDs, error)

func (*NodeBridge) Run

func (n *NodeBridge) Run(ctx context.Context)

func (*NodeBridge) SubmitBlock

func (n *NodeBridge) SubmitBlock(ctx context.Context, block *iotago.Block) (iotago.BlockID, error)

func (*NodeBridge) UnregisterAPIRoute

func (n *NodeBridge) UnregisterAPIRoute(route string) error

type TangleListener

type TangleListener struct {
	Events *TangleListenerEvents
	// contains filtered or unexported fields
}

func NewTangleListener

func NewTangleListener(nodeBridge *NodeBridge) *TangleListener

func (*TangleListener) ClearBlockSolidCallbacks

func (t *TangleListener) ClearBlockSolidCallbacks()

ClearBlockSolidCallbacks removes all previously registered blockSolidCallbacks.

func (*TangleListener) DeregisterBlockSolidCallback

func (t *TangleListener) DeregisterBlockSolidCallback(blockID iotago.BlockID)

DeregisterBlockSolidCallback removes a previously registered callback for blockID.

func (*TangleListener) DeregisterBlockSolidEvent

func (t *TangleListener) DeregisterBlockSolidEvent(blockID iotago.BlockID)

func (*TangleListener) DeregisterMilestoneConfirmedEvent

func (t *TangleListener) DeregisterMilestoneConfirmedEvent(msIndex uint32)

func (*TangleListener) RegisterBlockSolidCallback

func (t *TangleListener) RegisterBlockSolidCallback(blockID iotago.BlockID, f BlockSolidCallback) error

RegisterBlockSolidCallback registers a callback for when a block with blockID becomes solid. If another callback for the same ID has already been registered, an error is returned.

func (*TangleListener) RegisterBlockSolidEvent

func (t *TangleListener) RegisterBlockSolidEvent(blockID iotago.BlockID) chan struct{}

func (*TangleListener) RegisterMilestoneConfirmedEvent

func (t *TangleListener) RegisterMilestoneConfirmedEvent(msIndex uint32) chan struct{}

func (*TangleListener) Run

func (t *TangleListener) Run(ctx context.Context)

type TangleListenerEvents

type TangleListenerEvents struct {
	BlockSolid *events.Event
}

type TipPoolListener

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

func NewTipPoolListener

func NewTipPoolListener(nodeBridge *NodeBridge, interval time.Duration) *TipPoolListener

func (*TipPoolListener) GetTipsPoolSizes

func (t *TipPoolListener) GetTipsPoolSizes() (uint32, uint32)

func (*TipPoolListener) Run

func (t *TipPoolListener) Run(ctx context.Context)

Jump to

Keyboard shortcuts

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