proxy

package
v1.0.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 8, 2024 License: GPL-3.0 Imports: 26 Imported by: 9

Documentation

Index

Constants

View Source
const (
	EthProxy int = iota
	NiceHash
)
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 (b Block) Difficulty() *big.Int

func (Block) HashNoNonce

func (b Block) HashNoNonce() common.Hash

func (Block) MixDigest

func (b Block) MixDigest() common.Hash

func (Block) Nonce

func (b Block) Nonce() uint64

func (Block) NumberU64

func (b Block) NumberU64() uint64

type BlockTemplate

type BlockTemplate struct {
	sync.RWMutex
	Header               string
	Seed                 string
	Target               string
	Difficulty           *big.Int
	Height               uint64
	GetPendingBlockCache *rpc.GetBlockReplyPart
	// contains filtered or unexported fields
}

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"`
	CoinSolo string         `json:"coin-solo"`
	Pplns    int64          `json:"pplns"`
	CoinName string         `json:"coin-name"`
	Network  string         `json:"network"`
	Algo     string         `json:"algo"`
	Redis    storage.Config `json:"redis"`

	BlockUnlocker payouts.UnlockerConfig `json:"unlocker"`
	Payouts       payouts.PayoutsConfig  `json:"payouts"`

	Exchange exchange.ExchangeConfig `json:"exchange"`

	NewrelicName    string `json:"newrelicName"`
	NewrelicKey     string `json:"newrelicKey"`
	NewrelicVerbose bool   `json:"newrelicVerbose"`
	NewrelicEnabled bool   `json:"newrelicEnabled"`
}

type ErrorReply

type ErrorReply struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
}

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,omitempty"`
	Version string          `json:"jsonrpc,omitempty"`
	Result  interface{}     `json:"result"`
	Error   interface{}     `json:"error"`
}

type JSONStratumReq

type JSONStratumReq struct {
	Id     interface{} `json:"id"`
	Method string      `json:"method"`
	Params interface{} `json:"params"`
	Height string      `json:"height"`
	Algo   string      `json:"algo"`
}

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"`
	Debug       bool  `json:"debug"`

	Stratum Stratum `json:"stratum"`
}

type ProxyServer

type ProxyServer struct {

	// Extranonce
	Extranonces map[string]bool
	// contains filtered or unexported fields
}

func NewProxy

func NewProxy(cfg *Config, backend *storage.RedisClient) *ProxyServer

func (*ProxyServer) ListenTCP

func (s *ProxyServer) ListenTCP()

func (*ProxyServer) MiningNotify added in v1.0.5

func (s *ProxyServer) MiningNotify(w http.ResponseWriter, r *http.Request)

func (*ProxyServer) ServeHTTP

func (s *ProxyServer) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*ProxyServer) Start

func (s *ProxyServer) Start()

type Session

type Session struct {

	// Stratum
	sync.Mutex

	JobDeatils    jobDetails
	Extranonce    string
	ExtranonceSub bool
	JobDetails    jobDetails
	// contains filtered or unexported fields
}

type Stratum

type Stratum struct {
	Enabled  bool   `json:"enabled"`
	Listen   string `json:"listen"`
	Timeout  string `json:"timeout"`
	MaxConn  int    `json:"maxConn"`
	TLS      bool   `json:"tls"`
	CertFile string `json:"certFile"`
	KeyFile  string `json:"keyFile"`
}

type StratumReq

type StratumReq struct {
	JSONRpcReq
	Worker string `json:"worker"`
}

type SubmitReply

type SubmitReply struct {
	Status string `json:"status"`
}

type Upstream

type Upstream struct {
	Name    string `json:"name"`
	Url     string `json:"url"`
	Timeout string `json:"timeout"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL