Function filecoin_proofs_api::seal::get_unsealed_range

source ·
pub fn get_unsealed_range<T: Into<PathBuf> + AsRef<Path>>(
    registered_proof: RegisteredSealProof,
    cache_path: T,
    sealed_path: T,
    output_path: T,
    prover_id: ProverId,
    sector_id: SectorId,
    comm_d: Commitment,
    ticket: Ticket,
    offset: UnpaddedByteIndex,
    num_bytes: UnpaddedBytesAmount,
) -> Result<UnpaddedBytesAmount>
Expand description

Unseals the sector at sealed_path and returns the bytes for a piece whose first (unpadded) byte begins at offset and ends at offset plus num_bytes, inclusive. Note that the entire sector is unsealed each time this function is called.

§Arguments

  • registered_proof - Selected seal operation.
  • cache_path - Path to the directory in which the sector data’s Merkle tree is written.
  • sealed_path - Path to the sealed sector file that we will unseal and read a byte range.
  • output_path - Path to a file that we will write the requested byte range to.
  • prover_id - Unique ID of the storage provider.
  • sector_id - ID of the sector, usually relative to the miner.
  • comm_d - The commitment to the sector’s data.
  • ticket - The ticket that was used to generate the sector’s replica-id.
  • offset - The byte index in the unsealed sector of the first byte that we want to read.
  • num_bytes - The number of bytes that we want to read.

Returns count of bytes unsealed.