rpcchainvm

package
v1.22.87 Latest Latest
Warning

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

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

Documentation

Overview

Package rpcchainvm provides the RPC infrastructure for Chain VMs (linear blockchains). This package is a thin wrapper that re-exports the shared implementation from github.com/luxfi/vm/rpc/chain for backward compatibility.

Package rpcchainvm provides the RPC infrastructure for Chain VMs. This file provides backward-compatible type aliases to the shared implementation in github.com/luxfi/vm/rpc/chain.

Package rpcchainvm provides the RPC infrastructure for Chain VMs. This file provides backward-compatible type aliases to the shared implementation in github.com/luxfi/vm/rpc/chain.

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

func Serve added in v0.1.1

Serve starts the RPC Chain VM server and performs a handshake with the VM runtime service. The address of the Runtime server is expected to be passed via ENV `runtime.EngineAddressKey`. This address is used by the Runtime client to send Initialize RPC to server.

This function delegates to the shared implementation in github.com/luxfi/vm/rpc/chain.

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 VMClient

type VMClient = chain.Client

VMClient is a type alias for backward compatibility. The actual implementation is in github.com/luxfi/vm/rpc/chain.Client.

func NewClient

func NewClient(
	clientConn *grpc.ClientConn,
	runtime runtime.Stopper,
	pid int,
	processTracker resource.ProcessTracker,
	metricsGatherer metrics.MultiGatherer,
	logger log.Logger,
) *VMClient

NewClient returns a VM connected to a remote VM. This delegates to the shared implementation in github.com/luxfi/vm/rpc/chain.

type VMServer

type VMServer = rpcchain.Server

VMServer is a type alias for backward compatibility. The actual implementation is in github.com/luxfi/vm/rpc/chain.Server.

func NewServer

func NewServer(vm enginechain.ChainVM, allowShutdown *atomic.Atomic[bool]) *VMServer

NewServer creates a new VMServer for the given ChainVM. This delegates to the shared implementation in github.com/luxfi/vm/rpc/chain.

Directories

Path Synopsis
Package commonmock is a generated GoMock package.
Package commonmock is a generated GoMock package.

Jump to

Keyboard shortcuts

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