Skip to content

Commit

Permalink
Add subspace-object-fetching crate
Browse files Browse the repository at this point in the history
  • Loading branch information
teor2345 committed Sep 9, 2024
1 parent b0a12d1 commit c832e67
Show file tree
Hide file tree
Showing 6 changed files with 389 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions crates/subspace-core-primitives/src/pieces.rs
Original file line number Diff line number Diff line change
Expand Up @@ -652,6 +652,7 @@ impl Record {
}

/// Convert from a record to its raw bytes. Used for object reconstruction.
/// Only works for source records.
pub fn to_raw_record_bytes(&self) -> impl Iterator<Item = u8> + '_ {
// We have zero byte padding from [`Scalar::SAFE_BYTES`] to [`Scalar::FULL_BYTES`] that we need
// to skip
Expand Down
43 changes: 43 additions & 0 deletions crates/subspace-object-fetching/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
[package]
name = "subspace-object-fetching"
description = "Fetching archived objects from the Subspace Distributed Storage Network"
license = "Apache-2.0"
version = "0.1.0"
authors = ["Teor <[email protected]>"]
edition = "2021"
include = [
"/src",
"/Cargo.toml",
"/README.md",
]

[lib]
# Necessary for CLI options to work on benches
bench = false

[dependencies]
parity-scale-codec = { version = "3.6.12", default-features = false, features = ["derive"] }
subspace-archiving = { version = "0.1.0", path = "../subspace-archiving", default-features = false }
subspace-core-primitives = { version = "0.1.0", path = "../subspace-core-primitives", default-features = false }
subspace-erasure-coding = { version = "0.1.0", path = "../subspace-erasure-coding", default-features = false }
thiserror = { version = "1.0.63", optional = true }
tracing = { version = "0.1.40", default-features = false }

[dev-dependencies]
subspace-core-primitives = { version = "0.1.0", path = "../subspace-core-primitives" }

[features]
default = ["std"]
parallel = [
"subspace-archiving/parallel",
"subspace-core-primitives/parallel",
]
std = [
"parity-scale-codec/std",
"parallel",
"subspace-archiving/std",
"subspace-core-primitives/std",
"subspace-erasure-coding/std",
"thiserror",
"tracing/std",
]
1 change: 1 addition & 0 deletions crates/subspace-object-fetching/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fetching archived objects from the Subspace Distributed Storage Network.
19 changes: 19 additions & 0 deletions crates/subspace-object-fetching/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// Copyright (C) 2024 Subspace Labs, Inc.
// SPDX-License-Identifier: Apache-2.0

// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

//! Fetching archived objects from the Subspace Distributed Storage Network.
#![cfg_attr(not(feature = "std"), no_std)]

pub mod object_fetcher;
Loading

0 comments on commit c832e67

Please sign in to comment.