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
func Serve(ctx context.Context, log log.Logger, vm block.ChainVM, opts ...grpcutils.ServerOption) error
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 Context ¶ added in v1.16.56
type Context struct {
NetworkID uint32
NetID ids.ID
ChainID ids.ID
NodeID ids.NodeID
PublicKey *bls.PublicKey
NetworkUpgrades upgrade.Config
XChainID ids.ID
CChainID ids.ID
LUXAssetID ids.ID
ChainDataDir string
Log log.Logger
BCLookup ids.AliaserReader
Metrics metrics.MultiGatherer
WarpSigner warp.Signer
ValidatorState validators.State
}
Context is the node-specific context for RPC chain VM
func (*Context) PublicKeyBytes ¶ added in v1.16.56
PublicKeyBytes returns the public key as bytes
func (*Context) ToConsensusContext ¶ added in v1.16.56
func (c *Context) ToConsensusContext() interface{}
ToConsensusContext converts node Context to consensus Context This is explicit - we know exactly what we're doing
type Message ¶ added in v1.16.56
type Message uint32
Message represents a notification message type
const (
// PendingTxs indicates pending transactions notification
PendingTxs Message
)
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 Subscription ¶ added in v1.16.56
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 ¶
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.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package commonmock is a generated GoMock package.
|
Package commonmock is a generated GoMock package. |