Skip to content
Snippets Groups Projects
Select Git revision
  • chris/data-recovery
  • master default protected
  • chris/upgrade-mongo-deps
  • pj/account-refunds
  • chris/optimise-rscode
  • chris/hs-job-test
  • chris/fix-subscription-cooldown
  • chris/contract-deletion
  • chris/endheight
  • pj/accounting-debug
  • pj/parallell-job-cooldown
  • chris/recoverto
  • chris/optimise-downloadeddata-recover
  • pj/maintenance-fu
  • pj/forced-sync
  • chris/sync-only-valid-pt
  • pj/hostdb-blocked-host
  • pj/remove-snapshots
  • pj/hostdb-unsorted-scan-history
  • pj/force-ea-resync
  • v1.6.9
  • v1.6.8
  • v1.6.7
  • v1.6.6
  • v1.6.5
  • v1.6.4
  • v1.6.3
  • v1.6.2
  • v1.6.1
  • v1.6.0
  • deploy-2022-06-27
  • deploy-2022-06-22
  • deploy-2022-06-20
  • deploy-2022-06-09
  • deploy-2022-06-02
  • deploy-2022-05-17
  • deploy-2022-04-27
  • deploy-2022-04-21
  • deploy-2022-04-13
  • deploy-2022-04-11
40 results

hostdb.go

hostdb.go 861 B
package client

import (
	"gitlab.com/NebulousLabs/Sia/node/api"
	"gitlab.com/NebulousLabs/Sia/types"
)

// HostDbGet requests the /hostdb endpoint's resources.
func (c *Client) HostDbGet() (hdg api.HostdbGet, err error) {
	err = c.get("/hostdb", &hdg)
	return
}

// HostDbActiveGet requests the /hostdb/active endpoint's resources.
func (c *Client) HostDbActiveGet() (hdag api.HostdbActiveGET, err error) {
	err = c.get("/hostdb/active", &hdag)
	return
}

// HostDbAllGet requests the /hostdb/all endpoint's resources.
func (c *Client) HostDbAllGet() (hdag api.HostdbAllGET, err error) {
	err = c.get("/hostdb/all", &hdag)
	return
}

// HostDbHostsGet request the /hostdb/hosts/:pubkey endpoint's resources.
func (c *Client) HostDbHostsGet(pk types.SiaPublicKey) (hhg api.HostdbHostsGET, err error) {
	err = c.get("/hostdb/hosts/"+pk.String(), &hhg)
	return
}