Documentation
¶
Index ¶
- func ExtractAssetDetailsFromMatch(match kugo.Match) (common.MultiAsset[uint64], uint64, error)
- func NewFromCmdlineOptions() plugin.Plugin
- func NewResolvedTransactionOutput(match kugo.Match) (ledger.TransactionOutput, error)
- type BlockContext
- type BlockEvent
- type ChainSync
- type ChainSyncOptionFunc
- func WithAddress(address string) ChainSyncOptionFunc
- func WithAutoReconnect(autoReconnect bool) ChainSyncOptionFunc
- func WithBulkMode(bulkMode bool) ChainSyncOptionFunc
- func WithDelayConfirmations(count uint) ChainSyncOptionFunc
- func WithIncludeCbor(includeCbor bool) ChainSyncOptionFunc
- func WithIntersectPoints(points []ocommon.Point) ChainSyncOptionFunc
- func WithIntersectTip(intersectTip bool) ChainSyncOptionFunc
- func WithKupoUrl(kupoUrl string) ChainSyncOptionFunc
- func WithLogger(logger plugin.Logger) ChainSyncOptionFunc
- func WithNetwork(network string) ChainSyncOptionFunc
- func WithNetworkMagic(networkMagic uint32) ChainSyncOptionFunc
- func WithNtcTcp(ntcTcp bool) ChainSyncOptionFunc
- func WithSocketPath(socketPath string) ChainSyncOptionFunc
- func WithStatusUpdateFunc(statusUpdateFunc StatusUpdateFunc) ChainSyncOptionFunc
- type ChainSyncStatus
- type ResolvedTransactionOutput
- func (txOut ResolvedTransactionOutput) Address() common.Address
- func (txOut ResolvedTransactionOutput) Amount() uint64
- func (txOut ResolvedTransactionOutput) Assets() *common.MultiAsset[uint64]
- func (txOut ResolvedTransactionOutput) Cbor() []byte
- func (txOut ResolvedTransactionOutput) Datum() *cbor.LazyValue
- func (txOut ResolvedTransactionOutput) DatumHash() *common.Blake2b256
- func (txOut ResolvedTransactionOutput) Utxorpc() *utxorpc.TxOutput
- type RollbackEvent
- type StatusUpdateFunc
- type TransactionContext
- type TransactionEvent
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractAssetDetailsFromMatch ¶ added in v0.24.0
func NewFromCmdlineOptions ¶
func NewResolvedTransactionOutput ¶ added in v0.24.0
func NewResolvedTransactionOutput( match kugo.Match, ) (ledger.TransactionOutput, error)
Types ¶
type BlockContext ¶
type BlockContext struct {
BlockNumber uint64 `json:"blockNumber"`
SlotNumber uint64 `json:"slotNumber"`
NetworkMagic uint32 `json:"networkMagic"`
Era string `json:"era"`
}
func NewBlockContext ¶
func NewBlockContext(block ledger.Block, networkMagic uint32) BlockContext
func NewBlockHeaderContext ¶
func NewBlockHeaderContext(block ledger.BlockHeader) BlockContext
type BlockEvent ¶
type BlockEvent struct {
Block ledger.Block `json:"-"`
BlockBodySize uint64 `json:"blockBodySize"`
IssuerVkey string `json:"issuerVkey"`
BlockHash string `json:"blockHash"`
BlockCbor byteSliceJsonHex `json:"blockCbor,omitempty"`
TransactionCount uint64 `json:"transactionCount"`
}
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 WithAutoReconnect ¶
func WithAutoReconnect(autoReconnect bool) ChainSyncOptionFunc
WithAutoReconnect specified whether to automatically reconnect if the connection is broken
func WithBulkMode ¶
func WithBulkMode(bulkMode bool) ChainSyncOptionFunc
WithBulkMode specifies whether to use the "bulk" sync mode with NtN (node-to-node). This should only be used against your own nodes for resource usage reasons
func WithDelayConfirmations ¶ added in v0.30.0
func WithDelayConfirmations(count uint) ChainSyncOptionFunc
WithDelayConfirmationCount specifies the number of confirmations (subsequent blocks) are required before an event will be emitted
func WithIncludeCbor ¶
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 WithKupoUrl ¶ added in v0.24.0
func WithKupoUrl(kupoUrl string) ChainSyncOptionFunc
WithKupoUrl specifies the URL for a Kupo instance that will be queried for additional information
func WithLogger ¶
func WithLogger(logger plugin.Logger) ChainSyncOptionFunc
WithLogger specifies the logger object to use for logging messages
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
func WithStatusUpdateFunc ¶
func WithStatusUpdateFunc( statusUpdateFunc StatusUpdateFunc, ) ChainSyncOptionFunc
WithStatusUpdateFunc specifies a callback function for status updates. This is useful for tracking the chain-sync status to be able to resume a sync at a later time, especially when any filtering could prevent you from getting all block update events
type ChainSyncStatus ¶
type ResolvedTransactionOutput ¶ added in v0.24.0
type ResolvedTransactionOutput struct {
AddressField common.Address `json:"address"`
AmountField uint64 `json:"amount"`
AssetsField *common.MultiAsset[uint64] `json:"assets,omitempty"`
}
ResolvedTransactionOutput represents a concrete implementation of the TransactionOutput interface
func (ResolvedTransactionOutput) Address ¶ added in v0.24.0
func (txOut ResolvedTransactionOutput) Address() common.Address
func (ResolvedTransactionOutput) Amount ¶ added in v0.24.0
func (txOut ResolvedTransactionOutput) Amount() uint64
func (ResolvedTransactionOutput) Assets ¶ added in v0.24.0
func (txOut ResolvedTransactionOutput) Assets() *common.MultiAsset[uint64]
func (ResolvedTransactionOutput) Cbor ¶ added in v0.24.0
func (txOut ResolvedTransactionOutput) Cbor() []byte
func (ResolvedTransactionOutput) Datum ¶ added in v0.24.0
func (txOut ResolvedTransactionOutput) Datum() *cbor.LazyValue
func (ResolvedTransactionOutput) DatumHash ¶ added in v0.24.0
func (txOut ResolvedTransactionOutput) DatumHash() *common.Blake2b256
func (ResolvedTransactionOutput) Utxorpc ¶ added in v0.24.0
func (txOut ResolvedTransactionOutput) Utxorpc() *utxorpc.TxOutput
type RollbackEvent ¶
type RollbackEvent struct {
BlockHash string `json:"blockHash"`
SlotNumber uint64 `json:"slotNumber"`
}
func NewRollbackEvent ¶
func NewRollbackEvent(point ocommon.Point) RollbackEvent
type StatusUpdateFunc ¶
type StatusUpdateFunc func(ChainSyncStatus)
type TransactionContext ¶
type TransactionContext struct {
BlockNumber uint64 `json:"blockNumber"`
SlotNumber uint64 `json:"slotNumber"`
TransactionHash string `json:"transactionHash"`
TransactionIdx uint32 `json:"transactionIdx"`
NetworkMagic uint32 `json:"networkMagic"`
}
func NewTransactionContext ¶
func NewTransactionContext( block ledger.Block, tx ledger.Transaction, index uint32, networkMagic uint32, ) TransactionContext
type TransactionEvent ¶
type TransactionEvent struct {
Transaction ledger.Transaction `json:"-"`
BlockHash string `json:"blockHash"`
TransactionCbor byteSliceJsonHex `json:"transactionCbor,omitempty"`
Inputs []ledger.TransactionInput `json:"inputs"`
Outputs []ledger.TransactionOutput `json:"outputs"`
Certificates []ledger.Certificate `json:"certificates,omitempty"`
ReferenceInputs []ledger.TransactionInput `json:"referenceInputs,omitempty"`
Metadata *cbor.LazyValue `json:"metadata,omitempty"`
Fee uint64 `json:"fee"`
TTL uint64 `json:"ttl,omitempty"`
ResolvedInputs []ledger.TransactionOutput `json:"resolvedInputs,omitempty"`
Withdrawals map[string]uint64 `json:"withdrawals,omitempty"`
Witnesses lcommon.TransactionWitnessSet `json:"witnesses,omitempty"`
}
func NewTransactionEvent ¶
func NewTransactionEvent( block ledger.Block, tx ledger.Transaction, includeCbor bool, resolvedInputs []ledger.TransactionOutput, ) TransactionEvent