Documentation
¶
Index ¶
Constants ¶
const ( // PubChanSize is the size of the channel used to communicate with the pool of HTTP workers. PubChanSize = 1000 // ObservationChanSize is the size of the channel used to post observations to the batching worker for a given endpoint. ObservationChanSize = 1000 // NumWorkersPerEndpoint is how many HTTP workers will be created per endpoint (so we create NumWorkersPerEndpoint * len(endpoints)). NumWorkersPerEndpoint = 10 // These are used to create the http.Transport used by the http.Client. See https://www.loginradius.com/blog/engineering/tune-the-go-http-client-for-high-performance/ for tuning details. // TODO: What values make sense here? Maybe use NumWorkersPerEndpoint for last two and NumWorkersPerEndpoint * len(endpoints) for first one? MaxIdleConns = 100 MaxConnsPerHost = 100 MaxIdleConnsPerHost = 100 // HttpClientTimeout is the timeout used on the HTTP client connection. HttpClientTimeout = 10 * time.Second )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AlternatePublisher ¶
type AlternatePublisher struct {
// contains filtered or unexported fields
}
AlternatePublisher is used to manage alternate publishing. There is a single instance for a guardian if alternate publishing is enabled.
func NewAlternatePublisher ¶
func NewAlternatePublisher(logger *zap.Logger, guardianAddr []byte, configs []string) (*AlternatePublisher, error)
NewAlternatePublisher creates an alternate publisher object, validating the endpoint parameters. Returns nil,nil if the feature is not enabled.
func (*AlternatePublisher) GetFeatures ¶
func (ap *AlternatePublisher) GetFeatures() string
GetFeatures returns the status string to be published in P2P heartbeats. For now, it just returns a static string listing the enabled endpoints, but in the future, it might return the actual status of each endpoint or something. NOTE: `node.getStaticFeatureFlags` assumes that this does not change after initialization.
func (*AlternatePublisher) PublishObservation ¶
func (ap *AlternatePublisher) PublishObservation(emitterChain vaa.ChainID, obs *gossipv1.Observation)
PublishObservation publishes a signed observation to all the endpoints that care about it. It handles both immediate and delayed publishers.
type BatchWorker ¶
type BatchWorker struct {
// contains filtered or unexported fields
}
BatchWorker is the data passed to the batch worker for an endpoint that is doing batching (delay not zero).
type EnabledChains ¶
type EnabledChains struct {
// contains filtered or unexported fields
}
EnabledChains tracks the chains for which publishing is enabled. - If the map is empty, all chains are enabled. - If `exceptFor` is false, then the chains in the map are enabled. - If `exceptFor is true, then all but the chains in the map are enabled.
func (EnabledChains) String ¶
func (e EnabledChains) String() string
String implementation of our enabled chains map. It prints the enabled chains in chainID order.
type Endpoint ¶
type Endpoint struct {
// contains filtered or unexported fields
}
Endpoint defines a single endpoint to which we should publish.
type HttpRequest ¶
type HttpRequest struct {
// contains filtered or unexported fields
}
HttpRequest is the object sent to the worker for publishing.
type HttpWorker ¶
type HttpWorker struct {
// contains filtered or unexported fields
}
HttpWorker is the data passed to an individual HTTP worker on startup.