Documentation ¶
Overview ¶
Package api provides the HTTP interface.
Index ¶
- Constants
- Variables
- func CreateAndRegisterCache(f RefreshFunc, name string) *cache
- func GetPPYFromBuckets(b db.Buckets) float64
- func GetPoolAPRs(ctx context.Context, depthsNow timeseries.DepthMap, ...) (map[string]float64, error)
- func GetSinglePoolAPR(ctx context.Context, depths timeseries.PoolDepths, lpUnits int64, pool string, ...) (float64, error)
- func InitHandler(nodeURL string)
- func TimestampAndHeight(ctx context.Context, id int64) (height int64, timestamp db.Nano, err error)
- type DebugBlockResponse
- type EarningsInfo
- type Health
- type Node
- type RefreshFunc
- type SaverData
- type ThornameReverseLookupFunc
Constants ¶
View Source
const BackgroundCalculationTotalTimeout = time.Second * 60 * 5
BackgroundCalculationTotalTimeout is the time a Refresh operation of single http result may take.
View Source
const CacheRefreshSleepPerRound = time.Second * 30
CacheRefreshSleepPerRound is the delay between cache recalculations.
View Source
const CacheRefreshSleepPerRoundDurringCatchup = time.Second * 60 * 10
View Source
const CacheRefreshStartupSleep = time.Second * 2
CacheRefreshStartupSleep is the delay at startup before starting the first cache refresh.
Variables ¶
View Source
var CacheLogger = midlog.LoggerForModule("cache")
View Source
var GlobalCacheStore cacheStore
View Source
var Handler http.Handler
Handler serves the entire API.
View Source
var ShowBonds bool = false
TODO(huginn): remove when bonds are fixed
Functions ¶
func CreateAndRegisterCache ¶
func CreateAndRegisterCache(f RefreshFunc, name string) *cache
func GetPPYFromBuckets ¶
func GetPoolAPRs ¶
func GetSinglePoolAPR ¶
Types ¶
type DebugBlockResponse ¶
type EarningsInfo ¶
type Health ¶
type Health struct { CatchingUp bool `json:"catching_up"` Database bool `json:"database"` ScannerHeight int64 `json:"scannerHeight,string"` }
TODO(HooriRn): this struct is not needed since the graphql depracation, replace with the corresponding oapi version. (delete-graphql)
Click to show internal directories.
Click to hide internal directories.