Documentation ¶
Index ¶
- Constants
- func CreateBadgeGeneratorCobraCommand() *cobra.Command
- func RunBadgeServer(cmd *cobra.Command, v *viper.Viper)
- type BadgeStateTracker
- func (st *BadgeStateTracker) RegisterForDowntimeParamsUpdates(ctx context.Context, ...) error
- func (st *BadgeStateTracker) RegisterForEpochUpdates(ctx context.Context, epochUpdatable statetracker.EpochUpdatable)
- func (st *BadgeStateTracker) RegisterForSpecUpdates(ctx context.Context, specUpdatable statetracker.SpecUpdatable, ...) error
- type HealthServer
- type IpData
- type IpService
- type MetricsService
- type ProjectConfiguration
- type Server
- func (s *Server) Active() bool
- func (s *Server) GenerateBadge(ctx context.Context, req *pairingtypes.GenerateBadgeRequest) (*pairingtypes.GenerateBadgeResponse, error)
- func (s *Server) GetEpoch() uint64
- func (s *Server) GetUniqueName() string
- func (s *Server) InitializeStateTracker(tracker *BadgeStateTracker)
- func (s *Server) SetSpec(specUpdate spectypes.Spec)
- func (s *Server) UpdateEpoch(epoch uint64)
- type UserBadgeItem
Constants ¶
View Source
const ( PortEnvironmentVariable = "PORT" MetricsPortEnvironmentVariable = "METRICS_PORT" UserDataEnvironmentVariable = "USER_DATA" GrpcUrlEnvironmentVariable = "GRPC_URL" LavaChainIDEnvironmentVariable = "CHAIN_ID" DefaultGeolocationEnvironmentVariable = "DEFAULT_GEOLOCATION" CountriesFilePathEnvironmentVariable = "COUNTRIES_FILE_PATH" IpFilePathEnvironmentVariable = "IP_FILE_PATH" )
View Source
const AddBlockDelayForEpochUpdaterBadgeServer = 2
adding 3 blocks delay, to update the epoch. the reason is for the sdk to wait until all providers are synced to the new epoch before SDK gets a new pairing list.
View Source
const DefaultProjectId = "default"
View Source
const RefererHeaderKey = "Referer"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BadgeStateTracker ¶
type BadgeStateTracker struct { *statetracker.StateTracker statetracker.ConsumerEmergencyTrackerInf // contains filtered or unexported fields }
func NewBadgeStateTracker ¶
func NewBadgeStateTracker(ctx context.Context, clientCtx cosmosclient.Context, chainFetcher chaintracker.ChainFetcher, chainId string) (ret *BadgeStateTracker, err error)
func (*BadgeStateTracker) RegisterForDowntimeParamsUpdates ¶
func (st *BadgeStateTracker) RegisterForDowntimeParamsUpdates(ctx context.Context, downtimeParamsUpdatable statetracker.DowntimeParamsUpdatable) error
func (*BadgeStateTracker) RegisterForEpochUpdates ¶
func (st *BadgeStateTracker) RegisterForEpochUpdates(ctx context.Context, epochUpdatable statetracker.EpochUpdatable)
func (*BadgeStateTracker) RegisterForSpecUpdates ¶
func (st *BadgeStateTracker) RegisterForSpecUpdates(ctx context.Context, specUpdatable statetracker.SpecUpdatable, endpoint lavasession.RPCEndpoint) error
type HealthServer ¶
type HealthServer struct {
health.UnimplementedHealthServer
}
func (*HealthServer) Check ¶
func (s *HealthServer) Check(ctx context.Context, in *health.HealthCheckRequest) (*health.HealthCheckResponse, error)
func (*HealthServer) Watch ¶
func (s *HealthServer) Watch(in *health.HealthCheckRequest, _ health.Health_WatchServer) error
type IpService ¶
type IpService struct { DefaultGeolocation int CountryCsvFilePath string IpTsvFilePath string IpCountryData *[]*IpData }
func InitIpService ¶
func (*IpService) ReadIpTsvFileData ¶
type MetricsService ¶
type MetricsService struct { TotalRequests prometheus.Counter FailedRequests prometheus.Counter SuccessfulRequests prometheus.Counter }
func InitMetrics ¶
func InitMetrics() *MetricsService
func (*MetricsService) AddRequest ¶
func (service *MetricsService) AddRequest(isSuccessful bool)
type ProjectConfiguration ¶
type ProjectConfiguration struct { ProjectPublicKey string `json:"project_public_key"` ProjectPrivateKey string `json:"private_key"` EpochsMaxCu int64 `json:"epochs_max_cu"` UpdatedEpoch map[string]uint64 `json:"update_epoch,omitempty"` PairingList map[string]*types.QueryGetPairingResponse `json:"pairing_list,omitempty"` }
type Server ¶
type Server struct { pairingtypes.UnimplementedBadgeGeneratorServer ProjectsConfiguration map[string]map[string]*ProjectConfiguration // geolocation/project_id/project_data ChainId string IpService *IpService // contains filtered or unexported fields }
func (*Server) GenerateBadge ¶
func (s *Server) GenerateBadge(ctx context.Context, req *pairingtypes.GenerateBadgeRequest) (*pairingtypes.GenerateBadgeResponse, error)
func (*Server) GetUniqueName ¶
func (*Server) InitializeStateTracker ¶
func (s *Server) InitializeStateTracker(tracker *BadgeStateTracker)
func (*Server) UpdateEpoch ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.