Documentation
¶
Index ¶
- func CompareAggregatedLabels(a, b []AggregatedLabels) bool
- func CreateBlockEventProcessor(ctx context.Context, conf *config.Upstream, ...) event_processors.UpstreamStateEventProcessor
- func CreateHeadEventProcessor(ctx context.Context, conf *config.Upstream, ...) event_processors.UpstreamStateEventProcessor
- func CreateHealthEventProcessor(ctx context.Context, conf *config.Upstream, ...) event_processors.UpstreamStateEventProcessor
- func CreateLabelsEventProcessor(ctx context.Context, conf *config.Upstream, ...) event_processors.UpstreamStateEventProcessor
- func CreateLowerBoundsEventProcessor(ctx context.Context, conf *config.Upstream, ...) event_processors.UpstreamStateEventProcessor
- func CreateSettingsEventProcessor(ctx context.Context, conf *config.Upstream, ...) event_processors.UpstreamStateEventProcessor
- type AddChainSupervisorEvent
- type AggregatedLabels
- type BaseChainSupervisor
- func (b *BaseChainSupervisor) GetChain() chains.Chain
- func (b *BaseChainSupervisor) GetChainState() ChainSupervisorState
- func (b *BaseChainSupervisor) GetMethod(methodName string) *specs.Method
- func (b *BaseChainSupervisor) GetMethods() []string
- func (b *BaseChainSupervisor) GetSortedUpstreamIds(filterFunc FilterUpstream, sortFunc SortUpstream) []string
- func (b *BaseChainSupervisor) GetUpstreamIds() []string
- func (b *BaseChainSupervisor) GetUpstreamState(upstreamId string) *protocol.UpstreamState
- func (b *BaseChainSupervisor) PublishUpstreamEvent(event protocol.UpstreamEvent)
- func (b *BaseChainSupervisor) Start()
- func (b *BaseChainSupervisor) SubscribeState(name string) *utils.Subscription[*ChainSupervisorStateWrapperEvent]
- type BaseUpstream
- func (u *BaseUpstream) BanMethod(method string)
- func (u *BaseUpstream) GetChain() chains.Chain
- func (u *BaseUpstream) GetConnector(connectorType protocol.ApiConnectorType) connectors.ApiConnector
- func (u *BaseUpstream) GetHashIndex() string
- func (u *BaseUpstream) GetId() string
- func (u *BaseUpstream) GetUpstreamState() protocol.UpstreamState
- func (u *BaseUpstream) GetVendorType() UpstreamVendor
- func (u *BaseUpstream) PartialStop()
- func (u *BaseUpstream) Resume()
- func (u *BaseUpstream) Running() bool
- func (u *BaseUpstream) Start()
- func (u *BaseUpstream) Stop()
- func (u *BaseUpstream) Subscribe(name string) *utils.Subscription[protocol.UpstreamEvent]
- func (u *BaseUpstream) UpdateBlock(block protocol.Block, blockType protocol.BlockType)
- func (u *BaseUpstream) UpdateHead(height, slot uint64)
- type BaseUpstreamSupervisor
- func (b *BaseUpstreamSupervisor) GetChainSupervisor(chain chains.Chain) ChainSupervisor
- func (b *BaseUpstreamSupervisor) GetChainSupervisors() []ChainSupervisor
- func (b *BaseUpstreamSupervisor) GetExecutor() failsafe.Executor[*protocol.ResponseHolderWrapper]
- func (b *BaseUpstreamSupervisor) GetUpstream(upstreamId string) Upstream
- func (b *BaseUpstreamSupervisor) StartUpstreams()
- func (b *BaseUpstreamSupervisor) SubscribeChainSupervisor(name string) *utils.Subscription[ChainSupervisorEvent]
- type BlocksWrapper
- type ChainHeadData
- type ChainSupervisor
- type ChainSupervisorEvent
- type ChainSupervisorState
- type ChainSupervisorStateWrapper
- type ChainSupervisorStateWrapperEvent
- type FilterUpstream
- type HeadWrapper
- type LabelsWrapper
- type LowerBoundsWrapper
- type MethodsWrapper
- type SortUpstream
- type StatusWrapper
- type SubMethodsWrapper
- type Upstream
- type UpstreamStatsService
- type UpstreamSupervisor
- type UpstreamVendor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompareAggregatedLabels ¶
func CompareAggregatedLabels(a, b []AggregatedLabels) bool
func CreateBlockEventProcessor ¶
func CreateBlockEventProcessor( ctx context.Context, conf *config.Upstream, requestConnector connectors.ApiConnector, chainSpecific specific.ChainSpecific, configuredChain *chains.ConfiguredChain, ) event_processors.UpstreamStateEventProcessor
func CreateHeadEventProcessor ¶
func CreateHeadEventProcessor( ctx context.Context, conf *config.Upstream, headConnector connectors.ApiConnector, chainSpecific specific.ChainSpecific, chain chains.Chain, ) event_processors.UpstreamStateEventProcessor
func CreateHealthEventProcessor ¶
func CreateHealthEventProcessor( ctx context.Context, conf *config.Upstream, chainSpecific specific.ChainSpecific, ) event_processors.UpstreamStateEventProcessor
func CreateLabelsEventProcessor ¶
func CreateLabelsEventProcessor( ctx context.Context, conf *config.Upstream, chainSpecific specific.ChainSpecific, ) event_processors.UpstreamStateEventProcessor
func CreateLowerBoundsEventProcessor ¶
func CreateLowerBoundsEventProcessor( ctx context.Context, conf *config.Upstream, chainSpecific specific.ChainSpecific, ) event_processors.UpstreamStateEventProcessor
func CreateSettingsEventProcessor ¶
func CreateSettingsEventProcessor( ctx context.Context, conf *config.Upstream, chainSpecific specific.ChainSpecific, ) event_processors.UpstreamStateEventProcessor
Types ¶
type AddChainSupervisorEvent ¶
type AddChainSupervisorEvent struct {
ChainSupervisor ChainSupervisor
}
type AggregatedLabels ¶
func NewAggregatedLabels ¶
func NewAggregatedLabels(amount int, labels map[string]string) AggregatedLabels
func (AggregatedLabels) Equals ¶
func (a AggregatedLabels) Equals(other AggregatedLabels) bool
type BaseChainSupervisor ¶
type BaseChainSupervisor struct {
// contains filtered or unexported fields
}
func NewBaseChainSupervisor ¶
func NewBaseChainSupervisor(ctx context.Context, chain chains.Chain, fc choice.ForkChoice, tracker dimensions.DimensionTracker) *BaseChainSupervisor
func (*BaseChainSupervisor) GetChain ¶
func (b *BaseChainSupervisor) GetChain() chains.Chain
func (*BaseChainSupervisor) GetChainState ¶
func (b *BaseChainSupervisor) GetChainState() ChainSupervisorState
func (*BaseChainSupervisor) GetMethod ¶
func (b *BaseChainSupervisor) GetMethod(methodName string) *specs.Method
func (*BaseChainSupervisor) GetMethods ¶
func (b *BaseChainSupervisor) GetMethods() []string
func (*BaseChainSupervisor) GetSortedUpstreamIds ¶
func (b *BaseChainSupervisor) GetSortedUpstreamIds(filterFunc FilterUpstream, sortFunc SortUpstream) []string
func (*BaseChainSupervisor) GetUpstreamIds ¶
func (b *BaseChainSupervisor) GetUpstreamIds() []string
func (*BaseChainSupervisor) GetUpstreamState ¶
func (b *BaseChainSupervisor) GetUpstreamState(upstreamId string) *protocol.UpstreamState
func (*BaseChainSupervisor) PublishUpstreamEvent ¶
func (b *BaseChainSupervisor) PublishUpstreamEvent(event protocol.UpstreamEvent)
func (*BaseChainSupervisor) Start ¶
func (b *BaseChainSupervisor) Start()
func (*BaseChainSupervisor) SubscribeState ¶
func (b *BaseChainSupervisor) SubscribeState(name string) *utils.Subscription[*ChainSupervisorStateWrapperEvent]
type BaseUpstream ¶
type BaseUpstream struct {
// contains filtered or unexported fields
}
func NewBaseUpstream ¶
func NewBaseUpstream( ctx context.Context, cancelFunc context.CancelFunc, conf *config.Upstream, configuredChain *chains.ConfiguredChain, upstreamIndex int, creationData *upstreamCreationData, processorAggregator *event_processors.UpstreamProcessorAggregator, ) (*BaseUpstream, error)
func NewBaseUpstreamWithParams ¶
func NewBaseUpstreamWithParams( id string, chain chains.Chain, apiConnectors []connectors.ApiConnector, upConfig *config.Upstream, index string, upState *utils.Atomic[protocol.UpstreamState], processorAggregator *event_processors.UpstreamProcessorAggregator, stateChan *chan protocol.AbstractUpstreamStateEvent, emitter *event_processors.Emitter, ) *BaseUpstream
func (*BaseUpstream) BanMethod ¶
func (u *BaseUpstream) BanMethod(method string)
func (*BaseUpstream) GetChain ¶
func (u *BaseUpstream) GetChain() chains.Chain
func (*BaseUpstream) GetConnector ¶
func (u *BaseUpstream) GetConnector(connectorType protocol.ApiConnectorType) connectors.ApiConnector
func (*BaseUpstream) GetHashIndex ¶
func (u *BaseUpstream) GetHashIndex() string
func (*BaseUpstream) GetId ¶
func (u *BaseUpstream) GetId() string
func (*BaseUpstream) GetUpstreamState ¶
func (u *BaseUpstream) GetUpstreamState() protocol.UpstreamState
func (*BaseUpstream) GetVendorType ¶
func (u *BaseUpstream) GetVendorType() UpstreamVendor
func (*BaseUpstream) PartialStop ¶
func (u *BaseUpstream) PartialStop()
func (*BaseUpstream) Resume ¶
func (u *BaseUpstream) Resume()
func (*BaseUpstream) Running ¶
func (u *BaseUpstream) Running() bool
func (*BaseUpstream) Start ¶
func (u *BaseUpstream) Start()
func (*BaseUpstream) Stop ¶
func (u *BaseUpstream) Stop()
func (*BaseUpstream) Subscribe ¶
func (u *BaseUpstream) Subscribe(name string) *utils.Subscription[protocol.UpstreamEvent]
func (*BaseUpstream) UpdateBlock ¶
func (u *BaseUpstream) UpdateBlock(block protocol.Block, blockType protocol.BlockType)
func (*BaseUpstream) UpdateHead ¶
func (u *BaseUpstream) UpdateHead(height, slot uint64)
type BaseUpstreamSupervisor ¶
type BaseUpstreamSupervisor struct {
// contains filtered or unexported fields
}
func (*BaseUpstreamSupervisor) GetChainSupervisor ¶
func (b *BaseUpstreamSupervisor) GetChainSupervisor(chain chains.Chain) ChainSupervisor
func (*BaseUpstreamSupervisor) GetChainSupervisors ¶
func (b *BaseUpstreamSupervisor) GetChainSupervisors() []ChainSupervisor
func (*BaseUpstreamSupervisor) GetExecutor ¶
func (b *BaseUpstreamSupervisor) GetExecutor() failsafe.Executor[*protocol.ResponseHolderWrapper]
func (*BaseUpstreamSupervisor) GetUpstream ¶
func (b *BaseUpstreamSupervisor) GetUpstream(upstreamId string) Upstream
func (*BaseUpstreamSupervisor) StartUpstreams ¶
func (b *BaseUpstreamSupervisor) StartUpstreams()
func (*BaseUpstreamSupervisor) SubscribeChainSupervisor ¶
func (b *BaseUpstreamSupervisor) SubscribeChainSupervisor(name string) *utils.Subscription[ChainSupervisorEvent]
type BlocksWrapper ¶
func NewBlocksWrapper ¶
func NewBlocksWrapper(blocks map[protocol.BlockType]protocol.Block) *BlocksWrapper
type ChainHeadData ¶
func NewChainHeadData ¶
func NewChainHeadData(head protocol.Block, upstreamId string) ChainHeadData
func (ChainHeadData) IsEmpty ¶
func (c ChainHeadData) IsEmpty() bool
type ChainSupervisor ¶
type ChainSupervisor interface {
Start()
GetChain() chains.Chain
GetChainState() ChainSupervisorState
GetMethod(methodName string) *specs.Method
GetMethods() []string
GetUpstreamState(upstreamId string) *protocol.UpstreamState
GetSortedUpstreamIds(filterFunc FilterUpstream, sortFunc SortUpstream) []string
GetUpstreamIds() []string
PublishUpstreamEvent(event protocol.UpstreamEvent)
SubscribeState(name string) *utils.Subscription[*ChainSupervisorStateWrapperEvent]
}
type ChainSupervisorEvent ¶
type ChainSupervisorEvent interface {
// contains filtered or unexported methods
}
type ChainSupervisorState ¶
type ChainSupervisorState struct {
Status protocol.AvailabilityStatus
HeadData ChainHeadData
Methods methods.Methods
Blocks map[protocol.BlockType]protocol.Block
LowerBounds map[protocol.LowerBoundType]protocol.LowerBoundData
ChainLabels []AggregatedLabels
SubMethods mapset.Set[string]
}
func (ChainSupervisorState) Compare ¶
func (c ChainSupervisorState) Compare(new ChainSupervisorState) []ChainSupervisorStateWrapper
type ChainSupervisorStateWrapper ¶
type ChainSupervisorStateWrapper interface {
// contains filtered or unexported methods
}
type ChainSupervisorStateWrapperEvent ¶
type ChainSupervisorStateWrapperEvent struct {
Wrappers []ChainSupervisorStateWrapper
}
type FilterUpstream ¶
type FilterUpstream func(id string, state *protocol.UpstreamState) bool
type HeadWrapper ¶
func NewHeadWrapper ¶
func NewHeadWrapper(head protocol.Block) *HeadWrapper
type LabelsWrapper ¶
type LabelsWrapper struct {
Labels []AggregatedLabels
}
func NewLabelsWrapper ¶
func NewLabelsWrapper(labels []AggregatedLabels) *LabelsWrapper
type LowerBoundsWrapper ¶
type LowerBoundsWrapper struct {
LowerBounds []protocol.LowerBoundData
}
func NewLowerBoundsWrapper ¶
func NewLowerBoundsWrapper(lowerBounds []protocol.LowerBoundData) *LowerBoundsWrapper
type MethodsWrapper ¶
type MethodsWrapper struct {
Methods []string
}
func NewMethodsWrapper ¶
func NewMethodsWrapper(methods []string) *MethodsWrapper
type SortUpstream ¶
type StatusWrapper ¶
type StatusWrapper struct {
Status protocol.AvailabilityStatus
}
func NewStatusWrapper ¶
func NewStatusWrapper(status protocol.AvailabilityStatus) *StatusWrapper
type SubMethodsWrapper ¶
type SubMethodsWrapper struct {
SubMethods []string
}
func NewSubMethodsWrapper ¶
func NewSubMethodsWrapper(subMethods []string) *SubMethodsWrapper
type Upstream ¶
type Upstream interface {
Start()
Resume()
PartialStop()
Stop()
Running() bool
Subscribe(name string) *utils.Subscription[protocol.UpstreamEvent]
GetId() string
GetChain() chains.Chain
GetVendorType() UpstreamVendor
GetUpstreamState() protocol.UpstreamState
GetConnector(connectorType protocol.ApiConnectorType) connectors.ApiConnector
GetHashIndex() string
UpdateHead(height, slot uint64)
UpdateBlock(block protocol.Block, blockType protocol.BlockType)
BanMethod(method string)
}
func CreateUpstream ¶
func CreateUpstream( ctx context.Context, conf *config.Upstream, tracker dimensions.DimensionTracker, statsService UpstreamStatsService, executor failsafe.Executor[protocol.ResponseHolder], upstreamIndex int, rateLimitBudgetRegistry *ratelimiter.RateLimitBudgetRegistry, torProxyUrl string, ) (Upstream, error)
type UpstreamStatsService ¶
type UpstreamStatsService interface {
AddRequestResults(requestResults []protocol.RequestResult)
}
type UpstreamSupervisor ¶
type UpstreamSupervisor interface {
GetChainSupervisor(chain chains.Chain) ChainSupervisor
GetChainSupervisors() []ChainSupervisor
GetUpstream(string) Upstream
GetExecutor() failsafe.Executor[*protocol.ResponseHolderWrapper]
StartUpstreams()
SubscribeChainSupervisor(name string) *utils.Subscription[ChainSupervisorEvent]
}
func NewBaseUpstreamSupervisor ¶
func NewBaseUpstreamSupervisor( ctx context.Context, upstreamsConfig *config.UpstreamConfig, tracker dimensions.DimensionTracker, statsService UpstreamStatsService, rateLimitBudgetRegistry *ratelimiter.RateLimitBudgetRegistry, torProxyUrl string, ) UpstreamSupervisor
type UpstreamVendor ¶
type UpstreamVendor int
const ( Unknown UpstreamVendor = iota QuickNode DRPC Alchemy Infura )
func DetectUpstreamVendor ¶
func DetectUpstreamVendor(urls []string) UpstreamVendor
Source Files
¶
Click to show internal directories.
Click to hide internal directories.