Help us shape the future of Go! Take the 2026 Go Developer Survey

solana

package
v1.39.0 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2026 License: MIT Imports: 34 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TriggerInputTxSig      = "solana-tx-sig"
	TriggerInputEventIndex = "solana-event-index"
)

CLI input keys consumed from chain.TriggerParams.ChainTypeInputs.

Variables

View Source
var SupportedChains = []chain.ChainConfig{
	{Selector: chainselectors.SOLANA_DEVNET.Selector, Forwarder: devnetMockForwarderProgramID},
	{Selector: chainselectors.SOLANA_MAINNET.Selector, Forwarder: mainnetMockForwarderProgramID},
}

SupportedChains lists Solana networks cre-cli simulate can target. Forwarder field stores the mock_forwarder program ID. The per-selector forwarder *state account* is kept in forwarderStateAccounts because chain.ChainConfig only carries one address.

Functions

func ExtractLimits

func ExtractLimits(w *cresettings.Workflows) chain.Limits

func GetSolanaTriggerLogWithFilter added in v1.27.0

func GetSolanaTriggerLogWithFilter(ctx context.Context, client *solanarpc.Client, sigStr string, eventIndex uint64, filter *solcap.FilterLogTriggerRequest) (*solcap.Log, error)

func RunRPCHealthCheck

func RunRPCHealthCheck(clients map[uint64]chain.ChainClient, experimentalSelectors map[uint64]bool) error

RunRPCHealthCheck probes GetHealth() on every configured Solana client. experimentalSelectors identifies chains sourced from experimental-chains config.

Types

type LimitedSolanaChain

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

LimitedSolanaChain enforces chain-write report size + Solana compute-unit limit.

func NewLimitedSolanaChain

func NewLimitedSolanaChain(inner solanaserver.ClientCapability, limits chain.Limits) *LimitedSolanaChain

func (*LimitedSolanaChain) AckEvent

func (l *LimitedSolanaChain) AckEvent(ctx context.Context, triggerID, eventID, method string) caperrors.Error

func (*LimitedSolanaChain) ChainSelector

func (l *LimitedSolanaChain) ChainSelector() uint64

func (*LimitedSolanaChain) Close

func (l *LimitedSolanaChain) Close() error

func (*LimitedSolanaChain) Description

func (l *LimitedSolanaChain) Description() string

func (*LimitedSolanaChain) HealthReport

func (l *LimitedSolanaChain) HealthReport() map[string]error

func (*LimitedSolanaChain) Initialise

func (*LimitedSolanaChain) MonitoringContext added in v1.29.0

func (l *LimitedSolanaChain) MonitoringContext() capmon.MonitoringContext

func (*LimitedSolanaChain) Name

func (l *LimitedSolanaChain) Name() string

func (*LimitedSolanaChain) Ready

func (l *LimitedSolanaChain) Ready() error

func (*LimitedSolanaChain) RegisterLogTrigger

func (*LimitedSolanaChain) Start

func (l *LimitedSolanaChain) Start(ctx context.Context) error

func (*LimitedSolanaChain) UnregisterLogTrigger

type SolanaChainCapabilities

type SolanaChainCapabilities struct {
	SolanaChains map[uint64]*solanafakes.FakeSolanaChain
}

SolanaChainCapabilities holds the per-selector FakeSolanaChain instances created for simulation.

func NewSolanaChainCapabilities

func NewSolanaChainCapabilities(
	ctx context.Context,
	lggr logger.Logger,
	registry *capreg.Registry,
	clients map[uint64]*rpc.Client,
	forwarderProgramIDs map[uint64]solana.PublicKey,
	forwarderStateAccounts map[uint64]solana.PublicKey,
	transmitter solana.PrivateKey,
	dryRunChainWrite bool,
	limits chain.Limits,
) (*SolanaChainCapabilities, error)

NewSolanaChainCapabilities builds FakeSolanaChain instances for every (selector -> client) pair, wraps them with LimitedSolanaChain, and registers each with the capability registry.

func (*SolanaChainCapabilities) Close

func (c *SolanaChainCapabilities) Close() error

func (*SolanaChainCapabilities) Start

type SolanaChainType

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

SolanaChainType implements chain.ChainType for Solana.

func (*SolanaChainType) CollectCLIInputs

func (ct *SolanaChainType) CollectCLIInputs(v *viper.Viper) map[string]string

func (*SolanaChainType) ExecuteTrigger

func (ct *SolanaChainType) ExecuteTrigger(ctx context.Context, selector uint64, registrationID string, triggerData interface{}) error

func (*SolanaChainType) Name

func (ct *SolanaChainType) Name() string

func (*SolanaChainType) ParseTriggerChainSelector

func (ct *SolanaChainType) ParseTriggerChainSelector(triggerID string) (uint64, bool)

func (*SolanaChainType) RegisterCapabilities

func (ct *SolanaChainType) RegisterCapabilities(ctx context.Context, cfg chain.CapabilityConfig) ([]services.Service, error)

func (*SolanaChainType) ResolveClients

func (ct *SolanaChainType) ResolveClients(v *viper.Viper) (chain.ResolvedChains, error)

func (*SolanaChainType) ResolveKey

func (ct *SolanaChainType) ResolveKey(s *settings.Settings, broadcast bool) (interface{}, error)

func (*SolanaChainType) ResolveTriggerData

func (ct *SolanaChainType) ResolveTriggerData(ctx context.Context, selector uint64, params chain.TriggerParams) (interface{}, error)

ResolveTriggerData fetches the Solana log payload for the given selector by replaying a known transaction.

func (*SolanaChainType) RunHealthCheck

func (ct *SolanaChainType) RunHealthCheck(resolved chain.ResolvedChains) error

func (*SolanaChainType) SupportedChains

func (ct *SolanaChainType) SupportedChains() []chain.ChainConfig

func (*SolanaChainType) Supports

func (ct *SolanaChainType) Supports(selector uint64) bool

Jump to

Keyboard shortcuts

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