payer

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2025 License: MIT Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HashKey added in v0.2.0

func HashKey(topic topic.Topic) uint32

hashKey hashes the topic to a stable uint16 hash

Types

type ClientManager added in v0.1.1

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

* The ClientManager contains a mapping of nodeIDs to gRPC client connections.

These client connections are safe to be shared and re-used and will automatically attempt to reconnect if the underlying socket connection is lost. *

func NewClientManager added in v0.1.1

func NewClientManager(log *zap.Logger, nodeRegistry registry.NodeRegistry) *ClientManager

func (*ClientManager) GetClient added in v0.1.1

func (c *ClientManager) GetClient(nodeID uint32) (*grpc.ClientConn, error)

type DefaultMetadataApiClientConstructor added in v0.2.0

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

func (*DefaultMetadataApiClientConstructor) NewMetadataApiClient added in v0.2.0

func (c *DefaultMetadataApiClientConstructor) NewMetadataApiClient(
	nodeId uint32,
) (metadata_api.MetadataApiClient, error)

type MetadataApiClientConstructor added in v0.2.0

type MetadataApiClientConstructor interface {
	NewMetadataApiClient(nodeId uint32) (metadata_api.MetadataApiClient, error)
}

type NodeCursorTracker added in v0.2.0

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

func NewNodeCursorTracker added in v0.2.0

func NewNodeCursorTracker(ctx context.Context,
	log *zap.Logger, metadataApiClient MetadataApiClientConstructor) *NodeCursorTracker

func (*NodeCursorTracker) BlockUntilDesiredCursorReached added in v0.2.0

func (ct *NodeCursorTracker) BlockUntilDesiredCursorReached(
	ctx context.Context,
	nodeId uint32,
	desiredOriginatorId uint32,
	desiredSequenceId uint64,
) error

type NodeSelectorAlgorithm added in v0.2.0

type NodeSelectorAlgorithm interface {
	GetNode(topic topic.Topic) (uint32, error)
}

type Service

type Service struct {
	payer_api.UnimplementedPayerApiServer
	// contains filtered or unexported fields
}

func NewPayerApiService

func NewPayerApiService(
	ctx context.Context,
	log *zap.Logger,
	registry registry.NodeRegistry,
	payerPrivateKey *ecdsa.PrivateKey,
	blockchainPublisher blockchain.IBlockchainPublisher,
	metadataApiClient MetadataApiClientConstructor,
) (*Service, error)

type StableHashingNodeSelectorAlgorithm added in v0.2.0

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

func NewStableHashingNodeSelectorAlgorithm added in v0.2.0

func NewStableHashingNodeSelectorAlgorithm(
	reg registry.NodeRegistry,
) *StableHashingNodeSelectorAlgorithm

func (*StableHashingNodeSelectorAlgorithm) GetNode added in v0.2.0

GetNode selects a node for a given topic using stable hashing

Jump to

Keyboard shortcuts

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