Documentation ¶
Index ¶
- func HttpGET(url string) (resp *http.Response, err error)
- func HttpPOST(url string, data string) (resp *http.Response, err error)
- type ActiveHosts
- type ConsensusBlockGET
- type ConsensusGET
- type DownloadInfo
- type FileInfo
- type GatewayInfo
- type MinerStatus
- type RenterFilesLoadResponse
- type Server
- type SiaConstants
- type UpdateInfo
- type WalletAddressGET
- type WalletAddressesGET
- type WalletEncryptPOST
- type WalletGET
- type WalletInitPOST
- type WalletSeedsGET
- type WalletSiacoinsPOST
- type WalletSiafundsPOST
- type WalletTransactionGETid
- type WalletTransactionsGET
- type WalletTransactionsGETaddr
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ActiveHosts ¶
type ActiveHosts struct {
Hosts []modules.HostSettings
}
ActiveHosts is the struct that pads the response to the hostdb module call "ActiveHosts". The padding is used so that the return value can have an explicit name, which makes adding or removing fields easier in the future.
type ConsensusBlockGET ¶
ConsensusBlockGET contains a block.
type ConsensusGET ¶ added in v1.0.0
type ConsensusGET struct { Height types.BlockHeight `json:"height"` CurrentBlock types.BlockID `json:"currentblock"` Target types.Target `json:"target"` }
ConsensusGET contains general information about the consensus set, with tags to support idiomatic json encodings.
type DownloadInfo ¶
type DownloadInfo struct { StartTime time.Time Filesize uint64 Received uint64 Destination string Nickname string }
DownloadInfo is a helper struct for the downloadqueue API call.
type FileInfo ¶
type FileInfo struct { Available bool UploadProgress float32 Nickname string Filesize uint64 TimeRemaining types.BlockHeight }
FileInfo is a helper struct for the files API call.
type GatewayInfo ¶
type GatewayInfo struct { Address modules.NetAddress Peers []modules.NetAddress }
type MinerStatus ¶
type MinerStatus struct { CPUMining bool CPUHashrate int // hashes per second BlocksMined int StaleBlocksMined int }
MinerStatus contains all of the fields returned when querying the miner's status.
type RenterFilesLoadResponse ¶
type RenterFilesLoadResponse struct {
FilesAdded []string
}
LoadedFiles lists files that were loaded into the renter.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
A Server is essentially a collection of modules and an API server to talk to them all.
func NewServer ¶
func NewServer(APIaddr string, s *consensus.ConsensusSet, g modules.Gateway, h modules.Host, hdb modules.HostDB, m modules.Miner, r modules.Renter, tp modules.TransactionPool, w modules.Wallet, exp modules.Explorer) (*Server, error)
NewServer creates a new API server from the provided modules.
func (*Server) ProcessConsensusChange ¶
func (srv *Server) ProcessConsensusChange(cc modules.ConsensusChange)
ProcessConsensusChange gets called by the consensus set every time there is a change to the blockchain.
type SiaConstants ¶
type SiaConstants struct { BlockSizeLimit uint64 BlockFrequency types.BlockHeight TargetWindow types.BlockHeight MedianTimestampWindow uint64 FutureThreshold types.Timestamp SiafundCount types.Currency SiafundPortion *big.Rat InitialCoinbase uint64 MinimumCoinbase uint64 MaturityDelay types.BlockHeight GenesisTimestamp types.Timestamp GenesisSiafundUnlockHash types.UnlockHash GenesisClaimUnlockHash types.UnlockHash RootTarget types.Target RootDepth types.Target MaxAdjustmentUp *big.Rat MaxAdjustmentDown *big.Rat SiacoinPrecision types.Currency }
SiaConstants is a struct listing all of the constants in use.
type UpdateInfo ¶
type WalletAddressGET ¶ added in v1.0.0
type WalletAddressGET struct {
Address types.UnlockHash `json:"address"`
}
WalletAddressGET contains an address returned by a GET call to /wallet/address.
type WalletAddressesGET ¶ added in v1.0.0
type WalletAddressesGET struct {
Addresses []modules.WalletAddress `json:"addresses"`
}
WalletAddressesGET contains the list of wallet addresses returned by a GET call to /wallet/addresses.
type WalletEncryptPOST ¶
type WalletEncryptPOST struct {
PrimarySeed string `json:"primaryseed"`
}
WalletEncryptPOST contains the primary seed that gets generated during a POST call to /wallet/encrypt.
COMPATv0.4.0
type WalletGET ¶ added in v1.0.0
type WalletGET struct { Encrypted bool `json:"encrypted"` Unlocked bool `json:"unlocked"` ConfirmedSiacoinBalance types.Currency `json:"confirmedsiacoinbalance"` UnconfirmedOutgoingSiacoins types.Currency `json:"unconfirmedoutgoingsiacoins"` UnconfirmedIncomingSiacoins types.Currency `json:"unconfirmedincomingsiacoins"` SiafundBalance types.Currency `json:"siafundbalance"` SiacoinClaimBalance types.Currency `json:"siacoinclaimbalance"` }
WalletGET contains general information about the wallet.
type WalletInitPOST ¶ added in v1.0.0
type WalletInitPOST struct {
PrimarySeed string `json:"primaryseed"`
}
WalletInitPOST contains the primary seed that gets generated during a POST call to /wallet/init.
type WalletSeedsGET ¶ added in v1.0.0
type WalletSeedsGET struct { PrimarySeed string `json:"primaryseed"` AddressesRemaining int `json:"addressesremaining"` AllSeeds []string `json:"allseeds"` }
WalletSeedGet contains the seeds used by the wallet.
type WalletSiacoinsPOST ¶ added in v1.0.0
type WalletSiacoinsPOST struct {
TransactionIDs []types.TransactionID `json:"transactionids"`
}
WalletSiacoinsPOST contains the transaction sent in the POST call to /wallet/siafunds.
type WalletSiafundsPOST ¶ added in v1.0.0
type WalletSiafundsPOST struct {
TransactionIDs []types.TransactionID `json:"transactionids"`
}
WalletSiafundsPOST contains the transaction sent in the POST call to /wallet/siafunds.
type WalletTransactionGETid ¶ added in v1.0.0
type WalletTransactionGETid struct {
Transaction modules.ProcessedTransaction `json:"transaction"`
}
WalletTransactionGETid contains the transaction returned by a call to /wallet/transaction/$(id)
type WalletTransactionsGET ¶ added in v1.0.0
type WalletTransactionsGET struct { ConfirmedTransactions []modules.ProcessedTransaction `json:"confirmedtransactions"` UnconfirmedTransactions []modules.ProcessedTransaction `json:"unconfirmedtransactions"` }
WalletTransactionsGET contains the specified set of confirmed and unconfirmed transactions.
type WalletTransactionsGETaddr ¶ added in v1.0.0
type WalletTransactionsGETaddr struct { ConfirmedTransactions []modules.ProcessedTransaction `json:"confirmedtransactions"` UnconfirmedTransactions []modules.ProcessedTransaction `json:"unconfirmedtransactions"` }
WalletTransactionsGETaddr contains the set of wallet transactions relevant to the input address provided in the call to /wallet/transaction/$(addr)