Documentation ¶
Overview ¶
Package muse provides a Sia contract server and client.
Index ¶
- func NewServer(dir string, wallet proto.Wallet, tpool proto.TransactionPool, shardAddr string) (http.Handler, error)
- type Client
- func (c *Client) AllContracts() (cs []Contract, err error)
- func (c *Client) Contracts(set string) (cs []Contract, err error)
- func (c *Client) Delete(id types.FileContractID) (err error)
- func (c *Client) Form(host hostdb.HostPublicKey, funds types.Currency, start, end types.BlockHeight, ...) (contract Contract, err error)
- func (c *Client) HostSet(name string) (hosts []hostdb.HostPublicKey, err error)
- func (c *Client) HostSets() (hs []string, err error)
- func (c *Client) Renew(id types.FileContractID, funds types.Currency, start, end types.BlockHeight, ...) (contract Contract, err error)
- func (c *Client) SHARD() *shard.Client
- func (c *Client) Scan(host hostdb.HostPublicKey) (settings hostdb.HostSettings, err error)
- func (c *Client) SetHostSet(name string, hosts []hostdb.HostPublicKey) (err error)
- func (c *Client) WithContext(ctx context.Context) *Client
- type Contract
- type RequestForm
- type RequestRenew
- type RequestScan
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
A Client communicates with a muse server.
func NewClient ¶
NewClient returns a client that communicates with a muse server listening on the specified address.
func (*Client) AllContracts ¶
AllContracts returns all contracts formed by the server.
func (*Client) Delete ¶ added in v0.6.2
func (c *Client) Delete(id types.FileContractID) (err error)
Delete removes the record of a contract from the server. The contract itself is not revised or otherwise affected in any way. In general, this method should only be used on contracts that have expired and are no longer needed.
func (*Client) Form ¶
func (c *Client) Form(host hostdb.HostPublicKey, funds types.Currency, start, end types.BlockHeight, settings hostdb.HostSettings) (contract Contract, err error)
Form forms a contract with a host. The settings should be obtained from a recent call to Scan. If the settings have changed in the interim, the host may reject the contract.
func (*Client) HostSet ¶
func (c *Client) HostSet(name string) (hosts []hostdb.HostPublicKey, err error)
HostSet returns the contents of the named host set.
func (*Client) Renew ¶
func (c *Client) Renew(id types.FileContractID, funds types.Currency, start, end types.BlockHeight, settings hostdb.HostSettings) (contract Contract, err error)
Renew renews the contract with the specified ID, which must refer to a contract previously formed by the server. The settings should be obtained from a recent call to Scan. If the settings have changed in the interim, the host may reject the contract.
func (*Client) Scan ¶
func (c *Client) Scan(host hostdb.HostPublicKey) (settings hostdb.HostSettings, err error)
Scan queries the specified host for its current settings.
Note that the host may also be scanned via the hostdb.Scan function.
func (*Client) SetHostSet ¶
func (c *Client) SetHostSet(name string, hosts []hostdb.HostPublicKey) (err error)
SetHostSet sets the contents of a host set, creating it if it does not exist. If an empty slice is passed, the host set is deleted.
type Contract ¶
type Contract struct { renter.Contract HostAddress modules.NetAddress EndHeight types.BlockHeight }
A Contract represents a Sia file contract, along with additional metadata.
type RequestForm ¶
type RequestForm struct { HostKey hostdb.HostPublicKey Funds types.Currency StartHeight types.BlockHeight EndHeight types.BlockHeight Settings hostdb.HostSettings }
RequestForm is the request type for the /form endpoint.
type RequestRenew ¶
type RequestRenew struct { ID types.FileContractID Funds types.Currency StartHeight types.BlockHeight EndHeight types.BlockHeight Settings hostdb.HostSettings }
RequestRenew is the request type for the /renew endpoint.
type RequestScan ¶
type RequestScan struct {
HostKey hostdb.HostPublicKey
}
RequestScan is the request type for the /scan endpoint.