routes

package
v0.0.0-...-1c9500d Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2021 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CachePoolData

func CachePoolData() error

func DefineRoutes

func DefineRoutes(r *mux.Router, passedDb *sql.DB)

func UpdateCoins

func UpdateCoins()

func UpdatePools

func UpdatePools()

Types

type AlgorithmResult

type AlgorithmResult struct {
	ID   int64  `json:"id"`
	Name string `json:"name"`
}

type CoinDetailAlgorithm

type CoinDetailAlgorithm struct {
	Name string `json:"name"`
	ID   int64  `json:"id"`
}

type CoinDetailResult

type CoinDetailResult struct {
	MinHeight  int64                 `json:"minHeight"`
	MaxHeight  int64                 `json:"maxHeight"`
	NumBlocks  int64                 `json:"numBlocks"`
	TipHash    string                `json:"tipHash"`
	Algorithms []CoinDetailAlgorithm `json:"algorithms"`
}

type CoinPoolDetailObserver

type CoinPoolDetailObserver struct {
	ID                int64     `json:"id"`
	Location          string    `json:"location"`
	PoolServer        string    `json:"poolServer"`
	LastJobReceived   time.Time `json:"lastJobReceived"`
	LastShareFound    time.Time `json:"lastShareFound"`
	CurrentDifficulty float64   `json:"currentDifficulty"`
}

type CoinPoolDetailResult

type CoinPoolDetailResult struct {
	Observers []CoinPoolDetailObserver `json:"observers"`
}

type CoinResult

type CoinResult struct {
	ID               int64     `json:"id"`
	Name             string    `json:"name"`
	Ticker           string    `json:"ticker"`
	BestHash         string    `json:"bestHash"`
	BestHashObserved time.Time `json:"bestHashObserved"`
}

type DoubleSpendTransaction

type DoubleSpendTransaction struct {
	BlockHash []byte                         `json:"-"`
	BlockID   string                         `json:"blockHash"`
	TxHash    []byte                         `json:"-"`
	TxID      string                         `json:"txHash"`
	TxIns     []DoubleSpendTransactionInput  `json:"in"`
	TxOuts    []DoubleSpendTransactionOutput `json:"out"`
}

type DoubleSpendTransactionInput

type DoubleSpendTransactionInput struct {
	Idx         int    `json:"idx"`
	DoubleSpent bool   `json:"doubleSpent"`
	PrevOutTxID string `json:"prevoutTxID"`
	PrevOutIdx  int    `json:"prevoutIdx"`
}

type DoubleSpendTransactionOutput

type DoubleSpendTransactionOutput struct {
	Idx     int    `json:"idx"`
	Value   int64  `json:"value"`
	Address string `json:"address"`
}

type EmptyBlockWorkResult

type EmptyBlockWorkResult struct {
	ObservedOn     time.Time `json:"observedOn"`
	PoolID         int       `json:"poolId"`
	CoinID         int       `json:"coinId"`
	CoinName       string    `json:"coinName"`
	ObserverID     int       `json:"poolObserverID"`
	StratumHost    string    `json:"stratumHost"`
	LocationID     int       `json:"locationID"`
	LocationName   string    `json:"location"`
	TotalJobs      int64     `json:"totalJobs"`
	EmptyBlockJobs int64     `json:"emptyBlockJobs"`
	TotalTime      int64     `json:"totalTimeMs"`
	EmptyBlockTime int64     `json:"emptyBlockTimeMs"`
}

type PoolObserverResult

type PoolObserverResult struct {
	ID                 int64     `json:"id"`
	StratumHost        string    `json:"stratumHost"`
	StratumPort        int64     `json:"stratumPort"`
	LocationID         int64     `json:"locationId"`
	LocationName       string    `json:"locationName"`
	LastJobReceived    time.Time `json:"lastJobReceived"`
	LastJobID          int64     `json:"lastJobID"`
	LastJobPrevHash    string    `json:"lastJobPrevHash"`
	LastJobMerkleProof string    `json:"lastJobMerkleProof"`
}

type PoolResult

type PoolResult struct {
	ID            int64                 `json:"id"`
	Name          string                `json:"name"`
	CoinID        int64                 `json:"coinId"`
	CoinName      string                `json:"coinName"`
	PoolObservers []*PoolObserverResult `json:"observers"`
}

type ReorgDetailResult

type ReorgDetailResult struct {
	ID            int                         `json:"id"`
	RemovedBlocks []string                    `json:"removedBlocks"`
	AddedBlocks   []string                    `json:"addedBlocks"`
	DoubleSpends  [][2]DoubleSpendTransaction `json:"doubleSpends"`
}

type ReorgResult

type ReorgResult struct {
	ID                 int64     `json:"id"`
	RemovedBlocks      int64     `json:"removedBlocks"`
	AddedBlocks        int64     `json:"addedBlocks"`
	ForkBlock          string    `json:"forkBlock"`
	DoubleSpentOutputs int       `json:"doubleSpentOutputs"`
	CoinName           string    `json:"coinName"`
	CoinID             int       `json:"coinID"`
	CoinTicker         string    `json:"coinTicker"`
	BudishCost         float64   `json:"budishCost"`
	NiceHashCost       float64   `json:"niceHashCost"`
	AddedWork          int64     `json:"addedWork"`
	RemovedWork        int64     `json:"removedWork"`
	CoinPrice          float64   `json:"coinPrice"`
	CoinsInAddedBlocks float64   `json:"coinsInAddedBlocks"`
	Occurred           time.Time `json:"occurred"`
	ForkBlockHeight    int       `json:"forkBlockHeight"`
}

type WebSocketConn

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

type WrongWorkResult

type WrongWorkResult struct {
	ObservedOn    time.Time `json:"observedOn"`
	PoolID        int       `json:"poolId"`
	CoinID        int       `json:"expectedCoinId"`
	CoinName      string    `json:"expectedCoinName"`
	ObserverID    int       `json:"poolObserverID"`
	StratumHost   string    `json:"stratumHost"`
	LocationID    int       `json:"locationID"`
	LocationName  string    `json:"location"`
	WrongCoinID   int       `json:"wrongCoinId"`
	WrongCoinName string    `json:"wrongCoinName"`
	TotalJobs     int64     `json:"totalJobs"`
	WrongJobs     int64     `json:"wrongJobs"`
	TotalTime     int64     `json:"totalTimeMs"`
	WrongTime     int64     `json:"wrongTimeMs"`
}

Jump to

Keyboard shortcuts

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