Documentation ¶
Index ¶
- func NewFromCmdlineOptions() plugin.Plugin
- type BlockEvent
- type ChainSync
- type ChainSyncOptionFunc
- func WithAddress(address string) ChainSyncOptionFunc
- func WithIncludeCbor(includeCbor bool) ChainSyncOptionFunc
- func WithIntersectPoints(points []ocommon.Point) ChainSyncOptionFunc
- func WithIntersectTip(intersectTip bool) ChainSyncOptionFunc
- func WithNetwork(network string) ChainSyncOptionFunc
- func WithNetworkMagic(networkMagic uint32) ChainSyncOptionFunc
- func WithNtcTcp(ntcTcp bool) ChainSyncOptionFunc
- func WithSocketPath(socketPath string) ChainSyncOptionFunc
- type RollbackEvent
- type TransactionEvent
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewFromCmdlineOptions ¶
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) OutputChan ¶
OutputChan returns the output event channel
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