Documentation ¶
Index ¶
- Constants
- func CreateChainLibMocks(ctx context.Context, specIndex string, apiInterface string, ...) (cpar ChainParser, crout ChainRouter, cfetc chaintracker.ChainFetcher, ...)
- func FormatResponseForParsing(reply *pairingtypes.RelayReply, chainMessage ChainMessageForSend) (parsable parser.RPCInput, err error)
- func GetListenerWithRetryGrpc(protocol string, addr string) net.Listener
- func ListenWithRetry(app *fiber.App, address string)
- type ApiContainer
- type ApiKey
- type BaseChainParser
- func (bcp *BaseChainParser) Construct(spec spectypes.Spec, taggedApis map[spectypes.FUNCTION_TAG]TaggedContainer, ...)
- func (bcp *BaseChainParser) GetParsingByTag(tag spectypes.FUNCTION_TAG) (parsing *spectypes.ParseDirective, collectionData *spectypes.CollectionData, ...)
- func (bcp *BaseChainParser) HandleHeaders(metadata []pairingtypes.Metadata, apiCollection *spectypes.ApiCollection, ...) (filteredHeaders []pairingtypes.Metadata, overwriteRequestedBlock string, ...)
- type BaseChainProxy
- type ChainFetcher
- func (cf *ChainFetcher) ChainFetcherMetadata() []pairingtypes.Metadata
- func (cf *ChainFetcher) FetchBlockHashByNum(ctx context.Context, blockNum int64) (string, error)
- func (cf *ChainFetcher) FetchChainID(ctx context.Context) (string, string, error)
- func (cf *ChainFetcher) FetchEndpoint() lavasession.RPCProviderEndpoint
- func (cf *ChainFetcher) FetchLatestBlockNum(ctx context.Context) (int64, error)
- func (cf *ChainFetcher) Validate(ctx context.Context) error
- type ChainFetcherIf
- type ChainListener
- type ChainMessage
- type ChainMessageForSend
- type ChainParser
- type ChainProxy
- func NewGrpcChainProxy(ctx context.Context, nConns uint, ...) (ChainProxy, error)
- func NewJrpcChainProxy(ctx context.Context, nConns uint, ...) (ChainProxy, error)
- func NewRestChainProxy(ctx context.Context, nConns uint, ...) (ChainProxy, error)
- func NewtendermintRpcChainProxy(ctx context.Context, nConns uint, ...) (ChainProxy, error)
- type ChainRouter
- type CollectionKey
- type CraftData
- type DummyChainFetcher
- func (cf *DummyChainFetcher) FetchBlockHashByNum(ctx context.Context, blockNum int64) (string, error)
- func (cf *DummyChainFetcher) FetchEndpoint() lavasession.RPCProviderEndpoint
- func (cf *DummyChainFetcher) FetchLatestBlockNum(ctx context.Context) (int64, error)
- func (cf *DummyChainFetcher) Validate(ctx context.Context) error
- type ErrorHandler
- type GRPCErrorHandler
- type GrpcChainListener
- type GrpcChainParser
- func (apip *GrpcChainParser) ChainBlockStats() (allowedBlockLagForQosSync int64, averageBlockTime time.Duration, ...)
- func (apip *GrpcChainParser) CraftMessage(parsing *spectypes.ParseDirective, connectionType string, craftData *CraftData, ...) (ChainMessageForSend, error)
- func (apip *GrpcChainParser) DataReliabilityParams() (enabled bool, dataReliabilityThreshold uint32)
- func (apip *GrpcChainParser) ParseMsg(url string, data []byte, connectionType string, ...) (ChainMessage, error)
- func (apip *GrpcChainParser) SetSpec(spec spectypes.Spec)
- type GrpcChainProxy
- type GrpcNodeErrorResponse
- type JrpcChainProxy
- type JsonRPCChainListener
- type JsonRPCChainParser
- func (apip *JsonRPCChainParser) ChainBlockStats() (allowedBlockLagForQosSync int64, averageBlockTime time.Duration, ...)
- func (apip *JsonRPCChainParser) CraftMessage(parsing *spectypes.ParseDirective, connectionType string, craftData *CraftData, ...) (ChainMessageForSend, error)
- func (apip *JsonRPCChainParser) DataReliabilityParams() (enabled bool, dataReliabilityThreshold uint32)
- func (apip *JsonRPCChainParser) GetInternalPaths() map[string]struct{}
- func (apip *JsonRPCChainParser) ParseMsg(url string, data []byte, connectionType string, ...) (ChainMessage, error)
- func (apip *JsonRPCChainParser) SetSpec(spec spectypes.Spec)
- type JsonRPCErrorHandler
- type LavaChainFetcher
- func (lcf *LavaChainFetcher) FetchBlockHashByNum(ctx context.Context, blockNum int64) (string, error)
- func (lcf *LavaChainFetcher) FetchChainID(ctx context.Context) (string, string, error)
- func (lcf *LavaChainFetcher) FetchEndpoint() lavasession.RPCProviderEndpoint
- func (lcf *LavaChainFetcher) FetchLatestBlockNum(ctx context.Context) (int64, error)
- type RelaySender
- type RestChainListener
- type RestChainParser
- func (apip *RestChainParser) ChainBlockStats() (allowedBlockLagForQosSync int64, averageBlockTime time.Duration, ...)
- func (apip *RestChainParser) CraftMessage(parsing *spectypes.ParseDirective, connectionType string, craftData *CraftData, ...) (ChainMessageForSend, error)
- func (apip *RestChainParser) DataReliabilityParams() (enabled bool, dataReliabilityThreshold uint32)
- func (apip *RestChainParser) ParseMsg(url string, data []byte, connectionType string, ...) (ChainMessage, error)
- func (apip *RestChainParser) SetSpec(spec spectypes.Spec)
- type RestChainProxy
- type RestErrorHandler
- type TaggedContainer
- type TendermintChainParser
- func (apip *TendermintChainParser) ChainBlockStats() (allowedBlockLagForQosSync int64, averageBlockTime time.Duration, ...)
- func (apip *TendermintChainParser) CraftMessage(parsing *spectypes.ParseDirective, connectionType string, craftData *CraftData, ...) (ChainMessageForSend, error)
- func (apip *TendermintChainParser) DataReliabilityParams() (enabled bool, dataReliabilityThreshold uint32)
- func (apip *TendermintChainParser) ParseMsg(url string, data []byte, connectionType string, ...) (ChainMessage, error)
- func (apip *TendermintChainParser) SetSpec(spec spectypes.Spec)
- type TendermintRPCErrorHandler
- type TendermintRpcChainListener
- type TestStruct
Constants ¶
const ( TendermintStatusQuery = "status" ChainFetcherHeaderName = "X-LAVA-Provider" )
const ( ContextUserValueKeyDappID = "dappID" RetryListeningInterval = 10 // seconds )
Variables ¶
This section is empty.
Functions ¶
func CreateChainLibMocks ¶
func CreateChainLibMocks(ctx context.Context, specIndex string, apiInterface string, serverCallback http.HandlerFunc, getToTopMostPath string) (cpar ChainParser, crout ChainRouter, cfetc chaintracker.ChainFetcher, closeServer func(), errRet error)
generates a chain parser, a chain fetcher messages based on it apiInterface can either be an ApiInterface string as in spectypes.ApiInterfaceXXX or a number for an index in the apiCollections
func FormatResponseForParsing ¶
func FormatResponseForParsing(reply *pairingtypes.RelayReply, chainMessage ChainMessageForSend) (parsable parser.RPCInput, err error)
func ListenWithRetry ¶
func ListenWithRetry(app *fiber.App, address string)
Types ¶
type ApiContainer ¶
type ApiContainer struct {
// contains filtered or unexported fields
}
type BaseChainParser ¶
type BaseChainParser struct {
// contains filtered or unexported fields
}
func (*BaseChainParser) Construct ¶
func (bcp *BaseChainParser) Construct(spec spectypes.Spec, taggedApis map[spectypes.FUNCTION_TAG]TaggedContainer, serverApis map[ApiKey]ApiContainer, apiCollections map[CollectionKey]*spectypes.ApiCollection, headers map[ApiKey]*spectypes.Header)
func (*BaseChainParser) GetParsingByTag ¶
func (bcp *BaseChainParser) GetParsingByTag(tag spectypes.FUNCTION_TAG) (parsing *spectypes.ParseDirective, collectionData *spectypes.CollectionData, existed bool)
func (*BaseChainParser) HandleHeaders ¶
func (bcp *BaseChainParser) HandleHeaders(metadata []pairingtypes.Metadata, apiCollection *spectypes.ApiCollection, headersDirection spectypes.Header_HeaderType) (filteredHeaders []pairingtypes.Metadata, overwriteRequestedBlock string, ignoredMetadata []pairingtypes.Metadata)
type BaseChainProxy ¶
type BaseChainProxy struct { ErrorHandler NodeUrl common.NodeUrl // contains filtered or unexported fields }
type ChainFetcher ¶
type ChainFetcher struct {
// contains filtered or unexported fields
}
func NewChainFetcher ¶
func NewChainFetcher(ctx context.Context, chainRouter ChainRouter, chainParser ChainParser, endpoint *lavasession.RPCProviderEndpoint) *ChainFetcher
func (*ChainFetcher) ChainFetcherMetadata ¶
func (cf *ChainFetcher) ChainFetcherMetadata() []pairingtypes.Metadata
func (*ChainFetcher) FetchBlockHashByNum ¶
func (*ChainFetcher) FetchChainID ¶ added in v0.20.0
func (*ChainFetcher) FetchEndpoint ¶
func (cf *ChainFetcher) FetchEndpoint() lavasession.RPCProviderEndpoint
func (*ChainFetcher) FetchLatestBlockNum ¶
func (cf *ChainFetcher) FetchLatestBlockNum(ctx context.Context) (int64, error)
type ChainFetcherIf ¶
type ChainListener ¶
func NewChainListener ¶
func NewChainListener( ctx context.Context, listenEndpoint *lavasession.RPCEndpoint, relaySender RelaySender, rpcConsumerLogs *metrics.RPCConsumerLogs, chainParser ChainParser, ) (ChainListener, error)
type ChainMessage ¶
type ChainMessage interface { RequestedBlock() int64 UpdateLatestBlockInMessage(latestBlock int64, modifyContent bool) (modified bool) AppendHeader(metadata []pairingtypes.Metadata) ChainMessageForSend }
type ChainMessageForSend ¶
type ChainMessageForSend interface { GetApi() *spectypes.Api GetRPCMessage() parser.RPCInput GetApiCollection() *spectypes.ApiCollection }
func CraftChainMessage ¶
func CraftChainMessage(parsing *spectypes.ParseDirective, connectionType string, chainParser ChainParser, craftData *CraftData, metadata []pairingtypes.Metadata) (ChainMessageForSend, error)
type ChainParser ¶
type ChainParser interface { ParseMsg(url string, data []byte, connectionType string, metadata []pairingtypes.Metadata) (ChainMessage, error) SetSpec(spec spectypes.Spec) DataReliabilityParams() (enabled bool, dataReliabilityThreshold uint32) ChainBlockStats() (allowedBlockLagForQosSync int64, averageBlockTime time.Duration, blockDistanceForFinalizedData uint32, blocksInFinalizationProof uint32) GetParsingByTag(tag spectypes.FUNCTION_TAG) (parsing *spectypes.ParseDirective, collectionData *spectypes.CollectionData, existed bool) CraftMessage(parser *spectypes.ParseDirective, connectionType string, craftData *CraftData, metadata []pairingtypes.Metadata) (ChainMessageForSend, error) HandleHeaders(metadata []pairingtypes.Metadata, apiCollection *spectypes.ApiCollection, headersDirection spectypes.Header_HeaderType) (filtered []pairingtypes.Metadata, overwriteReqBlock string, ignoredMetadata []pairingtypes.Metadata) }
func NewChainParser ¶
func NewChainParser(apiInterface string) (chainParser ChainParser, err error)
type ChainProxy ¶
type ChainProxy interface {
SendNodeMsg(ctx context.Context, ch chan interface{}, chainMessage ChainMessageForSend) (relayReply *pairingtypes.RelayReply, subscriptionID string, relayReplyServer *rpcclient.ClientSubscription, err error) // has to be thread safe, reuse code within ParseMsg as common functionality
}
func NewGrpcChainProxy ¶
func NewGrpcChainProxy(ctx context.Context, nConns uint, rpcProviderEndpoint lavasession.RPCProviderEndpoint, parser ChainParser) (ChainProxy, error)
func NewJrpcChainProxy ¶
func NewJrpcChainProxy(ctx context.Context, nConns uint, rpcProviderEndpoint lavasession.RPCProviderEndpoint, chainParser ChainParser) (ChainProxy, error)
func NewRestChainProxy ¶
func NewRestChainProxy(ctx context.Context, nConns uint, rpcProviderEndpoint lavasession.RPCProviderEndpoint, chainParser ChainParser) (ChainProxy, error)
func NewtendermintRpcChainProxy ¶
func NewtendermintRpcChainProxy(ctx context.Context, nConns uint, rpcProviderEndpoint lavasession.RPCProviderEndpoint, chainParser ChainParser) (ChainProxy, error)
type ChainRouter ¶
type ChainRouter interface { SendNodeMsg(ctx context.Context, ch chan interface{}, chainMessage ChainMessageForSend, addons []string) (relayReply *pairingtypes.RelayReply, subscriptionID string, relayReplyServer *rpcclient.ClientSubscription, err error) // has to be thread safe, reuse code within ParseMsg as common functionality GetSupportedExtensions() []string }
func GetChainRouter ¶
func GetChainRouter(ctx context.Context, nConns uint, rpcProviderEndpoint *lavasession.RPCProviderEndpoint, chainParser ChainParser) (ChainRouter, error)
type CollectionKey ¶
type DummyChainFetcher ¶
type DummyChainFetcher struct {
// contains filtered or unexported fields
}
func NewDummyChainFetcher ¶ added in v0.15.0
func NewDummyChainFetcher(ctx context.Context, endpoint *lavasession.RPCProviderEndpoint) *DummyChainFetcher
func (*DummyChainFetcher) FetchBlockHashByNum ¶
func (*DummyChainFetcher) FetchEndpoint ¶ added in v0.15.0
func (cf *DummyChainFetcher) FetchEndpoint() lavasession.RPCProviderEndpoint
func (*DummyChainFetcher) FetchLatestBlockNum ¶
func (cf *DummyChainFetcher) FetchLatestBlockNum(ctx context.Context) (int64, error)
type GRPCErrorHandler ¶
type GRPCErrorHandler struct {
// contains filtered or unexported fields
}
func (*GRPCErrorHandler) HandleNodeError ¶
func (geh *GRPCErrorHandler) HandleNodeError(ctx context.Context, nodeError error) error
type GrpcChainListener ¶
type GrpcChainListener struct {
// contains filtered or unexported fields
}
func NewGrpcChainListener ¶
func NewGrpcChainListener( ctx context.Context, listenEndpoint *lavasession.RPCEndpoint, relaySender RelaySender, rpcConsumerLogs *metrics.RPCConsumerLogs, chainParser ChainParser) (chainListener *GrpcChainListener)
func (*GrpcChainListener) Serve ¶
func (apil *GrpcChainListener) Serve(ctx context.Context)
Serve http server for GrpcChainListener
type GrpcChainParser ¶
type GrpcChainParser struct { BaseChainParser // contains filtered or unexported fields }
func NewGrpcChainParser ¶
func NewGrpcChainParser() (chainParser *GrpcChainParser, err error)
NewGrpcChainParser creates a new instance of GrpcChainParser
func (*GrpcChainParser) ChainBlockStats ¶
func (apip *GrpcChainParser) ChainBlockStats() (allowedBlockLagForQosSync int64, averageBlockTime time.Duration, blockDistanceForFinalizedData uint32, blocksInFinalizationProof uint32)
ChainBlockStats returns block stats from spec (spec.AllowedBlockLagForQosSync, spec.AverageBlockTime, spec.BlockDistanceForFinalizedData)
func (*GrpcChainParser) CraftMessage ¶
func (apip *GrpcChainParser) CraftMessage(parsing *spectypes.ParseDirective, connectionType string, craftData *CraftData, metadata []pairingtypes.Metadata) (ChainMessageForSend, error)
func (*GrpcChainParser) DataReliabilityParams ¶
func (apip *GrpcChainParser) DataReliabilityParams() (enabled bool, dataReliabilityThreshold uint32)
DataReliabilityParams returns data reliability params from spec (spec.enabled and spec.dataReliabilityThreshold)
func (*GrpcChainParser) ParseMsg ¶
func (apip *GrpcChainParser) ParseMsg(url string, data []byte, connectionType string, metadata []pairingtypes.Metadata) (ChainMessage, error)
ParseMsg parses message data into chain message object
func (*GrpcChainParser) SetSpec ¶
func (apip *GrpcChainParser) SetSpec(spec spectypes.Spec)
SetSpec sets the spec for the GrpcChainParser
type GrpcChainProxy ¶
type GrpcChainProxy struct { BaseChainProxy // contains filtered or unexported fields }
func (*GrpcChainProxy) SendNodeMsg ¶
func (cp *GrpcChainProxy) SendNodeMsg(ctx context.Context, ch chan interface{}, chainMessage ChainMessageForSend) (relayReply *pairingtypes.RelayReply, subscriptionID string, relayReplyServer *rpcclient.ClientSubscription, err error)
type GrpcNodeErrorResponse ¶
type JrpcChainProxy ¶
type JrpcChainProxy struct { BaseChainProxy // contains filtered or unexported fields }
func (*JrpcChainProxy) SendNodeMsg ¶
func (cp *JrpcChainProxy) SendNodeMsg(ctx context.Context, ch chan interface{}, chainMessage ChainMessageForSend) (relayReply *pairingtypes.RelayReply, subscriptionID string, relayReplyServer *rpcclient.ClientSubscription, err error)
type JsonRPCChainListener ¶
type JsonRPCChainListener struct {
// contains filtered or unexported fields
}
func NewJrpcChainListener ¶
func NewJrpcChainListener(ctx context.Context, listenEndpoint *lavasession.RPCEndpoint, relaySender RelaySender, rpcConsumerLogs *metrics.RPCConsumerLogs) (chainListener *JsonRPCChainListener)
NewJrpcChainListener creates a new instance of JsonRPCChainListener
func (*JsonRPCChainListener) Serve ¶
func (apil *JsonRPCChainListener) Serve(ctx context.Context)
Serve http server for JsonRPCChainListener
type JsonRPCChainParser ¶
type JsonRPCChainParser struct {
BaseChainParser
}
func NewJrpcChainParser ¶
func NewJrpcChainParser() (chainParser *JsonRPCChainParser, err error)
NewJrpcChainParser creates a new instance of JsonRPCChainParser
func (*JsonRPCChainParser) ChainBlockStats ¶
func (apip *JsonRPCChainParser) ChainBlockStats() (allowedBlockLagForQosSync int64, averageBlockTime time.Duration, blockDistanceForFinalizedData uint32, blocksInFinalizationProof uint32)
ChainBlockStats returns block stats from spec (spec.AllowedBlockLagForQosSync, spec.AverageBlockTime, spec.BlockDistanceForFinalizedData)
func (*JsonRPCChainParser) CraftMessage ¶
func (apip *JsonRPCChainParser) CraftMessage(parsing *spectypes.ParseDirective, connectionType string, craftData *CraftData, metadata []pairingtypes.Metadata) (ChainMessageForSend, error)
func (*JsonRPCChainParser) DataReliabilityParams ¶
func (apip *JsonRPCChainParser) DataReliabilityParams() (enabled bool, dataReliabilityThreshold uint32)
DataReliabilityParams returns data reliability params from spec (spec.enabled and spec.dataReliabilityThreshold)
func (*JsonRPCChainParser) GetInternalPaths ¶
func (apip *JsonRPCChainParser) GetInternalPaths() map[string]struct{}
func (*JsonRPCChainParser) ParseMsg ¶
func (apip *JsonRPCChainParser) ParseMsg(url string, data []byte, connectionType string, metadata []pairingtypes.Metadata) (ChainMessage, error)
this func parses message data into chain message object
func (*JsonRPCChainParser) SetSpec ¶
func (apip *JsonRPCChainParser) SetSpec(spec spectypes.Spec)
SetSpec sets the spec for the JsonRPCChainParser
type JsonRPCErrorHandler ¶
type JsonRPCErrorHandler struct {
// contains filtered or unexported fields
}
func (*JsonRPCErrorHandler) HandleNodeError ¶
func (jeh *JsonRPCErrorHandler) HandleNodeError(ctx context.Context, nodeError error) error
type LavaChainFetcher ¶
type LavaChainFetcher struct {
// contains filtered or unexported fields
}
func NewLavaChainFetcher ¶
func NewLavaChainFetcher(ctx context.Context, clientCtx client.Context) *LavaChainFetcher
func (*LavaChainFetcher) FetchBlockHashByNum ¶
func (*LavaChainFetcher) FetchChainID ¶
func (*LavaChainFetcher) FetchEndpoint ¶
func (lcf *LavaChainFetcher) FetchEndpoint() lavasession.RPCProviderEndpoint
func (*LavaChainFetcher) FetchLatestBlockNum ¶
func (lcf *LavaChainFetcher) FetchLatestBlockNum(ctx context.Context) (int64, error)
type RelaySender ¶
type RelaySender interface { SendRelay( ctx context.Context, url string, req string, connectionType string, dappID string, analytics *metrics.RelayMetrics, metadataValues []pairingtypes.Metadata, ) (*pairingtypes.RelayReply, *pairingtypes.Relayer_RelaySubscribeClient, error) }
type RestChainListener ¶
type RestChainListener struct {
// contains filtered or unexported fields
}
func NewRestChainListener ¶
func NewRestChainListener(ctx context.Context, listenEndpoint *lavasession.RPCEndpoint, relaySender RelaySender, rpcConsumerLogs *metrics.RPCConsumerLogs) (chainListener *RestChainListener)
NewRestChainListener creates a new instance of RestChainListener
func (*RestChainListener) Serve ¶
func (apil *RestChainListener) Serve(ctx context.Context)
Serve http server for RestChainListener
type RestChainParser ¶
type RestChainParser struct {
BaseChainParser
}
func NewRestChainParser ¶
func NewRestChainParser() (chainParser *RestChainParser, err error)
NewRestChainParser creates a new instance of RestChainParser
func (*RestChainParser) ChainBlockStats ¶
func (apip *RestChainParser) ChainBlockStats() (allowedBlockLagForQosSync int64, averageBlockTime time.Duration, blockDistanceForFinalizedData uint32, blocksInFinalizationProof uint32)
ChainBlockStats returns block stats from spec (spec.AllowedBlockLagForQosSync, spec.AverageBlockTime, spec.BlockDistanceForFinalizedData)
func (*RestChainParser) CraftMessage ¶
func (apip *RestChainParser) CraftMessage(parsing *spectypes.ParseDirective, connectionType string, craftData *CraftData, metadata []pairingtypes.Metadata) (ChainMessageForSend, error)
func (*RestChainParser) DataReliabilityParams ¶
func (apip *RestChainParser) DataReliabilityParams() (enabled bool, dataReliabilityThreshold uint32)
DataReliabilityParams returns data reliability params from spec (spec.enabled and spec.dataReliabilityThreshold)
func (*RestChainParser) ParseMsg ¶
func (apip *RestChainParser) ParseMsg(url string, data []byte, connectionType string, metadata []pairingtypes.Metadata) (ChainMessage, error)
ParseMsg parses message data into chain message object
func (*RestChainParser) SetSpec ¶
func (apip *RestChainParser) SetSpec(spec spectypes.Spec)
SetSpec sets the spec for the TendermintChainParser
type RestChainProxy ¶
type RestChainProxy struct {
BaseChainProxy
}
func (*RestChainProxy) SendNodeMsg ¶
func (rcp *RestChainProxy) SendNodeMsg(ctx context.Context, ch chan interface{}, chainMessage ChainMessageForSend) (relayReply *pairingtypes.RelayReply, subscriptionID string, relayReplyServer *rpcclient.ClientSubscription, err error)
type RestErrorHandler ¶
type RestErrorHandler struct {
// contains filtered or unexported fields
}
func (*RestErrorHandler) HandleNodeError ¶
func (rne *RestErrorHandler) HandleNodeError(ctx context.Context, nodeError error) error
Validating if the error is related to the provider connection or not returning nil if its not one of the expected connectivity error types
type TaggedContainer ¶
type TaggedContainer struct { Parsing *spectypes.ParseDirective ApiCollection *spectypes.ApiCollection }
type TendermintChainParser ¶
type TendermintChainParser struct {
BaseChainParser
}
func NewTendermintRpcChainParser ¶
func NewTendermintRpcChainParser() (chainParser *TendermintChainParser, err error)
NewTendermintRpcChainParser creates a new instance of TendermintChainParser
func (*TendermintChainParser) ChainBlockStats ¶
func (apip *TendermintChainParser) ChainBlockStats() (allowedBlockLagForQosSync int64, averageBlockTime time.Duration, blockDistanceForFinalizedData uint32, blocksInFinalizationProof uint32)
ChainBlockStats returns block stats from spec (spec.AllowedBlockLagForQosSync, spec.AverageBlockTime, spec.BlockDistanceForFinalizedData, spec.BlocksInFinalizationProof)
func (*TendermintChainParser) CraftMessage ¶
func (apip *TendermintChainParser) CraftMessage(parsing *spectypes.ParseDirective, connectionType string, craftData *CraftData, metadata []pairingtypes.Metadata) (ChainMessageForSend, error)
func (*TendermintChainParser) DataReliabilityParams ¶
func (apip *TendermintChainParser) DataReliabilityParams() (enabled bool, dataReliabilityThreshold uint32)
DataReliabilityParams returns data reliability params from spec (spec.enabled and spec.dataReliabilityThreshold)
func (*TendermintChainParser) ParseMsg ¶
func (apip *TendermintChainParser) ParseMsg(url string, data []byte, connectionType string, metadata []pairingtypes.Metadata) (ChainMessage, error)
ParseMsg parses message data into chain message object
func (*TendermintChainParser) SetSpec ¶
func (apip *TendermintChainParser) SetSpec(spec spectypes.Spec)
SetSpec sets the spec for the TendermintChainParser
type TendermintRPCErrorHandler ¶
type TendermintRPCErrorHandler struct {
// contains filtered or unexported fields
}
func (*TendermintRPCErrorHandler) HandleNodeError ¶
func (tendermintErrorHandler *TendermintRPCErrorHandler) HandleNodeError(ctx context.Context, nodeError error) error
type TendermintRpcChainListener ¶
type TendermintRpcChainListener struct {
// contains filtered or unexported fields
}
func NewTendermintRpcChainListener ¶
func NewTendermintRpcChainListener(ctx context.Context, listenEndpoint *lavasession.RPCEndpoint, relaySender RelaySender, rpcConsumerLogs *metrics.RPCConsumerLogs) (chainListener *TendermintRpcChainListener)
NewTendermintRpcChainListener creates a new instance of TendermintRpcChainListener
func (*TendermintRpcChainListener) Serve ¶
func (apil *TendermintRpcChainListener) Serve(ctx context.Context)
Serve http server for TendermintRpcChainListener
type TestStruct ¶
type TestStruct struct { Ctx context.Context Keepers *keepertest.Keepers Servers *keepertest.Servers Providers []testcommon.Account Spec spectypes.Spec Plan plantypes.Plan Consumer testcommon.Account }