chainsync

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFromCmdlineOptions

func NewFromCmdlineOptions() plugin.Plugin

Types

type BlockEvent

type BlockEvent struct {
	BlockNumber uint64           `json:"blockNumber"`
	BlockHash   string           `json:"blockHash"`
	SlotNumber  uint64           `json:"slotNumber"`
	BlockCbor   byteSliceJsonHex `json:"blockCbor,omitempty"`
}

func NewBlockEvent

func NewBlockEvent(block ledger.Block, includeCbor bool) BlockEvent

type ChainSync

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

func New

func New(options ...ChainSyncOptionFunc) *ChainSync

New returns a new ChainSync object with the specified options applied

func (*ChainSync) ErrorChan

func (c *ChainSync) ErrorChan() chan error

ErrorChan returns the input error channel

func (*ChainSync) InputChan

func (c *ChainSync) InputChan() chan<- event.Event

InputChan always returns nil

func (*ChainSync) OutputChan

func (c *ChainSync) OutputChan() <-chan event.Event

OutputChan returns the output event channel

func (*ChainSync) Start

func (c *ChainSync) Start() error

Start the chain sync input

func (*ChainSync) Stop

func (c *ChainSync) Stop() error

Stop the chain sync input

type ChainSyncOptionFunc

type ChainSyncOptionFunc func(*ChainSync)

func WithAddress

func WithAddress(address string) ChainSyncOptionFunc

WithAddress specifies the TCP address of the node to connect to in the form "host:port"

func WithIncludeCbor added in v0.2.0

func WithIncludeCbor(includeCbor bool) ChainSyncOptionFunc

WithIncludeCbor specifies whether to include the original CBOR for a block or transaction with the event

func WithIntersectPoints

func WithIntersectPoints(points []ocommon.Point) ChainSyncOptionFunc

WithIntersectPoints specifies the point(s) to use when starting the ChainSync operation. The default is to start at the genesis of the blockchain

func WithIntersectTip

func WithIntersectTip(intersectTip bool) ChainSyncOptionFunc

WithInterceptTip specifies whether to start the ChainSync operation from the chain tip. The default is to start at the genesis of the blockchain

func WithNetwork

func WithNetwork(network string) ChainSyncOptionFunc

WithNetwork specifies the network

func WithNetworkMagic

func WithNetworkMagic(networkMagic uint32) ChainSyncOptionFunc

WithNetworkMagic specifies the network magic value

func WithNtcTcp

func WithNtcTcp(ntcTcp bool) ChainSyncOptionFunc

WithNtcTcp specifies whether to use the NtC (node-to-client) protocol over TCP. This is useful when exposing a node's UNIX socket via socat or similar. The default is to use the NtN (node-to-node) protocol over TCP

func WithSocketPath

func WithSocketPath(socketPath string) ChainSyncOptionFunc

WithSocketPath specifies the socket path of the node to connect to

type RollbackEvent

type RollbackEvent struct {
	BlockHash  string `json:"blockHash"`
	SlotNumber uint64 `json:"slotNumber"`
}

func NewRollbackEvent

func NewRollbackEvent(point ocommon.Point) RollbackEvent

type TransactionEvent

type TransactionEvent struct {
	BlockNumber     uint64                     `json:"blockNumber"`
	BlockHash       string                     `json:"blockHash"`
	SlotNumber      uint64                     `json:"slotNumber"`
	TransactionHash string                     `json:"transactionHash"`
	TransactionCbor byteSliceJsonHex           `json:"transactionCbor,omitempty"`
	Inputs          []ledger.TransactionInput  `json:"inputs"`
	Outputs         []ledger.TransactionOutput `json:"outputs"`
}

func NewTransactionEvent

func NewTransactionEvent(block ledger.Block, txBody ledger.TransactionBody, includeCbor bool) TransactionEvent

Jump to

Keyboard shortcuts

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