Documentation ¶
Index ¶
- Constants
- Variables
- type Client
- func (c *Client) ConsensusBlocksHeightGet(height types.BlockHeight) (cbg api.ConsensusBlocksGet, err error)
- func (c *Client) ConsensusBlocksIDGet(id types.BlockID) (cbg api.ConsensusBlocksGet, err error)
- func (c *Client) ConsensusGet() (cg api.ConsensusGET, err error)
- func (c *Client) DaemonStopGet() (err error)
- func (c *Client) DaemonUpdateGet() (dig api.DaemonUpdateGet, err error)
- func (c *Client) DaemonUpdatePost() (err error)
- func (c *Client) DaemonVersionGet() (dvg api.DaemonVersionGet, err error)
- func (c *Client) GatewayConnectPost(address modules.NetAddress) (err error)
- func (c *Client) GatewayDisconnectPost(address modules.NetAddress) (err error)
- func (c *Client) GatewayGet() (gwg api.GatewayGET, err error)
- func (c *Client) HostAnnounceAddrPost(address modules.NetAddress) (err error)
- func (c *Client) HostAnnouncePost() (err error)
- func (c *Client) HostContractInfoGet() (cg api.ContractInfoGET, err error)
- func (c *Client) HostDbActiveGet() (hdag api.HostdbActiveGET, err error)
- func (c *Client) HostDbAllGet() (hdag api.HostdbAllGET, err error)
- func (c *Client) HostDbGet() (hdg api.HostdbGet, err error)
- func (c *Client) HostDbHostsGet(pk types.SiaPublicKey) (hhg api.HostdbHostsGET, err error)
- func (c *Client) HostEstimateScoreGet(param, value string) (eg api.HostEstimateScoreGET, err error)
- func (c *Client) HostGet() (hg api.HostGET, err error)
- func (c *Client) HostModifySettingPost(param HostParam, value interface{}) (err error)
- func (c *Client) HostStorageFoldersAddPost(path string, size uint64) (err error)
- func (c *Client) HostStorageFoldersRemovePost(path string) (err error)
- func (c *Client) HostStorageFoldersResizePost(path string, size uint64) (err error)
- func (c *Client) HostStorageGet() (sg api.StorageGET, err error)
- func (c *Client) HostStorageSectorsDeletePost(root crypto.Hash) (err error)
- func (c *Client) MinerGet() (mg api.MinerGET, err error)
- func (c *Client) MinerHeaderGet() (target types.Target, bh types.BlockHeader, err error)
- func (c *Client) MinerHeaderPost(bh types.BlockHeader) (err error)
- func (c *Client) MinerStartGet() (err error)
- func (c *Client) MinerStopGet() (err error)
- func (c *Client) NewRequest(method, resource string, body io.Reader) (*http.Request, error)
- func (c *Client) RenterCancelAllowance() (err error)
- func (c *Client) RenterContractsGet() (rc api.RenterContracts, err error)
- func (c *Client) RenterDeletePost(siaPath string) (err error)
- func (c *Client) RenterDownloadFullGet(siaPath, destination string, async bool) (err error)
- func (c *Client) RenterDownloadGet(siaPath, destination string, offset, length uint64, async bool) (err error)
- func (c *Client) RenterDownloadHTTPResponseGet(siaPath string, offset, length uint64) (resp []byte, err error)
- func (c *Client) RenterDownloadsGet() (rdq api.RenterDownloadQueue, err error)
- func (c *Client) RenterFileGet(siaPath string) (rf api.RenterFile, err error)
- func (c *Client) RenterFilesGet() (rf api.RenterFiles, err error)
- func (c *Client) RenterGet() (rg api.RenterGET, err error)
- func (c *Client) RenterPostAllowance(allowance modules.Allowance) (err error)
- func (c *Client) RenterPostRateLimit(readBPS, writeBPS int64) (err error)
- func (c *Client) RenterPricesGet() (rpg api.RenterPricesGET, err error)
- func (c *Client) RenterRenamePost(siaPathOld, siaPathNew string) (err error)
- func (c *Client) RenterSetStreamCacheSizePost(cacheSize uint64) (err error)
- func (c *Client) RenterStreamGet(siaPath string) (resp []byte, err error)
- func (c *Client) RenterStreamPartialGet(siaPath string, start, end uint64) (resp []byte, err error)
- func (c *Client) RenterUploadDefaultPost(path, siaPath string) (err error)
- func (c *Client) RenterUploadPost(path, siaPath string, dataPieces, parityPieces uint64) (err error)
- func (c *Client) TransactionPoolFeeGet() (tfg api.TpoolFeeGET, err error)
- func (c *Client) TransactionPoolRawPost(txn types.Transaction, parents types.Transaction) (err error)
- func (c *Client) Wallet033xPost(path, password string) (err error)
- func (c *Client) WalletAddressGet() (wag api.WalletAddressGET, err error)
- func (c *Client) WalletAddressesGet() (wag api.WalletAddressesGET, err error)
- func (c *Client) WalletChangePasswordPost(currentPassword, newPassword string) (err error)
- func (c *Client) WalletGet() (wg api.WalletGET, err error)
- func (c *Client) WalletInitPost(password string, force bool) (wip api.WalletInitPOST, err error)
- func (c *Client) WalletInitSeedPost(seed, password string, force bool) (err error)
- func (c *Client) WalletLockPost() (err error)
- func (c *Client) WalletSeedPost(seed, password string) (err error)
- func (c *Client) WalletSeedsGet() (wsg api.WalletSeedsGET, err error)
- func (c *Client) WalletSiacoinsMultiPost(outputs []types.SiacoinOutput) (wsp api.WalletSiacoinsPOST, err error)
- func (c *Client) WalletSiacoinsPost(amount types.Currency, destination types.UnlockHash) (wsp api.WalletSiacoinsPOST, err error)
- func (c *Client) WalletSiafundsPost(amount types.Currency, destination types.UnlockHash) (wsp api.WalletSiafundsPOST, err error)
- func (c *Client) WalletSiagKeyPost(keyfiles, password string) (err error)
- func (c *Client) WalletSweepPost(seed string) (wsp api.WalletSweepPOST, err error)
- func (c *Client) WalletTransactionGet(id types.TransactionID) (wtg api.WalletTransactionGETid, err error)
- func (c *Client) WalletTransactionsGet(startHeight types.BlockHeight, endHeight types.BlockHeight) (wtg api.WalletTransactionsGET, err error)
- func (c *Client) WalletUnlockPost(password string) (err error)
- type HostParam
Constants ¶
const ( // HostParamCollateralBudget is the collateral budget of the host in // hastings. HostParamCollateralBudget = HostParam("collateralbudget") // HostParamMaxCollateral is the max collateral of the host in hastings. HostParamMaxCollateral = HostParam("maxcollateral") // HostParamMinContractPrice is the min contract price in hastings. HostParamMinContractPrice = HostParam("mincontractprice") // HostParamMinDownloadBandwidthPrice is the min download bandwidth price // in hastings/byte. HostParamMinDownloadBandwidthPrice = HostParam("mindownloadbandwidthprice") // HostParamMinUploadBandwidthPrice is the min upload bandwidth price in // hastings/byte. HostParamMinUploadBandwidthPrice = HostParam("minuploadbandwidthprice") // HostParamCollateral is the host's collateral in hastings/byte/block. HostParamCollateral = HostParam("collateral") // HostParamMinStoragePrice is the minimum storage price in // hastings/byte/block. HostParamMinStoragePrice = HostParam("minstorageprice") // HostParamAcceptingContracts indicates if the host is accepting new // contracts. HostParamAcceptingContracts = HostParam("acceptingcontracts") // HostParamMaxDuration is the max duration of a contract in blocks. HostParamMaxDuration = HostParam("maxduration") // HostParamWindowSize is the size of the proof window in blocks. HostParamWindowSize = HostParam("windowsize") // HostParamMaxDownloadBatchSize is the maximum size of the download batch // size in bytes. HostParamMaxDownloadBatchSize = HostParam("maxdownloadbatchsize") // HostParamMaxReviseBatchSize is the maximum size of the revise batch size. HostParamMaxReviseBatchSize = HostParam("maxrevisebatchsize") // HostParamNetAddress is the announced netaddress of the host. HostParamNetAddress = HostParam("netaddress") )
Variables ¶
var ( // ErrPeerExists indicates that two peers are already connected. The string // of this error needs to be updated if the string of errPeerExists in the // gateway package is changed. ErrPeerExists = errors.New("already connected to this peer") )
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { // Address is the API address of the siad server. Address string // Password must match the password of the siad server. Password string // UserAgent must match the User-Agent required by the siad server. If not // set, it defaults to "Sia-Agent". UserAgent string }
A Client makes requests to the siad HTTP API.
func (*Client) ConsensusBlocksHeightGet ¶ added in v1.3.3
func (c *Client) ConsensusBlocksHeightGet(height types.BlockHeight) (cbg api.ConsensusBlocksGet, err error)
ConsensusBlocksHeightGet requests the /consensus/blocks api resource
func (*Client) ConsensusBlocksIDGet ¶ added in v1.3.3
ConsensusBlocksIDGet requests the /consensus/blocks api resource
func (*Client) ConsensusGet ¶
func (c *Client) ConsensusGet() (cg api.ConsensusGET, err error)
ConsensusGet requests the /consensus api resource
func (*Client) DaemonStopGet ¶
DaemonStopGet stops the daemon using the /daemon/stop endpoint.
func (*Client) DaemonUpdateGet ¶ added in v1.3.3
func (c *Client) DaemonUpdateGet() (dig api.DaemonUpdateGet, err error)
DaemonUpdateGet checks for an available daemon update.
func (*Client) DaemonUpdatePost ¶ added in v1.3.3
DaemonUpdatePost updates the daemon.
func (*Client) DaemonVersionGet ¶
func (c *Client) DaemonVersionGet() (dvg api.DaemonVersionGet, err error)
DaemonVersionGet requests the /daemon/version resource
func (*Client) GatewayConnectPost ¶
func (c *Client) GatewayConnectPost(address modules.NetAddress) (err error)
GatewayConnectPost uses the /gateway/connect/:address endpoint to connect to the gateway at address
func (*Client) GatewayDisconnectPost ¶ added in v1.3.3
func (c *Client) GatewayDisconnectPost(address modules.NetAddress) (err error)
GatewayDisconnectPost uses the /gateway/disconnect/:address endpoint to disconnect the gateway from a peer.
func (*Client) GatewayGet ¶
func (c *Client) GatewayGet() (gwg api.GatewayGET, err error)
GatewayGet requests the /gateway api resource
func (*Client) HostAnnounceAddrPost ¶ added in v1.3.3
func (c *Client) HostAnnounceAddrPost(address modules.NetAddress) (err error)
HostAnnounceAddrPost uses the /host/anounce endpoint to announce the host to the network using the provided address.
func (*Client) HostAnnouncePost ¶
HostAnnouncePost uses the /host/announce endpoint to announce the host to the network
func (*Client) HostContractInfoGet ¶ added in v1.3.3
func (c *Client) HostContractInfoGet() (cg api.ContractInfoGET, err error)
HostContractInfoGet uses the /host/contracts endpoint to get information about contracts on the host.
func (*Client) HostDbActiveGet ¶
func (c *Client) HostDbActiveGet() (hdag api.HostdbActiveGET, err error)
HostDbActiveGet requests the /hostdb/active endpoint's resources.
func (*Client) HostDbAllGet ¶ added in v1.3.3
func (c *Client) HostDbAllGet() (hdag api.HostdbAllGET, err error)
HostDbAllGet requests the /hostdb/all endpoint's resources.
func (*Client) HostDbHostsGet ¶ added in v1.3.3
func (c *Client) HostDbHostsGet(pk types.SiaPublicKey) (hhg api.HostdbHostsGET, err error)
HostDbHostsGet request the /hostdb/hosts/:pubkey endpoint's resources.
func (*Client) HostEstimateScoreGet ¶ added in v1.3.3
func (c *Client) HostEstimateScoreGet(param, value string) (eg api.HostEstimateScoreGET, err error)
HostEstimateScoreGet requests the /host/estimatescore endpoint.
func (*Client) HostModifySettingPost ¶ added in v1.3.3
HostModifySettingPost uses the /host endpoint to change a param of the host settings to a certain value.
func (*Client) HostStorageFoldersAddPost ¶
HostStorageFoldersAddPost uses the /host/storage/folders/add api endpoint to add a storage folder to a host
func (*Client) HostStorageFoldersRemovePost ¶ added in v1.3.3
HostStorageFoldersRemovePost uses the /host/storage/folders/remove api endpoint to remove a storage folder from a host.
func (*Client) HostStorageFoldersResizePost ¶ added in v1.3.3
HostStorageFoldersResizePost uses the /host/storage/folders/resize api endpoint to resize an existing storage folder.
func (*Client) HostStorageGet ¶ added in v1.3.3
func (c *Client) HostStorageGet() (sg api.StorageGET, err error)
HostStorageGet requests the /host/storage endpoint.
func (*Client) HostStorageSectorsDeletePost ¶ added in v1.3.3
HostStorageSectorsDeletePost uses the /host/storage/sectors/delete endpoint to delete a sector from the host.
func (*Client) MinerHeaderGet ¶
MinerHeaderGet uses the /miner/header endpoint to get a header for work.
func (*Client) MinerHeaderPost ¶
func (c *Client) MinerHeaderPost(bh types.BlockHeader) (err error)
MinerHeaderPost uses the /miner/header endpoint to submit a solved block header that was previously received from the same endpoint
func (*Client) MinerStartGet ¶
MinerStartGet uses the /miner/start endpoint to start the cpu miner.
func (*Client) MinerStopGet ¶
MinerStopGet uses the /miner/stop endpoint to stop the cpu miner.
func (*Client) NewRequest ¶
NewRequest constructs a request to the siad HTTP API, setting the correct User-Agent and Basic Auth. The resource path must begin with /.
func (*Client) RenterCancelAllowance ¶ added in v1.3.3
RenterCancelAllowance uses the /renter endpoint to cancel the allowance.
func (*Client) RenterContractsGet ¶
func (c *Client) RenterContractsGet() (rc api.RenterContracts, err error)
RenterContractsGet requests the /renter/contracts resource
func (*Client) RenterDeletePost ¶
RenterDeletePost uses the /renter/delete endpoint to delete a file.
func (*Client) RenterDownloadFullGet ¶ added in v1.3.3
RenterDownloadFullGet uses the /renter/download endpoint to download a full file.
func (*Client) RenterDownloadGet ¶
func (c *Client) RenterDownloadGet(siaPath, destination string, offset, length uint64, async bool) (err error)
RenterDownloadGet uses the /renter/download endpoint to download a file to a destination on disk.
func (*Client) RenterDownloadHTTPResponseGet ¶
func (c *Client) RenterDownloadHTTPResponseGet(siaPath string, offset, length uint64) (resp []byte, err error)
RenterDownloadHTTPResponseGet uses the /renter/download endpoint to download a file and return its data.
func (*Client) RenterDownloadsGet ¶
func (c *Client) RenterDownloadsGet() (rdq api.RenterDownloadQueue, err error)
RenterDownloadsGet requests the /renter/downloads resource
func (*Client) RenterFileGet ¶ added in v1.3.3
func (c *Client) RenterFileGet(siaPath string) (rf api.RenterFile, err error)
RenterFileGet uses the /renter/file/:siapath endpoint to query a file.
func (*Client) RenterFilesGet ¶
func (c *Client) RenterFilesGet() (rf api.RenterFiles, err error)
RenterFilesGet requests the /renter/files resource.
func (*Client) RenterPostAllowance ¶ added in v1.3.3
RenterPostAllowance uses the /renter endpoint to change the renter's allowance
func (*Client) RenterPostRateLimit ¶ added in v1.3.3
RenterPostRateLimit uses the /renter endpoint to change the renter's bandwidth rate limit.
func (*Client) RenterPricesGet ¶ added in v1.3.3
func (c *Client) RenterPricesGet() (rpg api.RenterPricesGET, err error)
RenterPricesGet requests the /renter/prices endpoint's resources.
func (*Client) RenterRenamePost ¶ added in v1.3.3
RenterRenamePost uses the /renter/rename/:siapath endpoint to rename a file.
func (*Client) RenterSetStreamCacheSizePost ¶ added in v1.3.3
RenterSetStreamCacheSizePost uses the /renter endpoint to change the renter's streamCacheSize for streaming
func (*Client) RenterStreamGet ¶ added in v1.3.3
RenterStreamGet uses the /renter/stream endpoint to download data as a stream.
func (*Client) RenterStreamPartialGet ¶ added in v1.3.3
RenterStreamPartialGet uses the /renter/stream endpoint to download a part of data as a stream.
func (*Client) RenterUploadDefaultPost ¶ added in v1.3.3
RenterUploadDefaultPost uses the /renter/upload endpoint with default redundancy settings to upload a file.
func (*Client) RenterUploadPost ¶
func (c *Client) RenterUploadPost(path, siaPath string, dataPieces, parityPieces uint64) (err error)
RenterUploadPost uses the /renter/upload endpoint to upload a file
func (*Client) TransactionPoolFeeGet ¶ added in v1.3.3
func (c *Client) TransactionPoolFeeGet() (tfg api.TpoolFeeGET, err error)
TransactionPoolFeeGet uses the /tpool/fee endpoint to get a fee estimation.
func (*Client) TransactionPoolRawPost ¶ added in v1.3.3
func (c *Client) TransactionPoolRawPost(txn types.Transaction, parents types.Transaction) (err error)
TransactionPoolRawPost uses the /tpool/raw endpoint to send a raw transaction to the transaction pool.
func (*Client) Wallet033xPost ¶ added in v1.3.3
Wallet033xPost uses the /wallet/033x endpoint to load a v0.3.3.x wallet into the current wallet.
func (*Client) WalletAddressGet ¶
func (c *Client) WalletAddressGet() (wag api.WalletAddressGET, err error)
WalletAddressGet requests a new address from the /wallet/address endpoint
func (*Client) WalletAddressesGet ¶ added in v1.3.3
func (c *Client) WalletAddressesGet() (wag api.WalletAddressesGET, err error)
WalletAddressesGet requests the wallets known addresses from the /wallet/addresses endpoint.
func (*Client) WalletChangePasswordPost ¶ added in v1.3.3
WalletChangePasswordPost uses the /wallet/changepassword endpoint to change the wallet's password.
func (*Client) WalletInitPost ¶
WalletInitPost uses the /wallet/init endpoint to initialize and encrypt a wallet
func (*Client) WalletInitSeedPost ¶ added in v1.3.3
WalletInitSeedPost uses the /wallet/init/seed endpoint to initialize and encrypt a wallet using a given seed.
func (*Client) WalletLockPost ¶ added in v1.3.3
WalletLockPost uses the /wallet/lock endpoint to lock the wallet.
func (*Client) WalletSeedPost ¶ added in v1.3.3
WalletSeedPost uses the /wallet/seed endpoint to add a seed to the wallet's list of seeds.
func (*Client) WalletSeedsGet ¶ added in v1.3.3
func (c *Client) WalletSeedsGet() (wsg api.WalletSeedsGET, err error)
WalletSeedsGet uses the /wallet/seeds endpoint to return the wallet's current seeds.
func (*Client) WalletSiacoinsMultiPost ¶
func (c *Client) WalletSiacoinsMultiPost(outputs []types.SiacoinOutput) (wsp api.WalletSiacoinsPOST, err error)
WalletSiacoinsMultiPost uses the /wallet/siacoin api endpoint to send money to multiple addresses at once
func (*Client) WalletSiacoinsPost ¶
func (c *Client) WalletSiacoinsPost(amount types.Currency, destination types.UnlockHash) (wsp api.WalletSiacoinsPOST, err error)
WalletSiacoinsPost uses the /wallet/siacoins api endpoint to send money to a single address
func (*Client) WalletSiafundsPost ¶ added in v1.3.3
func (c *Client) WalletSiafundsPost(amount types.Currency, destination types.UnlockHash) (wsp api.WalletSiafundsPOST, err error)
WalletSiafundsPost uses the /wallet/siafunds api endpoint to send siafunds to a single address.
func (*Client) WalletSiagKeyPost ¶ added in v1.3.3
WalletSiagKeyPost uses the /wallet/siagkey endpoint to load a siag key into the wallet.
func (*Client) WalletSweepPost ¶ added in v1.3.3
func (c *Client) WalletSweepPost(seed string) (wsp api.WalletSweepPOST, err error)
WalletSweepPost uses the /wallet/sweep/seed endpoint to sweep a seed into the current wallet.
func (*Client) WalletTransactionGet ¶ added in v1.3.3
func (c *Client) WalletTransactionGet(id types.TransactionID) (wtg api.WalletTransactionGETid, err error)
WalletTransactionGet requests the /wallet/transaction/:id api resource for a certain TransactionID.
func (*Client) WalletTransactionsGet ¶
func (c *Client) WalletTransactionsGet(startHeight types.BlockHeight, endHeight types.BlockHeight) (wtg api.WalletTransactionsGET, err error)
WalletTransactionsGet requests the/wallet/transactions api resource for a certain startheight and endheight
func (*Client) WalletUnlockPost ¶
WalletUnlockPost uses the /wallet/unlock endpoint to unlock the wallet with a given encryption key. Per default this key is the seed.