Documentation ¶
Index ¶
- Variables
- type Config
- type DummyServer
- type MixConfig
- type NativeStakingConfig
- type NativeStakingServer
- func (s *NativeStakingServer) Committee() *committee.NativeCommittee
- func (s *NativeStakingServer) GetBuckets(ctx context.Context, request *api.GetBucketsRequest) (*api.BucketResponse, error)
- func (s *NativeStakingServer) GetBucketsByCandidate(ctx context.Context, request *api.GetBucketsByCandidateRequest) (*api.BucketResponse, error)
- func (s *NativeStakingServer) GetCandidateByName(ctx context.Context, request *api.GetCandidateByNameRequest) (*api.Candidate, error)
- func (s *NativeStakingServer) GetCandidates(ctx context.Context, request *api.GetCandidatesRequest) (*api.CandidateResponse, error)
- func (s *NativeStakingServer) GetMeta(ctx context.Context, empty *empty.Empty) (*api.ChainMeta, error)
- func (s *NativeStakingServer) GetRawData(ctx context.Context, request *api.GetRawDataRequest) (*api.RawDataResponse, error)
- func (s *NativeStakingServer) IsHealth(ctx context.Context, empty *empty.Empty) (*api.HealthCheckResponse, error)
- func (s *NativeStakingServer) Start(ctx context.Context) error
- func (s *NativeStakingServer) Stop(ctx context.Context) error
- type Server
- type ServerMix
Constants ¶
This section is empty.
Variables ¶
var ErrNotSupported = errors.New("Not supported")
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { DB db.Config `yaml:"db"` Port int `yaml:"port"` HttpPort int `yaml:"httpPort"` Committee committee.Config `yaml:"committee"` SelfStakingThreshold string `yaml:"selfStakingThreshold"` ScoreThreshold string `yaml:"scoreThreshold"` }
Config defines the config for server
type DummyServer ¶ added in v0.2.14
type DummyServer interface { api.APIServiceServer Start(context.Context) error Stop(context.Context) error }
DummyServer defines the interface of the ranking dummy server implementation
func NewDummyServer ¶ added in v0.2.14
func NewDummyServer(port int, httpPort int) (DummyServer, error)
NewDummyServer returns an implementation of ranking dummy server
type MixConfig ¶ added in v0.2.14
type MixConfig struct { ElectionConfig Config `yaml:"electionConfig"` NativeConfig NativeStakingConfig `yaml:"nativeConfig"` VoteSync votesync.Config `yaml:"voteSync"` EnableVoteSync bool `yaml:"enableVoteSync"` DummyServerPort int `yaml:"dummyServerPort"` DummyServerHttpPort int `yaml:"dummyServerHttpPort"` }
type NativeStakingConfig ¶ added in v0.2.14
type NativeStakingConfig struct { DB db.Config `yaml:"db"` Port int `yaml:"port"` Committee committee.NativeCommitteeConfig `yaml:"committee"` }
NativeStakingConfig defines the config for native staking server
type NativeStakingServer ¶ added in v0.2.14
type NativeStakingServer struct { api.APIServiceServer // contains filtered or unexported fields }
NativeStakingServer implements api.APIServiceServer.
func NewNativeStakingServer ¶ added in v0.2.14
func NewNativeStakingServer(cfg *NativeStakingConfig) (*NativeStakingServer, error)
NewNativeStakingServer returns an implementation of ranking server
func (*NativeStakingServer) Committee ¶ added in v0.2.14
func (s *NativeStakingServer) Committee() *committee.NativeCommittee
func (*NativeStakingServer) GetBuckets ¶ added in v0.2.14
func (s *NativeStakingServer) GetBuckets(ctx context.Context, request *api.GetBucketsRequest) (*api.BucketResponse, error)
GetBuckets returns a list of buckets
func (*NativeStakingServer) GetBucketsByCandidate ¶ added in v0.2.14
func (s *NativeStakingServer) GetBucketsByCandidate(ctx context.Context, request *api.GetBucketsByCandidateRequest) (*api.BucketResponse, error)
GetBucketsByCandidate returns the buckets
func (*NativeStakingServer) GetCandidateByName ¶ added in v0.2.14
func (s *NativeStakingServer) GetCandidateByName(ctx context.Context, request *api.GetCandidateByNameRequest) (*api.Candidate, error)
GetCandidateByName returns the candidate details
func (*NativeStakingServer) GetCandidates ¶ added in v0.2.14
func (s *NativeStakingServer) GetCandidates(ctx context.Context, request *api.GetCandidatesRequest) (*api.CandidateResponse, error)
GetCandidates returns a list of candidates sorted by weighted votes
func (*NativeStakingServer) GetMeta ¶ added in v0.2.14
func (s *NativeStakingServer) GetMeta(ctx context.Context, empty *empty.Empty) (*api.ChainMeta, error)
GetMeta returns the meta of the chain
func (*NativeStakingServer) GetRawData ¶ added in v0.2.14
func (s *NativeStakingServer) GetRawData(ctx context.Context, request *api.GetRawDataRequest) (*api.RawDataResponse, error)
func (*NativeStakingServer) IsHealth ¶ added in v0.2.14
func (s *NativeStakingServer) IsHealth(ctx context.Context, empty *empty.Empty) (*api.HealthCheckResponse, error)
type Server ¶
type Server interface { api.APIServiceServer Start(context.Context) error Stop(context.Context) error }
Server defines the interface of the ranking server implementation
type ServerMix ¶ added in v0.2.14
type ServerMix struct {
// contains filtered or unexported fields
}