Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
c2909d3
delete some stuff
elfedy Nov 24, 2025
f93583a
Add server skeleton
elfedy Nov 26, 2025
a72722f
Spawn node if it is an MSP
elfedy Nov 26, 2025
73832bf
Backend to server request template
elfedy Nov 27, 2025
c00c865
Fix some chunk parsing errors
elfedy Nov 27, 2025
afd9c0a
Improve handling of last chunk
elfedy Nov 27, 2025
0e326bd
Stream chunks instead of putting them all in a buffer
elfedy Nov 27, 2025
4dd3570
rm comments
elfedy Nov 28, 2025
81dd9f1
Add access to blockchain and file transfer handles
elfedy Nov 28, 2025
91201a7
Handle file completed flow
elfedy Nov 28, 2025
66ff36a
testing wip
elfedy Dec 1, 2025
ea9af30
fix param format
elfedy Dec 1, 2025
538d2fe
cherry pick log extraction
elfedy Dec 2, 2025
0c8cbbc
Fix docker network and buffer overflow
elfedy Dec 2, 2025
c9ee880
Remove uneccesary logging
elfedy Dec 2, 2025
40f7a1c
Remove receiveChunkFromBackend related endpoints
elfedy Dec 2, 2025
e880815
msp internal file transfer <> trusted file transfer
elfedy Dec 2, 2025
6928dd5
Clean up cli options
elfedy Dec 2, 2025
7e78434
Remove chunk count header
elfedy Dec 3, 2025
8f4f704
Single source of truth for encoding logic
elfedy Dec 3, 2025
ddcca6a
Add panic guard
elfedy Dec 3, 2025
eef8233
Rename constant and use it properly
elfedy Dec 3, 2025
61876ae
Merge branch 'main' into feat/backend-full-upload
elfedy Dec 3, 2025
d09187a
testing wip
elfedy Dec 4, 2025
4c40886
rm logs
elfedy Dec 4, 2025
c8e293c
pin home to 0.5.11
elfedy Dec 4, 2025
77d9c30
finish unit tests
elfedy Dec 4, 2025
160c1a4
Better comments/naming
elfedy Dec 4, 2025
38ba3e3
cargo fmt
elfedy Dec 4, 2025
4c19e60
biome fmt
elfedy Dec 4, 2025
6e78841
rm unused constant
elfedy Dec 4, 2025
439ec83
Rm mocked upload file test
elfedy Dec 4, 2025
2bc8205
Try fixing Cargo.lock
elfedy Dec 4, 2025
5ff6d94
Merge branch 'main' into feat/backend-full-upload
elfedy Dec 4, 2025
b0b5d8e
Move encoding/decoding outside of shc-client
elfedy Dec 5, 2025
be53f19
Move import up
elfedy Dec 5, 2025
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
5 changes: 5 additions & 0 deletions Cargo.lock

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

8 changes: 8 additions & 0 deletions backend/bin/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ struct Args {
/// Override MSP callback URL
#[arg(long)]
msp_callback_url: Option<String>,

/// Override MSP trusted file transfer server URL
#[arg(long)]
msp_trusted_file_transfer_server_url: Option<String>,
}

#[tokio::main]
Expand All @@ -75,6 +79,7 @@ async fn main() -> Result<()> {
debug!(target: "main", database_url = %config.database.url, "Database configuration");
debug!(target: "main", rpc_url = %config.storage_hub.rpc_url, "RPC configuration");
debug!(target: "main", msp_callback_url = %config.msp.callback_url, "MSP callback configuration");
debug!(target: "main", msp_trusted_file_transfer_server_url = %config.msp.trusted_file_transfer_server_url, "MSP trusted file transfer server configuration");

let memory_storage = InMemoryStorage::new();
let storage = Arc::new(BoxedStorageWrapper::new(memory_storage));
Expand Down Expand Up @@ -137,6 +142,9 @@ fn load_config() -> Result<Config> {
if let Some(msp_callback_url) = args.msp_callback_url {
config.msp.callback_url = msp_callback_url;
}
if let Some(msp_trusted_file_transfer_server_url) = args.msp_trusted_file_transfer_server_url {
config.msp.trusted_file_transfer_server_url = msp_trusted_file_transfer_server_url;
}

Ok(config)
}
Expand Down
1 change: 1 addition & 0 deletions backend/lib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ axum-extra = { workspace = true }
axum-jwt = { workspace = true }
base64 = { workspace = true }
bigdecimal = { workspace = true }
bytes = "1.9"
chrono = { workspace = true, features = ["serde"] }
diesel = { workspace = true }
diesel-async = { workspace = true }
Expand Down
9 changes: 7 additions & 2 deletions backend/lib/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ use crate::constants::{
database::DEFAULT_DATABASE_URL,
download::MAX_DOWNLOAD_SESSIONS,
rpc::{
DEFAULT_MAX_CONCURRENT_REQUESTS, DEFAULT_MSP_CALLBACK_URL, DEFAULT_RPC_URL,
DEFAULT_TIMEOUT_SECS, DEFAULT_UPLOAD_RETRY_ATTEMPTS, DEFAULT_UPLOAD_RETRY_DELAY_SECS,
DEFAULT_MAX_CONCURRENT_REQUESTS, DEFAULT_MSP_CALLBACK_URL,
DEFAULT_MSP_TRUSTED_FILE_TRANSFER_SERVER_URL, DEFAULT_RPC_URL, DEFAULT_TIMEOUT_SECS,
DEFAULT_UPLOAD_RETRY_ATTEMPTS, DEFAULT_UPLOAD_RETRY_DELAY_SECS,
},
server::{DEFAULT_HOST, DEFAULT_PORT},
upload::MAX_UPLOAD_SESSIONS,
Expand Down Expand Up @@ -193,6 +194,8 @@ pub struct StorageHubConfig {
pub struct MspConfig {
/// URL for the node to reach the MSP backend
pub callback_url: String,
/// URL for the MSP trusted file transfer server
pub trusted_file_transfer_server_url: String,
/// Number of retry attempts for file upload operations
pub upload_retry_attempts: u32,
/// Delay in seconds between file upload retry attempts
Expand Down Expand Up @@ -244,6 +247,8 @@ impl Default for Config {
},
msp: MspConfig {
callback_url: DEFAULT_MSP_CALLBACK_URL.to_string(),
trusted_file_transfer_server_url: DEFAULT_MSP_TRUSTED_FILE_TRANSFER_SERVER_URL
.to_string(),
upload_retry_attempts: DEFAULT_UPLOAD_RETRY_ATTEMPTS,
upload_retry_delay_secs: DEFAULT_UPLOAD_RETRY_DELAY_SECS,
},
Expand Down
3 changes: 3 additions & 0 deletions backend/lib/src/constants/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ pub mod rpc {
/// Default MSP callback URL
pub const DEFAULT_MSP_CALLBACK_URL: &str = "http://localhost:8080";

/// Default URL for the MSP trusted file transfer server
pub const DEFAULT_MSP_TRUSTED_FILE_TRANSFER_SERVER_URL: &str = "http://localhost:7070";

/// Timeout multiplier for simulating network delays in mocks
pub const TIMEOUT_MULTIPLIER: u64 = 10;

Expand Down
Loading
Loading