Function fetch_metadata

Source
pub async fn fetch_metadata(
    fud: &Fud,
    hash: &Hash,
    seeders_sub: &Subscription<Option<Vec<FudSeeder>>>,
    path: &Path,
) -> Result<FudSeeder>
Expand description

Fetch a single resource metadata from seeders received from seeders_sub. If the resource is a file smaller than a single chunk then seeder can send the chunk directly, and we will create the file from it on path path.

  1. Wait for seeders from the subscription
  2. Request the metadata from the seeders
  3. Insert metadata to geode using the reply