proto

package
v0.3.0-beta Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 31, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

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

func HostSettings(address string, hpk types.PublicKey) (settings rhpv2.HostSettings, err error)

HostSettings uses the Settings RPC to retrieve the host's settings.

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 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 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

func RPCSettings(ctx context.Context, t *rhpv2.Transport) (settings rhpv2.HostSettings, err error)

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 WithTransportV2

func WithTransportV2(ctx context.Context, hostIP string, hostKey types.PublicKey, fn func(*rhpv2.Transport) error) (err error)

WithTransportV2 creates a transport and calls an RHP2 RPC.

func WithTransportV3

func WithTransportV3(ctx context.Context, siamuxAddr string, hostKey types.PublicKey, fn func(*rhpv3.Transport) error) (err error)

WithTransportV3 creates a transport and calls an RHP3 RPC.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL