package
0.7.1
Repository: https://github.com/siafoundation/core.git
Documentation: pkg.go.dev

# Functions

BuildDiffProof constructs a diff proof for the specified actions.
BuildProof constructs a proof for the segment range [start, end).
BuildSectorRangeProof constructs a proof for the sector range [start, end).
CalculateHostPayouts calculates the contract payouts for the host.
ContractFormationCollateral returns the amount of collateral we add when forming a contract where expectedStorage is the amount of storage we expect to upload to the contract.
ContractFormationCost returns the cost of forming a contract.
ContractRenewalCollateral returns the amount of collateral we add on top of the baseCollateral when renewing a contract.
ContractRenewalCost returns the cost of renewing a contract for the renter.
ConvertProofOrdering converts "left-to-right" proofs into the "leaf-to-root" ordering used in consensus storage proofs.
DiffProofSize returns the size of a Merkle diff proof for the specified actions within a tree containing numLeaves leaves.
MetaRoot calculates the root of a set of existing Merkle roots.
NewHostTransport conducts the hosts's half of the renter-host protocol handshake, returning a Transport that can be used to handle RPC requests.
NewRangeProofVerifier returns a RangeProofVerifier for the sector range [start, end).
NewRenterTransport conducts the renter's half of the renter-host protocol handshake, returning a Transport that can be used to make RPC requests.
PrepareContractFormation constructs a contract formation transaction.
PrepareContractRenewal constructs a contract renewal transaction.
ProofSize returns the size of a Merkle proof for the leaf i within a tree containing n leaves.
RangeProofSize returns the size of a Merkle proof for the leaf range [start, end) within a tree containing n leaves.
ReaderRoot returns the Merkle root of the supplied stream, which must contain an integer multiple of leaves.
ReadSector reads a single sector from r and calculates its root.
SectorRoot computes the Merkle root of a sector.
VerifyAppendProof verifies a proof produced by BuildAppendProof.
VerifyDiffProof verifies a proof produced by BuildDiffProof.
VerifySectorRangeProof verifies a proof produced by BuildRangeProof.

# Constants

LeafSize is the size of one leaf in bytes.
LeavesPerSector is the number of leaves in one sector.
4 MiB.

# Variables

ErrInvalidSectorLength is returned when a sector is not the correct length.
ErrOffsetOutOfBounds is returned when the offset exceeds and length exceed the sector size.
ErrRenterClosed is returned by (*Transport).ReadID when the renter sends the Transport termination signal.
ErrSwapOutOfBounds is returned when one of the swap indices exceeds the total number of sectors.
ErrTrimOutOfBounds is returned when a trim operation exceeds the total number of sectors.
ErrUpdateOutOfBounds is returned when the update index exceeds the total number of sectors.
ErrUpdateProofSize is returned when a proof is requested for an update operation that is not a multiple of 64 bytes.
RPC IDs.
RPC IDs.
RPC IDs.
Read/Write actions.
RPC IDs.
RPC IDs.
RPC IDs.
RPC IDs.
RPC IDs.
Read/Write actions.
Read/Write actions.
Read/Write actions.
Read/Write actions.
RPC IDs.

# Structs

A ContractRevision pairs a file contract with its signatures.
HostSettings are the settings and prices used when interacting with a host.
A RangeProofVerifier allows range proofs to be verified in streaming fashion.
A ResponseReader contains an unencrypted, unauthenticated RPC response message.
RPCCost represents the cost of an RPC based on a hosts settings.
An RPCError may be sent instead of a response object to any RPC.
RPC request/response objects.
RPC request/response objects.
RPC request/response objects.
RPC request/response objects.
RPC request/response objects.
RPC request/response objects.
RPC request/response objects.
RPC request/response objects.
RPC request/response objects.
RPC request/response objects.
RPC request/response objects.
RPC request/response objects.
RPC request/response objects.
RPC request/response objects.
RPC request/response objects.
RPC request/response objects.
RPC request/response objects.
A Transport facilitates the exchange of RPCs via the renter-host protocol, version 2.

# Interfaces

A ProtocolObject is an object that can be serialized for transport in the renter-host protocol.

# Type aliases

A Challenge is a random 128-bit value used to authenticate RPCs.