Documentation ¶
Index ¶
- func NewServer(name string, hostKey types.PublicKey, opts ...ServerOption) http.Handler
- type AccountManager
- type AddVolumeRequest
- type AlertResp
- type Alerts
- type BuildState
- type ChainManager
- type Client
- func (c *Client) AddVolume(localPath string, sectors uint64) (vol storage.Volume, err error)
- func (c *Client) Announce() error
- func (c *Client) Consensus() (resp ConsensusState, err error)
- func (c *Client) Contract(id types.FileContractID) (contract contracts.Contract, err error)
- func (c *Client) Contracts(filter contracts.ContractFilter) ([]contracts.Contract, int, error)
- func (c *Client) DeleteIntegrityCheck(id types.FileContractID) error
- func (c *Client) DeleteSector(root types.Hash256) error
- func (c *Client) DeleteVolume(id int) error
- func (c *Client) DeleteWebHook(id int64) error
- func (c *Client) Host() (resp HostState, err error)
- func (c *Client) IntegrityCheckProgress(id types.FileContractID) (IntegrityCheckResult, error)
- func (c *Client) LocalDir(path string) (resp SystemDirResponse, err error)
- func (c *Client) Metrics(at time.Time) (metrics metrics.Metrics, err error)
- func (c *Client) MkDir(path string) error
- func (c *Client) PendingTransactions() (transactions []wallet.Transaction, err error)
- func (c *Client) PeriodMetrics(start time.Time, n int, interval metrics.Interval) (periods []metrics.Metrics, err error)
- func (c *Client) RegisterWebHook(callbackURL string, scopes []string) (hook webhooks.WebHook, err error)
- func (c *Client) ResizeVolume(id int, sectors uint64) error
- func (c *Client) SendSiacoins(address types.Address, amount types.Currency, subtractFee bool) (id types.TransactionID, err error)
- func (c *Client) Settings() (settings settings.Settings, err error)
- func (c *Client) StartIntegrityCheck(id types.FileContractID) error
- func (c *Client) SyncerAddress() (addr string, err error)
- func (c *Client) SyncerConnect(address string) error
- func (c *Client) SyncerDisconnect(address string) error
- func (c *Client) SyncerPeers() (peers []Peer, err error)
- func (c *Client) TestDDNS() error
- func (c *Client) Transactions(limit, offset int) (transactions []wallet.Transaction, err error)
- func (c *Client) UpdateSettings(updated ...Setting) (settings settings.Settings, err error)
- func (c *Client) UpdateVolume(id int, req UpdateVolumeRequest) error
- func (c *Client) UpdateWebHook(id int64, callbackURL string, scopes []string) (hook webhooks.WebHook, err error)
- func (c *Client) Volume(id int) (volume VolumeMeta, err error)
- func (c *Client) Volumes() (volumes []VolumeMeta, err error)
- func (c *Client) Wallet() (resp WalletResponse, err error)
- func (c *Client) WebHooks() (hooks []webhooks.WebHook, err error)
- type ConsensusState
- type ContractIntegrityResponse
- type ContractManager
- type ContractsResponse
- type CreateDirRequest
- type ExplorerState
- type HostSettings
- type HostState
- type IntegrityCheckResult
- type JSONErrors
- type MetricManager
- type Metrics
- type Peer
- type PeerResp
- type PinnedSettings
- type RHPSessionReporter
- type RegisterWebHookRequest
- type ResizeVolumeRequest
- type ServerOption
- func ServerWithAccountManager(am AccountManager) ServerOption
- func ServerWithAlerts(al Alerts) ServerOption
- func ServerWithChainManager(chain ChainManager) ServerOption
- func ServerWithContractManager(cm ContractManager) ServerOption
- func ServerWithExplorer(explorer *explorer.Explorer) ServerOption
- func ServerWithLogger(log *zap.Logger) ServerOption
- func ServerWithMetricManager(m MetricManager) ServerOption
- func ServerWithPinnedSettings(p PinnedSettings) ServerOption
- func ServerWithRHPSessionReporter(rsr RHPSessionReporter) ServerOption
- func ServerWithSettings(s Settings) ServerOption
- func ServerWithSyncer(g Syncer) ServerOption
- func ServerWithTransactionPool(tp TPool) ServerOption
- func ServerWithVolumeManager(vm VolumeManager) ServerOption
- func ServerWithWallet(w Wallet) ServerOption
- func ServerWithWebHooks(w WebHooks) ServerOption
- type SessionResp
- type Setting
- func SetAcceptingContracts(value bool) Setting
- func SetAccountExpiry(value time.Duration) Setting
- func SetBaseRPCPrice(price types.Currency) Setting
- func SetCollateral(collateral types.Currency) Setting
- func SetContractPrice(price types.Currency) Setting
- func SetEgressLimit(limit uint64) Setting
- func SetIngressLimit(limit uint64) Setting
- func SetMaxAccountBalance(value types.Currency) Setting
- func SetMaxCollateral(collateral types.Currency) Setting
- func SetMaxContractDuration(duration uint64) Setting
- func SetMaxRegistryEntries(value uint64) Setting
- func SetMinEgressPrice(price types.Currency) Setting
- func SetMinIngressPrice(price types.Currency) Setting
- func SetMinStoragePrice(price types.Currency) Setting
- func SetNetAddress(addr string) Setting
- func SetPriceTableValidity(value time.Duration) Setting
- func SetSectorAccessPrice(price types.Currency) Setting
- type Settings
- type Syncer
- type SyncerAddrResp
- type SyncerConnectRequest
- type SystemDirResponse
- type TPool
- type TPoolResp
- type UpdateVolumeRequest
- type VerifySectorResponse
- type VolumeManager
- type VolumeMeta
- type VolumeResp
- type Wallet
- type WalletPendingResp
- type WalletResponse
- type WalletSendSiacoinsRequest
- type WalletTransactionsResp
- type WebHooks
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AccountManager ¶ added in v0.2.0
type AccountManager interface { Accounts(limit, offset int) ([]accounts.Account, error) AccountFunding(accountID rhp3.Account) ([]accounts.FundingSource, error) }
An AccountManager manages ephemeral accounts
type AddVolumeRequest ¶
type AddVolumeRequest struct { LocalPath string `json:"localPath"` MaxSectors uint64 `json:"maxSectors"` }
AddVolumeRequest is the request body for the [POST] /volume endpoint.
type AlertResp ¶ added in v1.0.2
AlertResp is the response body for the [GET] /alerts endpoint
func (AlertResp) PrometheusMetric ¶ added in v1.0.2
func (a AlertResp) PrometheusMetric() (metrics []prometheus.Metric)
PrometheusMetric returns Prometheus samples for the hosts alerts.
type BuildState ¶
type BuildState struct { Network string `json:"network"` Version string `json:"version"` Commit string `json:"commit"` OS string `json:"os"` BuildTime time.Time `json:"buildTime"` }
BuildState contains static information about the build.
type ChainManager ¶
A ChainManager retrieves the current blockchain state
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
A Client is a client for the hostd API.
func (*Client) Announce ¶
Announce announces the host to the network. The announced address is determined by the host's current settings.
func (*Client) Consensus ¶
func (c *Client) Consensus() (resp ConsensusState, err error)
Consensus returns the current consensus state.
func (*Client) DeleteIntegrityCheck ¶
func (c *Client) DeleteIntegrityCheck(id types.FileContractID) error
DeleteIntegrityCheck deletes the integrity check for the specified contract.
func (*Client) DeleteSector ¶
DeleteSector deletes the sector with the specified root. This can cause contract failures if the sector is still in use.
func (*Client) DeleteVolume ¶
DeleteVolume deletes the volume with the specified ID.
func (*Client) DeleteWebHook ¶ added in v1.0.0
DeleteWebHook deletes the WebHook with the specified ID.
func (*Client) IntegrityCheckProgress ¶
func (c *Client) IntegrityCheckProgress(id types.FileContractID) (IntegrityCheckResult, error)
IntegrityCheckProgress returns the progress of the integrity check for the specified contract.
func (*Client) LocalDir ¶
func (c *Client) LocalDir(path string) (resp SystemDirResponse, err error)
LocalDir returns the contents of the specified directory on the host.
func (*Client) PendingTransactions ¶
func (c *Client) PendingTransactions() (transactions []wallet.Transaction, err error)
PendingTransactions returns transactions that are not yet confirmed.
func (*Client) PeriodMetrics ¶
func (c *Client) PeriodMetrics(start time.Time, n int, interval metrics.Interval) (periods []metrics.Metrics, err error)
PeriodMetrics returns the metrics of the host for n periods starting at start.
func (*Client) RegisterWebHook ¶ added in v1.0.0
func (c *Client) RegisterWebHook(callbackURL string, scopes []string) (hook webhooks.WebHook, err error)
RegisterWebHook registers a new WebHook.
func (*Client) ResizeVolume ¶
ResizeVolume resizes the volume with the specified ID to a new size.
func (*Client) SendSiacoins ¶
func (c *Client) SendSiacoins(address types.Address, amount types.Currency, subtractFee bool) (id types.TransactionID, err error)
SendSiacoins sends siacoins to the specified address. If subtractFee is true, the miner fee is subtracted from the amount.
func (*Client) StartIntegrityCheck ¶
func (c *Client) StartIntegrityCheck(id types.FileContractID) error
StartIntegrityCheck scans the volume with the specified ID for consistency errors.
func (*Client) SyncerAddress ¶
SyncerAddress returns the address of the syncer.
func (*Client) SyncerConnect ¶
SyncerConnect connects to a peer.
func (*Client) SyncerDisconnect ¶
SyncerDisconnect disconnects from a peer.
func (*Client) SyncerPeers ¶
SyncerPeers returns the currently connected peers of the syncer.
func (*Client) Transactions ¶
func (c *Client) Transactions(limit, offset int) (transactions []wallet.Transaction, err error)
Transactions returns the transactions of the host's wallet.
func (*Client) UpdateSettings ¶
UpdateSettings updates the host's settings.
func (*Client) UpdateVolume ¶
func (c *Client) UpdateVolume(id int, req UpdateVolumeRequest) error
UpdateVolume updates the volume with the specified ID.
func (*Client) UpdateWebHook ¶ added in v1.0.0
func (c *Client) UpdateWebHook(id int64, callbackURL string, scopes []string) (hook webhooks.WebHook, err error)
UpdateWebHook updates the WebHook with the specified ID.
func (*Client) Volume ¶
func (c *Client) Volume(id int) (volume VolumeMeta, err error)
Volume returns the volume with the specified ID.
func (*Client) Volumes ¶
func (c *Client) Volumes() (volumes []VolumeMeta, err error)
Volumes returns the volumes of the host.
func (*Client) Wallet ¶
func (c *Client) Wallet() (resp WalletResponse, err error)
Wallet returns the state of the host's wallet.
type ConsensusState ¶
type ConsensusState struct { Synced bool `json:"synced"` ChainIndex types.ChainIndex `json:"chainIndex"` }
ConsensusState is the response body for the [GET] /consensus endpoint.
func (ConsensusState) PrometheusMetric ¶ added in v1.0.2
func (cs ConsensusState) PrometheusMetric() []prometheus.Metric
PrometheusMetric returns a Prometheus metric for the consensus state.
type ContractIntegrityResponse ¶
type ContractIntegrityResponse struct { BadSectors []types.Hash256 `json:"badSectors"` TotalSectors uint64 `json:"totalSectors"` }
ContractIntegrityResponse is the response body for the [POST] /contracts/:id/check endpoint.
type ContractManager ¶
type ContractManager interface { Contracts(filter contracts.ContractFilter) ([]contracts.Contract, int, error) Contract(id types.FileContractID) (contracts.Contract, error) // CheckIntegrity checks the integrity of a contract's sector roots on // disk. The result of each sector checked is sent on the returned // channel. Read errors are logged. CheckIntegrity(ctx context.Context, contractID types.FileContractID) (<-chan contracts.IntegrityResult, uint64, error) }
A ContractManager manages the host's contracts
type ContractsResponse ¶
type ContractsResponse struct { Count int `json:"count"` Contracts []contracts.Contract `json:"contracts"` }
ContractsResponse is the response body for the [POST] /contracts endpoint.
type CreateDirRequest ¶
type CreateDirRequest struct {
Path string `json:"path"`
}
A CreateDirRequest is the request body for the [POST] /system/dir endpoint.
type ExplorerState ¶ added in v1.1.0
ExplorerState contains static information about explorer data sources.
type HostSettings ¶ added in v1.0.2
HostSettings is the response body for the [GET] /settings endpoint.
func (HostSettings) PrometheusMetric ¶ added in v1.0.2
func (hs HostSettings) PrometheusMetric() []prometheus.Metric
PrometheusMetric returns Prometheus samples for the host settings.
type HostState ¶
type HostState struct { Name string `json:"name,omitempty"` PublicKey types.PublicKey `json:"publicKey"` LastAnnouncement settings.Announcement `json:"lastAnnouncement"` WalletAddress types.Address `json:"walletAddress"` StartTime time.Time `json:"startTime"` Explorer ExplorerState `json:"explorer"` BuildState }
HostState is the response body for the [GET] /state/host endpoint.
func (HostState) PrometheusMetric ¶ added in v1.0.2
func (hs HostState) PrometheusMetric() []prometheus.Metric
PrometheusMetric returns a Prometheus metric for the host state.
type IntegrityCheckResult ¶
type IntegrityCheckResult struct { Start time.Time `json:"start"` End time.Time `json:"end"` CheckedSectors uint64 `json:"checkedSectors"` TotalSectors uint64 `json:"totalSectors"` BadSectors []contracts.IntegrityResult `json:"badSectors"` }
IntegrityCheckResult tracks the result of an integrity check.
type JSONErrors ¶
type JSONErrors []error
JSONErrors is a slice of errors that can be marshaled to and unmarshaled from JSON.
func (JSONErrors) MarshalJSON ¶
func (je JSONErrors) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler
func (*JSONErrors) UnmarshalJSON ¶
func (je *JSONErrors) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler
type MetricManager ¶ added in v1.0.2
type MetricManager interface { // PeriodMetrics returns metrics for n periods starting at start. PeriodMetrics(start time.Time, periods int, interval metrics.Interval) (period []metrics.Metrics, err error) // Metrics returns aggregated metrics for the host as of the timestamp. Metrics(time.Time) (m metrics.Metrics, err error) }
A MetricManager retrieves metrics related to the host
type Metrics ¶
Metrics is the response body for the [GET] /metrics endpoint.
func (Metrics) PrometheusMetric ¶ added in v1.0.2
func (m Metrics) PrometheusMetric() []prometheus.Metric
PrometheusMetric returns Prometheus samples for the host metrics.
type PeerResp ¶ added in v1.0.2
type PeerResp []Peer
PeerResp is the response body for the [GET] /syncer/address endpoint
func (PeerResp) PrometheusMetric ¶ added in v1.0.2
func (p PeerResp) PrometheusMetric() (metrics []prometheus.Metric)
PrometheusMetric returns Prometheus samples for the hosts syncer peers.
type PinnedSettings ¶ added in v1.0.4
type PinnedSettings interface { Update(context.Context, pin.PinnedSettings) error Pinned(context.Context) pin.PinnedSettings }
PinnedSettings updates and retrieves the host's pinned settings
type RHPSessionReporter ¶ added in v0.2.0
type RHPSessionReporter interface { Subscribe(rhp.SessionSubscriber) Unsubscribe(rhp.SessionSubscriber) Active() []rhp.Session }
A RHPSessionReporter reports on RHP session lifecycle events
type RegisterWebHookRequest ¶ added in v1.0.0
type RegisterWebHookRequest struct { CallbackURL string `json:"callbackURL"` Scopes []string `json:"scopes"` }
RegisterWebHookRequest is the request body for the [POST] /webhooks endpoint.
type ResizeVolumeRequest ¶
type ResizeVolumeRequest struct {
MaxSectors uint64 `json:"maxSectors"`
}
ResizeVolumeRequest is the request body for the [PUT] /volume/:id/resize endpoint.
type ServerOption ¶ added in v1.0.4
type ServerOption func(*api)
ServerOption is a functional option to configure an API server.
func ServerWithAccountManager ¶ added in v1.0.4
func ServerWithAccountManager(am AccountManager) ServerOption
ServerWithAccountManager sets the account manager for the API server.
func ServerWithAlerts ¶ added in v1.0.4
func ServerWithAlerts(al Alerts) ServerOption
ServerWithAlerts sets the alerts manager for the API server.
func ServerWithChainManager ¶ added in v1.0.4
func ServerWithChainManager(chain ChainManager) ServerOption
ServerWithChainManager sets the chain manager for the API server.
func ServerWithContractManager ¶ added in v1.0.4
func ServerWithContractManager(cm ContractManager) ServerOption
ServerWithContractManager sets the contract manager for the API server.
func ServerWithExplorer ¶ added in v1.1.0
func ServerWithExplorer(explorer *explorer.Explorer) ServerOption
ServerWithExplorer sets the explorer for the API server.
func ServerWithLogger ¶ added in v1.0.4
func ServerWithLogger(log *zap.Logger) ServerOption
ServerWithLogger sets the logger for the API server.
func ServerWithMetricManager ¶ added in v1.0.4
func ServerWithMetricManager(m MetricManager) ServerOption
ServerWithMetricManager sets the metric manager for the API server.
func ServerWithPinnedSettings ¶ added in v1.0.4
func ServerWithPinnedSettings(p PinnedSettings) ServerOption
ServerWithPinnedSettings sets the pinned settings for the API server.
func ServerWithRHPSessionReporter ¶ added in v1.0.4
func ServerWithRHPSessionReporter(rsr RHPSessionReporter) ServerOption
ServerWithRHPSessionReporter sets the RHP session reporter for the API server.
func ServerWithSettings ¶ added in v1.0.4
func ServerWithSettings(s Settings) ServerOption
ServerWithSettings sets the settings manager for the API server.
func ServerWithSyncer ¶ added in v1.0.4
func ServerWithSyncer(g Syncer) ServerOption
ServerWithSyncer sets the syncer for the API server.
func ServerWithTransactionPool ¶ added in v1.0.4
func ServerWithTransactionPool(tp TPool) ServerOption
ServerWithTransactionPool sets the transaction pool for the API server.
func ServerWithVolumeManager ¶ added in v1.0.4
func ServerWithVolumeManager(vm VolumeManager) ServerOption
ServerWithVolumeManager sets the volume manager for the API server.
func ServerWithWallet ¶ added in v1.0.4
func ServerWithWallet(w Wallet) ServerOption
ServerWithWallet sets the wallet for the API server.
func ServerWithWebHooks ¶ added in v1.0.4
func ServerWithWebHooks(w WebHooks) ServerOption
ServerWithWebHooks sets the webhooks manager for the API server.
type SessionResp ¶ added in v1.0.2
SessionResp is the response body for the [GET] /sessions endpoint
func (SessionResp) PrometheusMetric ¶ added in v1.0.2
func (s SessionResp) PrometheusMetric() (metrics []prometheus.Metric)
PrometheusMetric returns Prometheus samples for the hosts sessions
type Setting ¶
A Setting updates a single setting on the host. It can be combined with other settings to update multiple settings at once.
func SetAcceptingContracts ¶
SetAcceptingContracts sets the AcceptingContracts field of the request
func SetAccountExpiry ¶
SetAccountExpiry sets the AccountExpiry field of the request
func SetBaseRPCPrice ¶
SetBaseRPCPrice sets the BaseRPCPrice field of the request
func SetCollateral ¶
SetCollateral sets the Collateral field of the request
func SetContractPrice ¶
SetContractPrice sets the ContractPrice field of the request
func SetEgressLimit ¶
SetEgressLimit sets the EgressLimit in bytes per second
func SetIngressLimit ¶
SetIngressLimit sets the IngressLimit in bytes per second
func SetMaxAccountBalance ¶
SetMaxAccountBalance sets the MaxAccountBalance
func SetMaxCollateral ¶
SetMaxCollateral sets the MaxCollateral
func SetMaxContractDuration ¶
SetMaxContractDuration sets the MaxContractDuration field of the request
func SetMaxRegistryEntries ¶
SetMaxRegistryEntries sets the MaxRegistryEntries field of the request
func SetMinEgressPrice ¶
SetMinEgressPrice sets the MinEgressPrice in bytes
func SetMinIngressPrice ¶
SetMinIngressPrice sets the MinIngressPrice in bytes
func SetMinStoragePrice ¶
SetMinStoragePrice sets the MinStoragePrice in bytes/block
func SetNetAddress ¶
SetNetAddress sets the NetAddress field of the request
func SetPriceTableValidity ¶
SetPriceTableValidity sets the PriceTableValidity field of the request
func SetSectorAccessPrice ¶
SetSectorAccessPrice sets the SectorAccessPrice field of the request
type Settings ¶
type Settings interface { Announce() error UpdateSettings(s settings.Settings) error Settings() settings.Settings LastAnnouncement() (settings.Announcement, error) UpdateDDNS(force bool) error }
Settings updates and retrieves the host's settings
type Syncer ¶
type Syncer interface { Address() modules.NetAddress Peers() []modules.Peer Connect(addr modules.NetAddress) error Disconnect(addr modules.NetAddress) error }
A Syncer can connect to other peers and synchronize the blockchain.
type SyncerAddrResp ¶ added in v1.0.2
type SyncerAddrResp string
SyncerAddrResp is the response body for the [GET] /syncer/peers endpoint
func (SyncerAddrResp) PrometheusMetric ¶ added in v1.0.2
func (s SyncerAddrResp) PrometheusMetric() (metrics []prometheus.Metric)
PrometheusMetric returns Prometheus samples for the hosts syncer address.
type SyncerConnectRequest ¶
type SyncerConnectRequest struct {
Address string `json:"address"`
}
SyncerConnectRequest is the request body for the [PUT] /syncer/peers endpoint.
type SystemDirResponse ¶
type SystemDirResponse struct { Path string `json:"path"` TotalBytes uint64 `json:"totalBytes"` FreeBytes uint64 `json:"freeBytes"` Directories []string `json:"directories"` }
SystemDirResponse is the response body for the [GET] /system/dir endpoint.
type TPool ¶
type TPool interface { RecommendedFee() (fee types.Currency) AcceptTransactionSet(txns []types.Transaction) error }
A TPool manages the transaction pool
type TPoolResp ¶ added in v1.0.2
TPoolResp is the response body for the [GET] /tpool/fee endpoint
func (TPoolResp) PrometheusMetric ¶ added in v1.0.2
func (t TPoolResp) PrometheusMetric() (metrics []prometheus.Metric)
PrometheusMetric returns Prometheus samples for the hosts tpool fee.
type UpdateVolumeRequest ¶
type UpdateVolumeRequest struct {
ReadOnly bool `json:"readOnly"`
}
UpdateVolumeRequest is the request body for the [PUT] /volume/:id endpoint.
type VerifySectorResponse ¶ added in v1.0.0
type VerifySectorResponse struct { storage.SectorReference Error string `json:"error,omitempty"` }
VerifySectorResponse is the response body for the [GET] /sectors/:root/verify endpoint.
type VolumeManager ¶
type VolumeManager interface { Usage() (usedSectors uint64, totalSectors uint64, err error) Volumes() ([]storage.VolumeMeta, error) Volume(id int64) (storage.VolumeMeta, error) AddVolume(ctx context.Context, localPath string, maxSectors uint64, result chan<- error) (storage.Volume, error) RemoveVolume(ctx context.Context, id int64, force bool, result chan<- error) error ResizeVolume(ctx context.Context, id int64, maxSectors uint64, result chan<- error) error SetReadOnly(id int64, readOnly bool) error RemoveSector(root types.Hash256) error ResizeCache(size uint32) Read(types.Hash256) (*[rhp2.SectorSize]byte, error) // SectorReferences returns the references to a sector SectorReferences(root types.Hash256) (storage.SectorReference, error) }
A VolumeManager manages the host's storage volumes
type VolumeMeta ¶
type VolumeMeta struct { storage.VolumeMeta Errors JSONErrors `json:"errors"` }
VolumeMeta is a volume with its metadata. It overrides the marshalling of the storage.VolumeMeta type to handle error messages.
type VolumeResp ¶ added in v1.0.2
type VolumeResp []VolumeMeta
VolumeResp is the response body for the [GET] /volumes endpoint
func (VolumeResp) PrometheusMetric ¶ added in v1.0.2
func (v VolumeResp) PrometheusMetric() (metrics []prometheus.Metric)
PrometheusMetric returns Prometheus samples for the hosts volumes.
type Wallet ¶
type Wallet interface { Address() types.Address ScanHeight() uint64 Balance() (spendable, confirmed, unconfirmed types.Currency, err error) UnconfirmedTransactions() ([]wallet.Transaction, error) FundTransaction(txn *types.Transaction, amount types.Currency) (toSign []types.Hash256, release func(), err error) SignTransaction(cs consensus.State, txn *types.Transaction, toSign []types.Hash256, cf types.CoveredFields) error Transactions(limit, offset int) ([]wallet.Transaction, error) }
A Wallet manages Siacoins and funds transactions
type WalletPendingResp ¶ added in v1.0.2
type WalletPendingResp []wallet.Transaction
WalletPendingResp is the response body for the [GET] /wallet/pending endpoint
func (WalletPendingResp) PrometheusMetric ¶ added in v1.0.2
func (w WalletPendingResp) PrometheusMetric() (metrics []prometheus.Metric)
PrometheusMetric returns Prometheus samples for the host pending transactions.
type WalletResponse ¶
type WalletResponse struct { ScanHeight uint64 `json:"scanHeight"` Address types.Address `json:"address"` Spendable types.Currency `json:"spendable"` Confirmed types.Currency `json:"confirmed"` Unconfirmed types.Currency `json:"unconfirmed"` }
WalletResponse is the response body for the [GET] /wallet endpoint.
func (WalletResponse) PrometheusMetric ¶ added in v1.0.2
func (wr WalletResponse) PrometheusMetric() []prometheus.Metric
PrometheusMetric returns Prometheus samples for the host wallet.
type WalletSendSiacoinsRequest ¶
type WalletSendSiacoinsRequest struct { Address types.Address `json:"address"` Amount types.Currency `json:"amount"` SubtractMinerFee bool `json:"subtractMinerFee"` }
WalletSendSiacoinsRequest is the request body for the [POST] /wallet/send endpoint.
type WalletTransactionsResp ¶ added in v1.0.2
type WalletTransactionsResp []wallet.Transaction
WalletTransactionsResp is the response body for the [GET] /wallet/transactions endpoint
func (WalletTransactionsResp) PrometheusMetric ¶ added in v1.0.2
func (w WalletTransactionsResp) PrometheusMetric() (metrics []prometheus.Metric)
PrometheusMetric returns Prometheus samples for the hosts transactions.
type WebHooks ¶ added in v1.0.0
type WebHooks interface { WebHooks() ([]webhooks.WebHook, error) RegisterWebHook(callbackURL string, scopes []string) (webhooks.WebHook, error) UpdateWebHook(id int64, callbackURL string, scopes []string) (webhooks.WebHook, error) RemoveWebHook(id int64) error BroadcastToWebhook(id int64, event, scope string, data interface{}) error }
WebHooks manages webhooks