gui

package
v0.0.0-...-31a5603 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2021 License: ISC Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ZeroInt is the default value for a big.Int.
	ZeroInt = new(big.Int).SetInt64(0)

	// ZeroRat is the default value for a big.Rat.
	ZeroRat = new(big.Rat).SetInt64(0)

	// KiloHash is 1 KH represented as a big.Rat.
	KiloHash = new(big.Rat).SetInt64(1000)

	// MegaHash is 1MH represented as a big.Rat.
	MegaHash = new(big.Rat).SetInt64(1000000)

	// GigaHash is 1GH represented as a big.Rat.
	GigaHash = new(big.Rat).SetInt64(1000000000)

	// TeraHash is 1TH represented as a big.Rat.
	TeraHash = new(big.Rat).SetInt64(1000000000000)

	// PetaHash is 1PH represented as a big.Rat
	PetaHash = new(big.Rat).SetInt64(1000000000000000)
)

Functions

func DisableLog

func DisableLog()

DisableLog disables all library log output. Logging output is disabled by default until UseLogger is called.

func UseLogger

func UseLogger(logger slog.Logger)

UseLogger uses a specified Logger to output package logging info.

Types

type AccountStats

type AccountStats struct {
	MinedWork []*pool.AcceptedWork
	Payments  []*pool.Payment
	Clients   []*pool.ClientInfo
	AccountID string
}

AccountStats is a snapshot of an accounts contribution to the pool. This comprises of blocks mined by the pool and payments made to the account.

type Config

type Config struct {
	Ctx              context.Context
	SoloPool         bool
	PaymentMethod    string
	GUIDir           string
	CSRFSecret       []byte
	BackupPass       string
	GUIPort          uint32
	TLSCertFile      string
	TLSKeyFile       string
	UseLEHTTPS       bool
	Domain           string
	ActiveNet        *chaincfg.Params
	BlockExplorerURL string
	Designation      string
	PoolFee          float64
	MinerPorts       map[string]uint32
}

Config represents configuration details for the pool user interface.

type GUI

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

GUI represents the the mining pool user interface.

func NewGUI

func NewGUI(cfg *Config, hub *pool.Hub, limiter *pool.RateLimiter) (*GUI, error)

NewGUI creates an instance of the user interface.

func (*GUI) GetAdmin

func (ui *GUI) GetAdmin(w http.ResponseWriter, r *http.Request)

func (*GUI) GetIndex

func (ui *GUI) GetIndex(w http.ResponseWriter, r *http.Request)

func (*GUI) PostAdmin

func (ui *GUI) PostAdmin(w http.ResponseWriter, r *http.Request)

func (*GUI) PostBackup

func (ui *GUI) PostBackup(w http.ResponseWriter, r *http.Request)

func (*GUI) PostLogout

func (ui *GUI) PostLogout(w http.ResponseWriter, r *http.Request)

func (*GUI) RegisterWebSocket

func (ui *GUI) RegisterWebSocket(w http.ResponseWriter, r *http.Request)

func (*GUI) Run

func (ui *GUI) Run(ctx context.Context)

Run starts the user interface.

Jump to

Keyboard shortcuts

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