Documentation ¶
Index ¶
- func FetchPriceTable(host modules.HostDBEntry) (rhpv3.HostPriceTable, error)
- func HostSettings(address string, hpk types.PublicKey) (settings rhpv2.HostSettings, err error)
- func RPCAccountBalance(ctx context.Context, t *rhpv3.Transport, payment rhpv3.PaymentMethod, ...) (bal types.Currency, err error)
- func RPCAppendSector(ctx context.Context, t *rhpv3.Transport, renterKey types.PrivateKey, ...) (sectorRoot types.Hash256, cost types.Currency, err error)
- func RPCFormContract(ctx context.Context, t *rhpv2.Transport, renterKey types.PrivateKey, ...) (_ rhpv2.ContractRevision, _ []types.Transaction, err error)
- func RPCFundAccount(ctx context.Context, t *rhpv3.Transport, payment rhpv3.PaymentMethod, ...) (err error)
- func RPCLatestRevision(ctx context.Context, t *rhpv3.Transport, contractID types.FileContractID) (types.FileContractRevision, error)
- func RPCPriceTable(ctx context.Context, t *rhpv3.Transport, paymentFunc PriceTablePaymentFunc) (pt rhpv3.HostPriceTable, err error)
- func RPCReadSector(ctx context.Context, t *rhpv3.Transport, w io.Writer, pt rhpv3.HostPriceTable, ...) (cost, refund types.Currency, err error)
- func RPCRenewContract(ctx context.Context, t *rhpv3.Transport, renterKey types.PrivateKey, ...) (_ rhpv2.ContractRevision, _ []types.Transaction, err error)
- func RPCSettings(ctx context.Context, t *rhpv2.Transport) (settings rhpv2.HostSettings, err error)
- func RPCTrustlessFormContract(ctx context.Context, t *rhpv2.Transport, s *modules.RPCSession, ...) (_ rhpv2.ContractRevision, _ []types.Transaction, err error)
- func RPCTrustlessRenewContract(ctx context.Context, ss *modules.RPCSession, t *rhpv3.Transport, ...) (_ rhpv2.ContractRevision, _ []types.Transaction, err error)
- func ReadSectorCost(pt rhpv3.HostPriceTable, length uint64) (types.Currency, error)
- func UploadSectorCost(pt rhpv3.HostPriceTable, windowEnd uint64) (cost, collateral, storage types.Currency, _ error)
- func WithTransportV2(ctx context.Context, hostIP string, hostKey types.PublicKey, ...) (err error)
- func WithTransportV3(ctx context.Context, siamuxAddr string, hostKey types.PublicKey, ...) (err error)
- type PriceTablePaymentFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FetchPriceTable ¶
func FetchPriceTable(host modules.HostDBEntry) (rhpv3.HostPriceTable, error)
HostPriceTable retrieves the price table from the host.
func HostSettings ¶
HostSettings uses the Settings RPC to retrieve the host's settings.
func RPCAccountBalance ¶
func RPCAccountBalance(ctx context.Context, t *rhpv3.Transport, payment rhpv3.PaymentMethod, account rhpv3.Account, settingsID rhpv3.SettingsID) (bal types.Currency, err error)
RPCAccountBalance fetches the balance of an ephemeral account.
func RPCAppendSector ¶
func RPCAppendSector(ctx context.Context, t *rhpv3.Transport, renterKey types.PrivateKey, pt rhpv3.HostPriceTable, rev types.FileContractRevision, payment rhpv3.PaymentMethod, sector *[rhpv2.SectorSize]byte) (sectorRoot types.Hash256, cost types.Currency, err error)
RPCAppendSector calls the ExecuteProgram RPC with an AppendSector instruction.
func RPCFormContract ¶
func RPCFormContract(ctx context.Context, t *rhpv2.Transport, renterKey types.PrivateKey, txnSet []types.Transaction) (_ rhpv2.ContractRevision, _ []types.Transaction, err error)
RPCFormContract forms a contract with the host.
func RPCFundAccount ¶
func RPCFundAccount(ctx context.Context, t *rhpv3.Transport, payment rhpv3.PaymentMethod, account rhpv3.Account, settingsID rhpv3.SettingsID) (err error)
RPCFundAccount funds an ephemeral account.
func RPCLatestRevision ¶
func RPCLatestRevision(ctx context.Context, t *rhpv3.Transport, contractID types.FileContractID) (types.FileContractRevision, error)
RPCLatestRevision fetches the latest revision from the host.
func RPCPriceTable ¶
func RPCPriceTable(ctx context.Context, t *rhpv3.Transport, paymentFunc PriceTablePaymentFunc) (pt rhpv3.HostPriceTable, err error)
RPCPriceTable negotiates a price table with the host.
func RPCReadSector ¶
func RPCReadSector(ctx context.Context, t *rhpv3.Transport, w io.Writer, pt rhpv3.HostPriceTable, payment rhpv3.PaymentMethod, offset, length uint32, merkleRoot types.Hash256) (cost, refund types.Currency, err error)
RPCReadSector calls the ExecuteProgram RPC with a ReadSector instruction.
func RPCRenewContract ¶
func RPCRenewContract(ctx context.Context, t *rhpv3.Transport, renterKey types.PrivateKey, rev types.FileContractRevision, txnSet []types.Transaction, toSign []types.Hash256, ts transactionSigner) (_ rhpv2.ContractRevision, _ []types.Transaction, err error)
RPCRenewContract negotiates a contract renewal with the host.
func RPCSettings ¶
RPCSettings returns the host's reported settings.
func RPCTrustlessFormContract ¶
func RPCTrustlessFormContract(ctx context.Context, t *rhpv2.Transport, s *modules.RPCSession, rpk types.PublicKey, txnSet []types.Transaction) (_ rhpv2.ContractRevision, _ []types.Transaction, err error)
RPCTrustlessFormContract forms a contract with the host using the new Renter-Satellite protocol.
func RPCTrustlessRenewContract ¶
func RPCTrustlessRenewContract(ctx context.Context, ss *modules.RPCSession, t *rhpv3.Transport, txnSet []types.Transaction, toSign []types.Hash256, ts transactionSigner) (_ rhpv2.ContractRevision, _ []types.Transaction, err error)
RPCTrustlessRenewContract negotiates a contract renewal with the host using the new Renter-Satellite protocol.
func ReadSectorCost ¶
ReadSectorCost returns an overestimate for the cost of reading a sector from a host.
func UploadSectorCost ¶
func UploadSectorCost(pt rhpv3.HostPriceTable, windowEnd uint64) (cost, collateral, storage types.Currency, _ error)
UploadSectorCost returns an overestimate for the cost of uploading a sector to a host.
Types ¶
type PriceTablePaymentFunc ¶
type PriceTablePaymentFunc func(pt rhpv3.HostPriceTable) (rhpv3.PaymentMethod, error)
PriceTablePaymentFunc is a function that can be passed in to RPCPriceTable. It is called after the price table is received from the host and supposed to create a payment for that table and return it. It can also be used to perform gouging checks before paying for the table.