pub fn get_unsealed_range<T: Into<PathBuf> + AsRef<Path>, Tree: 'static + MerkleTreeTrait>(
    porep_config: PoRepConfig,
    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

  • porep_config - porep configuration containing the sector size.
  • 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 - the prover-id that sealed the sector.
  • sector_id - the sector-id of the sealed sector.
  • 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.