minerrelayservice

package
v0.0.0-...-e287cc3 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2022 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const KeyAutoIdxUserMiningResult = "autoidx1"

Variables

This section is empty.

Functions

func CheckParamBool

func CheckParamBool(r *http.Request, key string, defValue bool) bool

func CheckParamHex

func CheckParamHex(r *http.Request, key string, defv []byte) []byte

func CheckParamHexMustLen

func CheckParamHexMustLen(r *http.Request, key string, mustLen int) []byte

func CheckParamString

func CheckParamString(r *http.Request, key string, defValue string) string

func CheckParamUint64

func CheckParamUint64(r *http.Request, key string, defValue uint64) uint64

func CheckParamUint64Must

func CheckParamUint64Must(r *http.Request, w http.ResponseWriter, key string) (uint64, bool)

func ResponseCreateData

func ResponseCreateData(key string, value interface{}) map[string]interface{}

func ResponseData

func ResponseData(w http.ResponseWriter, data map[string]interface{})

func ResponseError

func ResponseError(w http.ResponseWriter, err error)

func ResponseErrorString

func ResponseErrorString(w http.ResponseWriter, errstr string)

func ResponseErrorStringWithCode

func ResponseErrorStringWithCode(w http.ResponseWriter, errcode int, errstr string)

func ResponseJSON

func ResponseJSON(w http.ResponseWriter, resobj interface{}) error

func ResponseJSONbytes

func ResponseJSONbytes(w http.ResponseWriter, content []byte) error

func ResponseList

func ResponseList(w http.ResponseWriter, data interface{})

func ResponseLocation

func ResponseLocation(w http.ResponseWriter, url string)

Types

type ConnClient

type ConnClient struct {
	// contains filtered or unexported fields
}

func NewConnClient

func NewConnClient(server *RelayService, conn *net.TCPConn, rwdaddr fields.Address) *ConnClient

func (*ConnClient) Handle

func (m *ConnClient) Handle() error

Handle

type MinerRelayServiceConfig

type MinerRelayServiceConfig struct {
	ServerAddress    *net.TCPAddr
	IsReportHashrate bool // Whether to report calculation force statistics
	IsAcceptHashrate bool // Whether to accept calculation force statistics

	ServerTcpListenPort int // TCP server listening port
	MaxWorkerConnect    int // TCP Max connections

	HttpApiListenPort int // HTTP API data interface service

	// Data storage
	StoreEnable          bool   // Storage on
	DataDir              string // catalogue
	SaveMiningBlockStuff bool   // Save mining block information
	SaveMiningHash       bool   // Whether to save the submitted block hash value
	SaveMiningNonce      bool   // Save submitted nonce value

}

func NewEmptyMinerRelayServiceConfig

func NewEmptyMinerRelayServiceConfig() *MinerRelayServiceConfig

func NewMinerRelayServiceConfig

func NewMinerRelayServiceConfig(cnffile *sys.Inicnf) *MinerRelayServiceConfig

type RelayService

type RelayService struct {
	// contains filtered or unexported fields
}

func NewRelayService

func NewRelayService(cnf *MinerRelayServiceConfig) *RelayService

func (*RelayService) Start

func (r *RelayService) Start()

type StoreItemUserMiningResult

type StoreItemUserMiningResult struct {
	BodyVersion               uint8 // Version number
	IsMintSuccessed           uint8 // Mining success
	IsSaveMiningResultHash    uint8 // Save hash
	MiningResultHash          fields.Hash
	IsSaveMiningResultNonce   uint8 // Save nonce
	MiningResultHeadNonce     fields.Bytes4
	MiningResultCoinbaseNonce fields.Hash
	// contains filtered or unexported fields
}

func NewStoreItemUserMiningResultV0

func NewStoreItemUserMiningResultV0() *StoreItemUserMiningResult

func (*StoreItemUserMiningResult) Describe

func (s *StoreItemUserMiningResult) Describe() map[string]interface{}

json api

func (*StoreItemUserMiningResult) Parse

func (s *StoreItemUserMiningResult) Parse(buf []byte, seek uint32) (uint32, error)

func (*StoreItemUserMiningResult) Serialize

func (s *StoreItemUserMiningResult) Serialize() []byte

Jump to

Keyboard shortcuts

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