transport

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: Apache-2.0 Imports: 12 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ADNLProofScheme added in v0.2.0

type ADNLProofScheme struct {
	Key []byte `tl:"int256"`
}

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(gate *adnl.Gateway, dht DHT) *Client

func (*Client) GetStorageRates

func (c *Client) GetStorageRates(ctx context.Context, provider []byte, size uint64) (*StorageRatesResponse, error)

func (*Client) RequestStorageInfo

func (c *Client) RequestStorageInfo(ctx context.Context, provider []byte, contractAddr *tonaddress.Address, byteToProof uint64) (*StorageResponse, error)

func (*Client) VerifyStorageADNLProof added in v0.2.0

func (c *Client) VerifyStorageADNLProof(ctx context.Context, provider []byte, contract *tonaddress.Address) ([]byte, error)

type DHT

type DHT interface {
	FindAddresses(ctx context.Context, key []byte) (*address.List, ed25519.PublicKey, error)
	FindValue(ctx context.Context, key *dht.Key, continuation ...*dht.Continuation) (*dht.Value, *dht.Continuation, error)
}

type ProviderDHTRecord

type ProviderDHTRecord struct {
	ADNLAddr []byte `tl:"int256"`
}

type StorageADNLProofRequest added in v0.2.0

type StorageADNLProofRequest struct {
	ContractAddress []byte `tl:"int256"`
}

type StorageADNLProofResponse added in v0.2.0

type StorageADNLProofResponse struct {
	StorageKey []byte `tl:"int256"`
	Signature  []byte `tl:"bytes"`
}

type StorageRatesRequest

type StorageRatesRequest struct {
	Size uint64 `tl:"long"`
}

type StorageRatesResponse

type StorageRatesResponse struct {
	Available        bool   `tl:"bool"`
	RatePerMBDay     []byte `tl:"bytes"`
	MinBounty        []byte `tl:"bytes"`
	SpaceAvailableMB uint64 `tl:"long"`
	MinSpan          uint32 `tl:"int"`
	MaxSpan          uint32 `tl:"int"`
}

type StorageRequest

type StorageRequest struct {
	ContractAddress []byte `tl:"int256"`
	ByteToProof     uint64 `tl:"long"`
}

type StorageResponse

type StorageResponse struct {
	Status     string `tl:"string"`
	Reason     string `tl:"string"`
	Downloaded uint64 `tl:"long"`
	Proof      []byte `tl:"bytes"`
}

Jump to

Keyboard shortcuts

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