Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .claude/skills/test/pallet.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,6 @@ fn test_provider_registered_event() {

## Links

- [Pallet Source](/pallet/src/lib.rs)
- [Pallet Source](/crates/pallets/storage-provider/src/lib.rs)
- For end-to-end exercise: `just demo` (Layer-0 PAPI), `just fs-demo-ci`, `just s3-demo-ci`
- [Runtime](/runtime/src/lib.rs)
- [Runtime](/runtime/src/lib.rs)
3 changes: 1 addition & 2 deletions .github/workflows/check-runtime-migration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,8 @@ jobs:
filters: |
runtime:
- 'runtimes/**'
- 'pallet/**'
- 'crates/pallets/**'
- 'primitives/**'
- 'storage-interfaces/**/pallet-*/**'
- '**/Cargo.toml'
- 'Cargo.lock'
- '.github/workflows/check-runtime-migration.yml'
Expand Down
13 changes: 7 additions & 6 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -212,9 +212,11 @@ export function sameAddress(a, b) {

```
web3-storage/
├── pallet/ # Substrate pallet (on-chain logic - Layer 0)
│ ├── src/lib.rs # Core pallet implementation
│ └── Cargo.toml # Pallet dependencies
├── crates/
│ └── pallets/ # FRAME pallets (on-chain logic)
│ ├── storage-provider/ # Storage provider pallet (Layer 0)
│ ├── drive-registry/ # Drive Registry pallet (Layer 1 file system)
│ └── s3-registry/ # S3 Registry pallet (Layer 1 S3)
├── runtimes/ # Parachain runtimes
│ ├── web3-storage-local/ # Local testnet runtime (storage-parachain-runtime)
│ │ ├── src/lib.rs # Runtime configuration
Expand Down Expand Up @@ -242,7 +244,6 @@ web3-storage/
├── storage-interfaces/ # Layer 1 - High-level interfaces
│ └── file-system/ # File System Interface
│ ├── primitives/ # File system types (DriveInfo, CommitStrategy, etc.)
│ ├── pallet-registry/ # Drive Registry pallet (on-chain)
│ └── client/ # File System Client SDK
│ ├── src/
│ │ ├── lib.rs # Main file system client
Expand Down Expand Up @@ -275,7 +276,7 @@ web3-storage/

#### Layer 0 (Raw Storage)

**Pallet (`pallet/`)**: On-chain logic for provider registration, bucket creation, storage agreements, checkpoints, and challenge/slashing mechanism.
**Pallet (`crates/pallets/storage-provider/`)**: On-chain logic for provider registration, bucket creation, storage agreements, checkpoints, and challenge/slashing mechanism.

**Runtime (`runtimes/web3-storage-local/`)**: Parachain runtime that includes the storage provider pallet and configures its parameters (stake requirements, challenge periods, etc.).

Expand Down Expand Up @@ -304,7 +305,7 @@ web3-storage/
- `CommitStrategy`: Checkpoint strategies (Immediate, Batched, Manual)
- Helper functions for CID computation and path handling

**Drive Registry Pallet (`storage-interfaces/file-system/pallet-registry/`)**: On-chain drive management:
**Drive Registry Pallet (`crates/pallets/drive-registry/`)**: On-chain drive management:
- Drive creation with automatic infrastructure setup
- Root CID tracking for drive state
- User-to-drive mapping
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ This repository is dual-licensed. The license that applies depends on the crate:
| License | Crates |
|---------|--------|
| [GPL-3.0-only](LICENSE-GPL3) | `runtimes/`, `provider-node/`, `user-interfaces/` |
| [Apache-2.0](LICENSE-APACHE2) | `pallet/`, `primitives/`, `client/`, `precompiles/`, `storage-interfaces/` |
| [Apache-2.0](LICENSE-APACHE2) | `crates/pallets/`, `primitives/`, `client/`, `precompiles/`, `storage-interfaces/` |

Each crate declares its applicable license in its `Cargo.toml` or
`package.json`.
Expand Down
13 changes: 6 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
[workspace]
resolver = "2"
members = [
# Layer 0: Scalable Web3 Storage
"client",
"pallet",
"crates/pallets/drive-registry",
"crates/pallets/s3-registry",
"crates/pallets/storage-provider",
"primitives",
"provider-node",
"provider/negotiation",
Expand All @@ -17,12 +18,10 @@ members = [

# Storage Interfaces: File System Interface
"storage-interfaces/file-system/client",
"storage-interfaces/file-system/pallet-registry",
"storage-interfaces/file-system/primitives",

# Storage Interfaces: S3-Compatible Interface
"storage-interfaces/s3/client",
"storage-interfaces/s3/pallet-s3-registry",
"storage-interfaces/s3/primitives",
]

Expand All @@ -36,7 +35,7 @@ repository = "https://github.com/paritytech/web3-storage"
# Layer 0: Scalable Web3 Storage (Internal crates)
pallet-drive-registry-precompile = { path = "precompiles/drive-registry-precompile", default-features = false }
pallet-s3-registry-precompile = { path = "precompiles/s3-registry-precompile", default-features = false }
pallet-storage-provider = { path = "pallet", default-features = false }
pallet-storage-provider = { path = "crates/pallets/storage-provider", default-features = false }
pallet-storage-provider-precompile = { path = "precompiles/storage-provider-precompile", default-features = false }
provider-negotiation = { path = "provider/negotiation" }
storage-client = { path = "client" }
Expand All @@ -47,10 +46,10 @@ storage-provider-node = { path = "provider-node" }
# Storage Interfaces: File System Interface
file-system-client = { path = "storage-interfaces/file-system/client" }
file-system-primitives = { path = "storage-interfaces/file-system/primitives", default-features = false }
pallet-drive-registry = { path = "storage-interfaces/file-system/pallet-registry", default-features = false }
pallet-drive-registry = { path = "crates/pallets/drive-registry", default-features = false }

# Storage Interfaces: S3-Compatible Interface
pallet-s3-registry = { path = "storage-interfaces/s3/pallet-s3-registry", default-features = false }
pallet-s3-registry = { path = "crates/pallets/s3-registry", default-features = false }
s3-client = { path = "storage-interfaces/s3/client" }
s3-primitives = { path = "storage-interfaces/s3/primitives", default-features = false }

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ Two types of nodes work together:

```
scalable-web3-storage/
├── pallet/ # Substrate pallet (on-chain logic)
├── crates/pallets/ # FRAME pallets (on-chain logic)
├── runtimes/ # Parachain runtimes (web3-storage-local, web3-storage-paseo)
├── provider-node/ # Off-chain storage server (HTTP API)
├── client/ # Client SDK for applications
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions docs/design/scalable-web3-storage-implementation.md
Original file line number Diff line number Diff line change
Expand Up @@ -863,7 +863,7 @@ pub enum Event<T: Config> {
Read-only queries used by clients (the Rust SDK, demos, and the provider
node's membership cache) to discover providers, inspect bucket state, list
agreements, and watch challenges without submitting transactions. Defined in
`pallet/src/runtime_api.rs` as `StorageProviderApi`.
`crates/pallets/storage-provider/src/runtime_api.rs` as `StorageProviderApi`.

```rust
sp_api::decl_runtime_apis! {
Expand Down Expand Up @@ -912,7 +912,7 @@ sp_api::decl_runtime_apis! {
}
```

Response types live in `pallet/src/runtime_api.rs` (`ProviderInfoResponse`,
Response types live in `crates/pallets/storage-provider/src/runtime_api.rs` (`ProviderInfoResponse`,
`StorageRequirements`, `MatchedProvider`, `BucketResponse`,
`AgreementResponse`, `ChallengeResponse`, etc.). They flatten the on-chain
structs into encode/decode-friendly shapes (e.g. `AccountId` as `Vec<u8>`,
Expand Down
2 changes: 1 addition & 1 deletion docs/filesystems/ADMIN_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ let num_providers: u8 = if let Some(min) = min_providers {

```rust
// Modify thresholds in pallet code:
// storage-interfaces/file-system/pallet-registry/src/lib.rs
// crates/pallets/drive-registry/src/lib.rs

// Example: More aggressive replication
if storage_period > 500 {
Expand Down
2 changes: 1 addition & 1 deletion docs/filesystems/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ cargo run -p file-system-client --example basic_usage

## Components

- **Drive Registry pallet** (`storage-interfaces/file-system/pallet-registry/`) — on-chain drive metadata, owner mapping, root CID slot.
- **Drive Registry pallet** (`crates/pallets/drive-registry/`) — on-chain drive metadata, owner mapping, root CID slot.
- **File-system primitives** (`storage-interfaces/file-system/primitives/`) — shared types: `DriveInfo`, `DirectoryNode`, `FileManifest`, `CommitStrategy`.
- **File-system client SDK** (`storage-interfaces/file-system/client/`) — Rust client. Real chain queries via subxt; file operations via the provider's `/fs/{bucket}/...` HTTP endpoints.
- **TypeScript SDK** — `FileSystemClient` from `@web3-storage/sdk/fs` (`packages/layer1`), built on the layer-0 chain binding.
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/EXTRINSICS_REFERENCE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Storage Provider Pallet - Extrinsics Reference

Quick reference for all available extrinsics in the storage provider pallet ([pallet/src/lib.rs](../../pallet/src/lib.rs)).
Quick reference for all available extrinsics in the storage provider pallet ([crates/pallets/storage-provider/src/lib.rs](../../crates/pallets/storage-provider/src/lib.rs)).

## Provider Management

Expand Down
2 changes: 1 addition & 1 deletion licenserc.apache.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ keywords = ["SPDX-License-Identifier"]

includes = [
"client/**/*.rs",
"crates/pallets/**/*.rs",
"examples/contracts/**/*.sol",
"examples/papi/**/*.ts",
"packages/**/*.js",
"packages/**/*.ts",
"packages/**/*.tsx",
"pallet/**/*.rs",
"precompiles/**/*.rs",
"precompiles/**/*.sol",
"primitives/**/*.rs",
Expand Down
16 changes: 0 additions & 16 deletions pallet/README.md

This file was deleted.

2 changes: 1 addition & 1 deletion provider-node/src/challenge_responder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ const CHALLENGE_ENTRY_SIZE: usize = 144;
/// the decoded `provider` field matches `our_bytes`; `None` when the
/// challenge targets a different provider.
///
/// Layout of `Challenge<T>` (see `pallet/src/lib.rs`):
/// Layout of `Challenge<T>` (see `crates/pallets/storage-provider/src/lib.rs`):
/// bucket_id (u64) — 8
/// provider (AccountId32) — 32
/// challenger (AccountId32)— 32
Expand Down
2 changes: 1 addition & 1 deletion storage-interfaces/file-system/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Core data structures and types for the file system.
- CID computation and manipulation
- DAG helper functions

### `pallet-registry/`
### Drive Registry pallet (`crates/pallets/drive-registry/`)
On-chain registry pallet for drive management.

**User-Facing Extrinsics:**
Expand Down
2 changes: 1 addition & 1 deletion storage-interfaces/s3/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ This module provides an S3-compatible storage interface (Layer 1) on top of the
| Component | Path | Description |
|-----------|------|-------------|
| **s3-primitives** | `primitives/` | Core types and validation functions (no_std compatible) |
| **pallet-s3-registry** | `pallet-s3-registry/` | On-chain S3 bucket and object metadata storage |
| **pallet-s3-registry** | `../../crates/pallets/s3-registry/` | On-chain S3 bucket and object metadata storage |
| **s3-client** | `client/` | High-level SDK for S3 operations |

## Quick Start
Expand Down
2 changes: 1 addition & 1 deletion user-interfaces/shared/test-helpers/src/registration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function publicKeyHex(address: string): string {
* Storage key for `pallet_storage_provider::Providers[address]`. Layout
* is `twox128(pallet_name) ++ twox128(storage_name) ++
* blake2_128_concat(scale(account))`, matching the FRAME `StorageMap`
* with `Blake2_128Concat` hasher in `pallet/src/lib.rs`. AccountId32 is
* with `Blake2_128Concat` hasher in `crates/pallets/storage-provider/src/lib.rs`. AccountId32 is
* 32 raw bytes, so the scale encoding of the key is just those bytes.
*/
function providersStorageKey(address: string): Uint8Array {
Expand Down
Loading