rpcchainvm

package
v1.23.3 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2026 License: BSD-3-Clause Imports: 16 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFactory added in v0.1.1

func NewFactory(
	path string,
	processTracker resource.ProcessTracker,
	runtimeTracker runtime.Tracker,
	metricsGatherer metric.MultiGatherer,
) vms.Factory

NewFactory creates a new factory with default transport configuration (ZAP)

func NewFactoryWithTransport added in v1.23.2

func NewFactoryWithTransport(
	path string,
	processTracker resource.ProcessTracker,
	runtimeTracker runtime.Tracker,
	metricsGatherer metric.MultiGatherer,
	transportConfig TransportConfig,
) vms.Factory

NewFactoryWithTransport creates a new factory with specified transport configuration

Types

type Message added in v1.16.56

type Message uint32

Message represents a notification message type

const (

	// PendingTxs indicates pending transactions notification
	PendingTxs Message
)

func (Message) String added in v1.16.56

func (m Message) String() string

type NotificationForwarder added in v1.16.56

type NotificationForwarder struct {
	Engine    Notifier
	Subscribe Subscription
	Log       log.Logger
	// contains filtered or unexported fields
}

NotificationForwarder is a component that listens for notifications from a Subscription, and forwards them to a Notifier. When CheckForEvent is called mid-subscription, it retries the subscription. After Notify is called, it waits for CheckForEvent to be called before subscribing again.

func NewNotificationForwarder added in v1.16.56

func NewNotificationForwarder(
	engine Notifier,
	subscribe Subscription,
	log log.Logger,
) *NotificationForwarder

func (*NotificationForwarder) CheckForEvent added in v1.16.56

func (nf *NotificationForwarder) CheckForEvent()

CheckForEvent cancels any outstanding WaitForEvent calls and schedules a new WaitForEvent call.

func (*NotificationForwarder) Close added in v1.16.56

func (nf *NotificationForwarder) Close()

Close cancels any outstanding WaitForEvent calls and waits for them to return. After Close returns, no future WaitForEvent calls will be made by the notification forwarder.

type Notifier added in v1.16.56

type Notifier interface {
	Notify(context.Context, Message) error
}

type Subscription added in v1.16.56

type Subscription func(ctx context.Context) (Message, error)

Subscription is a function that blocks until either the given context is cancelled, or a message is returned. It is used to receive messages from a VM such as Pending transactions, state sync completion, etc. The function returns the message received, or an error if the context is cancelled.

type Transport added in v1.23.2

type Transport string

Transport specifies the RPC transport protocol for VM communication

const (
	// TransportGRPC uses gRPC with protobuf serialization (default)
	TransportGRPC Transport = "grpc"
	// TransportZAP uses ZAP zero-copy serialization over TCP
	TransportZAP Transport = "zap"
	// TransportBoth enables both gRPC and ZAP transports
	TransportBoth Transport = "both"
)

func ValidTransports added in v1.23.2

func ValidTransports() []Transport

ValidTransports returns all valid transport values

func (Transport) IsValid added in v1.23.2

func (t Transport) IsValid() bool

IsValid returns true if the transport is a valid value

func (Transport) UsesGRPC added in v1.23.2

func (t Transport) UsesGRPC() bool

UsesGRPC returns true if this transport configuration uses gRPC

func (Transport) UsesZAP added in v1.23.2

func (t Transport) UsesZAP() bool

UsesZAP returns true if this transport configuration uses ZAP

type TransportConfig added in v1.23.2

type TransportConfig struct {
	// Transport specifies which transport(s) to use
	Transport Transport
	// Timeout for transport operations
	Timeout time.Duration
}

TransportConfig contains transport configuration

func DefaultTransportConfig added in v1.23.2

func DefaultTransportConfig() TransportConfig

DefaultTransportConfig returns the default transport configuration (ZAP)

Directories

Path Synopsis
Package commonmock is a generated GoMock package.
Package commonmock is a generated GoMock package.
Package sender provides p2p.Sender implementations over ZAP and gRPC transports.
Package sender provides p2p.Sender implementations over ZAP and gRPC transports.
Package zap provides ZAP transport implementation for VM RPC.
Package zap provides ZAP transport implementation for VM RPC.

Jump to

Keyboard shortcuts

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