api

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2024 License: GPL-3.0 Imports: 15 Imported by: 18

README

Open ETC Pool Friends API Endpoints

Finders

Get Finders Information
  • Endpoint: /api/finders
  • Method: GET
  • Description: Retrieve information about finders.
  • Response Format: JSON

General Pool Statistics

Get General Pool Statistics
  • Endpoint: /api/stats
  • Method: GET
  • Description: Retrieve general pool statistics.
  • Response Format: JSON

Miners

Get Miners Information
  • Endpoint: /api/miners
  • Method: GET
  • Description: Retrieve information about miners.
  • Response Format: JSON
Get Miner Information
  • Endpoint: /api/accounts/{login}
  • Method: GET
  • Parameters:
    • {login}: Miner login address (e.g., /api/accounts/0x123...)
  • Description: Retrieve information about a specific miner.
  • Response Format: JSON

Blocks

Get Blocks Information
  • Endpoint: /api/blocks
  • Method: GET
  • Description: Retrieve information about blocks.
  • Response Format: JSON

Payments

Get Payments Information
  • Endpoint: /api/payments
  • Method: GET
  • Description: Retrieve information about payments.
  • Response Format: JSON

Settings

Subscribe to Updates
  • Endpoint: /api/settings
  • Method: POST
  • Parameters:
    • ip_address: IP address of the client.
    • login: Miner login address.
    • threshold (optional): Subscription threshold (default: 0.5).
  • Description: Subscribe to updates by providing client information.
  • Response Format: JSON

Examples

Get General Pool Statistics
curl http://localhost:8080/api/stats

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiConfig

type ApiConfig struct {
	Enabled              bool   `json:"enabled"`
	Listen               string `json:"listen"`
	StatsCollectInterval string `json:"statsCollectInterval"`
	HashrateWindow       string `json:"hashrateWindow"`
	HashrateLargeWindow  string `json:"hashrateLargeWindow"`
	LuckWindow           []int  `json:"luckWindow"`
	Payments             int64  `json:"payments"`
	Blocks               int64  `json:"blocks"`
	PurgeOnly            bool   `json:"purgeOnly"`
	PurgeInterval        string `json:"purgeInterval"`
	PoolCharts           string `json:"poolCharts"`
	PoolChartsNum        int64  `json:"poolChartsNum"`
	MinerChartsNum       int64  `json:"minerChartsNum"`
	NetCharts            string `json:"netCharts"`
	NetChartsNum         int64  `json:"netChartsNum"`
	MinerCharts          string `json:"minerCharts"`
	ShareCharts          string `json:"shareCharts"`
	ShareChartsNum       int64  `json:"shareChartsNum"`
}

type ApiServer

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

func NewApiServer

func NewApiServer(cfg *ApiConfig, backend *storage.RedisClient) *ApiServer

func (*ApiServer) AccountIndex

func (s *ApiServer) AccountIndex(w http.ResponseWriter, r *http.Request)

func (*ApiServer) BlocksIndex

func (s *ApiServer) BlocksIndex(w http.ResponseWriter, r *http.Request)

func (*ApiServer) FindersIndex

func (s *ApiServer) FindersIndex(w http.ResponseWriter, r *http.Request)

func (*ApiServer) MinersIndex

func (s *ApiServer) MinersIndex(w http.ResponseWriter, r *http.Request)

func (*ApiServer) MiningHandler added in v1.0.5

func (s *ApiServer) MiningHandler(w http.ResponseWriter, r *http.Request)

func (*ApiServer) PaymentsIndex

func (s *ApiServer) PaymentsIndex(w http.ResponseWriter, r *http.Request)

func (*ApiServer) Start

func (s *ApiServer) Start()

func (*ApiServer) StatsIndex

func (s *ApiServer) StatsIndex(w http.ResponseWriter, r *http.Request)

func (*ApiServer) SubscribeHandler

func (s *ApiServer) SubscribeHandler(w http.ResponseWriter, r *http.Request)

type Entry

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

Jump to

Keyboard shortcuts

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