Documentation ¶
Index ¶
- Constants
- Variables
- func CreateRPCConsumerCobraCommand() *cobra.Command
- func CreateTestRPCConsumerCobraCommand() *cobra.Command
- func ParseEndpoints(viper_endpoints *viper.Viper, geolocation uint64) (endpoints []*lavasession.RPCEndpoint, err error)
- type AnalyticsServerAddressess
- type ConsumerConsistency
- type ConsumerStateTrackerInf
- type ConsumerTxSender
- type RPCConsumer
- type RPCConsumerServer
- func (rpccs *RPCConsumerServer) GetInitialUnwantedProviders(directiveHeaders map[string]string) map[string]struct{}
- func (rpccs *RPCConsumerServer) HandleDirectiveHeadersForMessage(chainMessage chainlib.ChainMessage, directiveHeaders map[string]string)
- func (rpccs *RPCConsumerServer) IsHealthy() bool
- func (rpccs *RPCConsumerServer) LavaDirectiveHeaders(metadata []pairingtypes.Metadata) ([]pairingtypes.Metadata, map[string]string)
- func (rpccs *RPCConsumerServer) SendRelay(ctx context.Context, url string, req string, connectionType string, ...) (relayResult *common.RelayResult, errRet error)
- func (rpccs *RPCConsumerServer) ServeRPCRequests(ctx context.Context, listenEndpoint *lavasession.RPCEndpoint, ...) (err error)
- type RelayError
- type RelayErrors
Constants ¶
View Source
const ( CacheMaxCost = 2000 // each item cost would be 1 CacheNumCounters = 20000 // expect 2000 items EntryTTL = 5 * time.Minute )
this class handles seen block values in requests
View Source
const ( DefaultRPCConsumerFileName = "rpcconsumer.yml" DebugRelaysFlagName = "debug-relays" DebugProbesFlagName = "debug-probes" )
View Source
const (
MaxRelayRetries = 6
)
Variables ¶
View Source
var ( Yaml_config_properties = []string{"network-address", "chain-id", "api-interface"} DebugRelaysFlag = false RelaysHealthEnableFlagDefault = true RelayHealthIntervalFlagDefault = 5 * time.Minute )
View Source
var NoResponseTimeout = sdkerrors.New("NoResponseTimeout Error", 685, "timeout occurred while waiting for providers responses")
Functions ¶
func ParseEndpoints ¶
func ParseEndpoints(viper_endpoints *viper.Viper, geolocation uint64) (endpoints []*lavasession.RPCEndpoint, err error)
Types ¶
type ConsumerConsistency ¶
type ConsumerConsistency struct {
// contains filtered or unexported fields
}
func NewConsumerConsistency ¶
func NewConsumerConsistency(specId string) *ConsumerConsistency
func (*ConsumerConsistency) GetSeenBlock ¶
func (cc *ConsumerConsistency) GetSeenBlock(dappId string, ip string) (int64, bool)
func (*ConsumerConsistency) Key ¶
func (cc *ConsumerConsistency) Key(dappId string, ip string) string
func (*ConsumerConsistency) SetSeenBlock ¶
func (cc *ConsumerConsistency) SetSeenBlock(blockSeen int64, dappId string, ip string)
type ConsumerStateTrackerInf ¶
type ConsumerStateTrackerInf interface { RegisterForVersionUpdates(ctx context.Context, version *protocoltypes.Version, versionValidator updaters.VersionValidationInf) RegisterConsumerSessionManagerForPairingUpdates(ctx context.Context, consumerSessionManager *lavasession.ConsumerSessionManager) RegisterForSpecUpdates(ctx context.Context, specUpdatable updaters.SpecUpdatable, endpoint lavasession.RPCEndpoint) error RegisterFinalizationConsensusForUpdates(context.Context, *lavaprotocol.FinalizationConsensus) RegisterForDowntimeParamsUpdates(ctx context.Context, downtimeParamsUpdatable updaters.DowntimeParamsUpdatable) error TxConflictDetection(ctx context.Context, finalizationConflict *conflicttypes.FinalizationConflict, responseConflict *conflicttypes.ResponseConflict, sameProviderConflict *conflicttypes.FinalizationConflict, conflictHandler common.ConflictHandlerInterface) error GetConsumerPolicy(ctx context.Context, consumerAddress, chainID string) (*plantypes.Policy, error) GetProtocolVersion(ctx context.Context) (*updaters.ProtocolVersionResponse, error) GetLatestVirtualEpoch() uint64 }
type ConsumerTxSender ¶
type ConsumerTxSender interface { TxConflictDetection(ctx context.Context, finalizationConflict *conflicttypes.FinalizationConflict, responseConflict *conflicttypes.ResponseConflict, sameProviderConflict *conflicttypes.FinalizationConflict, conflictHandler common.ConflictHandlerInterface) error GetConsumerPolicy(ctx context.Context, consumerAddress, chainID string) (*plantypes.Policy, error) GetLatestVirtualEpoch() uint64 }
type RPCConsumer ¶
type RPCConsumer struct {
// contains filtered or unexported fields
}
type RPCConsumerServer ¶
type RPCConsumerServer struct {
// contains filtered or unexported fields
}
implements Relay Sender interfaced and uses an ChainListener to get it called
func (*RPCConsumerServer) GetInitialUnwantedProviders ¶ added in v0.27.2
func (rpccs *RPCConsumerServer) GetInitialUnwantedProviders(directiveHeaders map[string]string) map[string]struct{}
func (*RPCConsumerServer) HandleDirectiveHeadersForMessage ¶
func (rpccs *RPCConsumerServer) HandleDirectiveHeadersForMessage(chainMessage chainlib.ChainMessage, directiveHeaders map[string]string)
func (*RPCConsumerServer) IsHealthy ¶
func (rpccs *RPCConsumerServer) IsHealthy() bool
func (*RPCConsumerServer) LavaDirectiveHeaders ¶
func (rpccs *RPCConsumerServer) LavaDirectiveHeaders(metadata []pairingtypes.Metadata) ([]pairingtypes.Metadata, map[string]string)
func (*RPCConsumerServer) SendRelay ¶
func (rpccs *RPCConsumerServer) SendRelay( ctx context.Context, url string, req string, connectionType string, dappID string, consumerIp string, analytics *metrics.RelayMetrics, metadata []pairingtypes.Metadata, ) (relayResult *common.RelayResult, errRet error)
func (*RPCConsumerServer) ServeRPCRequests ¶
func (rpccs *RPCConsumerServer) ServeRPCRequests(ctx context.Context, listenEndpoint *lavasession.RPCEndpoint, consumerStateTracker ConsumerStateTrackerInf, chainParser chainlib.ChainParser, finalizationConsensus *lavaprotocol.FinalizationConsensus, consumerSessionManager *lavasession.ConsumerSessionManager, requiredResponses int, privKey *btcec.PrivateKey, lavaChainID string, cache *performance.Cache, rpcConsumerLogs *metrics.RPCConsumerLogs, consumerAddress sdk.AccAddress, consumerConsistency *ConsumerConsistency, relaysMonitor *metrics.RelaysMonitor, cmdFlags common.ConsumerCmdFlags, sharedState bool, ) (err error)
type RelayError ¶
type RelayError struct { ProviderInfo common.ProviderInfo // contains filtered or unexported fields }
type RelayErrors ¶
type RelayErrors struct {
// contains filtered or unexported fields
}
func (*RelayErrors) GetBestErrorMessageForUser ¶
func (r *RelayErrors) GetBestErrorMessageForUser() utils.Attribute
Click to show internal directories.
Click to hide internal directories.