Documentation ¶
Index ¶
- Constants
- type Block
- type BlockTemplate
- type Config
- type ErrorReply
- type JSONPushMessage
- type JSONRpcReq
- type JSONRpcResp
- type MinerSubInfo
- type Proxy
- type ProxyServer
- func (s *ProxyServer) ChoiceSubLogin(login string, ok bool, subLogin string) (string, int)
- func (s *ProxyServer) InitSubLogin()
- func (s *ProxyServer) ListenTCP()
- func (s *ProxyServer) RedisMessage(payload string)
- func (s *ProxyServer) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (s *ProxyServer) Start()
- func (s *ProxyServer) WriteMapReportRate(login string, reported int64, ts int64)
- type ReportedRate
- type Session
- type Stratum
- type StratumReq
- type SubmitReply
- type Upstream
Constants ¶
View Source
const (
MaxReqSize = 1024
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Block ¶
type Block struct {
// contains filtered or unexported fields
}
func (Block) Difficulty ¶
func (Block) HashNoNonce ¶
type BlockTemplate ¶
type Config ¶
type Config struct { Name string `json:"name"` Proxy Proxy `json:"proxy"` Api api.ApiConfig `json:"api"` Upstream []Upstream `json:"upstream"` UpstreamCheckInterval string `json:"upstreamCheckInterval"` Threads int `json:"threads"` Coin string `json:"coin"` Pplns int64 `json:"pplns"` Net string `json:"net"` NetId int64 `json:"netid"` Redis redis.Config `json:"redis"` Mysql mysql.Config `json:"mysql"` BlockUnlocker payouts.UnlockerConfig `json:"unlocker"` Payouts payouts.PayoutsConfig `json:"payouts"` NewrelicName string `json:"newrelicName"` NewrelicKey string `json:"newrelicKey"` NewrelicVerbose bool `json:"newrelicVerbose"` NewrelicEnabled bool `json:"newrelicEnabled"` }
type ErrorReply ¶
type JSONPushMessage ¶
type JSONPushMessage struct { // FIXME: Temporarily add ID for Claymore compliance Id int64 `json:"id"` Version string `json:"jsonrpc"` Result interface{} `json:"result"` }
Stratum
type JSONRpcReq ¶
type JSONRpcReq struct { Id json.RawMessage `json:"id"` Method string `json:"method"` Params json.RawMessage `json:"params"` }
type JSONRpcResp ¶
type JSONRpcResp struct { Id json.RawMessage `json:"id"` Version string `json:"jsonrpc"` Result interface{} `json:"result"` Error interface{} `json:"error,omitempty"` }
type MinerSubInfo ¶
type MinerSubInfo struct {
// contains filtered or unexported fields
}
type Proxy ¶
type Proxy struct { Enabled bool `json:"enabled"` Listen string `json:"listen"` LimitHeadersSize int `json:"limitHeadersSize"` LimitBodySize int64 `json:"limitBodySize"` BehindReverseProxy bool `json:"behindReverseProxy"` BlockRefreshInterval string `json:"blockRefreshInterval"` Difficulty int64 `json:"difficulty"` StateUpdateInterval string `json:"stateUpdateInterval"` HashrateExpiration string `json:"hashrateExpiration"` StratumHostname string `json:"stratumHostname"` Policy policy.Config `json:"policy"` MaxFails int64 `json:"maxFails"` HealthCheck bool `json:"healthCheck"` Stratum Stratum `json:"stratum"` }
type ProxyServer ¶
type ProxyServer struct {
// contains filtered or unexported fields
}
func NewProxy ¶
func NewProxy(cfg *Config, backend *redis.RedisClient, db *mysql.Database) *ProxyServer
func (*ProxyServer) ChoiceSubLogin ¶
func (*ProxyServer) InitSubLogin ¶
func (s *ProxyServer) InitSubLogin()
func (*ProxyServer) ListenTCP ¶
func (s *ProxyServer) ListenTCP()
func (*ProxyServer) RedisMessage ¶
func (s *ProxyServer) RedisMessage(payload string)
func (*ProxyServer) ServeHTTP ¶
func (s *ProxyServer) ServeHTTP(w http.ResponseWriter, r *http.Request)
func (*ProxyServer) Start ¶
func (s *ProxyServer) Start()
func (*ProxyServer) WriteMapReportRate ¶
func (s *ProxyServer) WriteMapReportRate(login string, reported int64, ts int64)
WriteMapReportRate is Set a lock on the map
type ReportedRate ¶
type ReportedRate struct {
// contains filtered or unexported fields
}
type StratumReq ¶
type StratumReq struct { JSONRpcReq Worker string `json:"worker"` }
type SubmitReply ¶
type SubmitReply struct {
Status string `json:"status"`
}
Click to show internal directories.
Click to hide internal directories.