Skip to content

Commit

Permalink
Add rusk::http::domain layer draft
Browse files Browse the repository at this point in the history
  • Loading branch information
welf committed Dec 30, 2024
1 parent 8e6bb49 commit 0f96141
Show file tree
Hide file tree
Showing 33 changed files with 14,481 additions and 24 deletions.
42 changes: 26 additions & 16 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
[workspace]
members = [
# Test contracts
"contracts/alice",
"contracts/bob",
"contracts/charlie",
"contracts/host_fn",
# Test contracts
"contracts/alice",
"contracts/bob",
"contracts/charlie",
"contracts/host_fn",

# Genesis contracts
"contracts/stake",
"contracts/transfer",
# Genesis contracts
"contracts/stake",
"contracts/transfer",

"core",
"vm",
"wallet-core",

"rusk-prover",
"rusk-prover",

"rusk-recovery",
"rusk-profile",
"rusk",

"node-data",
"consensus",
"node",
"rusk-wallet",
"node-data",
"consensus",
"node",
"rusk-wallet",

# Test utils
"test-wallet",
# Test utils
"test-wallet",
]
resolver = "2"

Expand Down Expand Up @@ -69,12 +69,15 @@ ark-serialize = { version = "=0.4.2", default-features = false }
async-channel = "=1.9.0"
async-graphql = "=5.0.10"
async-trait = "=0.1.83"
axum = { version = "0.7.9", features = ["ws", "http2", "macros"] }
axum-macros = "0.4.1"
base64 = "=0.22.1"
blake2b_simd = { version = "=1.0.2", default-features = false }
blake3 = { version = "=1.5.4", default-features = false }
block-modes = "=0.8.1"
bs58 = "=0.4.0"
bytecheck = { version = "=0.6.12", default-features = false }
bytes = "1.9.0"
cargo_toml = "=0.15.3"
chrono = "=0.4.38"
clap = "=4.4.18"
Expand All @@ -83,6 +86,7 @@ criterion = "=0.5.1"
crossterm = "=0.25.0"
dirs = "=4.0.0"
dlmalloc = "=0.2.6"
either = "1.13.0"
fake = "=2.9.2"
ff = { version = "=0.13.0", default-features = false }
flate2 = "=1.0.33"
Expand All @@ -103,8 +107,9 @@ lru = "=0.12.4"
memory-stats = "=1.2.0"
metrics = "=0.22.3"
metrics-exporter-prometheus = "=0.14.0"
mockall = "0.13.1"
num-bigint = { version = "=0.4.6", default-features = false }
once_cell = "=1.19.0"
once_cell = "=1.20.2"
open = "=2.1.3"
parking_lot = "=0.12.3"
pin-project = "=1.1.5"
Expand All @@ -115,6 +120,7 @@ ringbuffer = "=0.15.0"
rkyv = { version = "=0.7.39", default-features = false }
rocksdb = { version = "=0.22.0", default-features = false }
rustc_tools_util = "=0.3.0"
rustls = "0.23.20"
rustls-pemfile = "=2.1.3"
semver = "=1.0.23"
serde = "=1.0.210"
Expand All @@ -128,14 +134,18 @@ sqlx = "=0.8.2"
tar = "=0.4.42"
tempdir = "=0.3.7"
tempfile = "=3.12.0"
test-case = "3.3.1"
thiserror = "=1.0.64"
time-util = "=0.3.4"
tiny-bip39 = "=0.8.2"
tokio = "=1.40.0"
tokio-rustls = "=0.26.0"
tokio-stream = "=0.1.16"
tokio-tungstenite = "*"
tokio-util = "=0.7.12"
toml = "=0.7.8"
tower = "0.5.2"
tower-http = { version = "0.6.2", features = ["trace", "cors"] }
tracing = "=0.1.40"
tracing-subscriber = "=0.3.18"
tungstenite = "=0.21.0"
Expand Down
52 changes: 44 additions & 8 deletions rusk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,21 @@ name = "rusk"
path = "src/bin/main.rs"

[dependencies]
tokio = { workspace = true, features = ["rt-multi-thread", "fs", "macros"] }
tokio = { workspace = true, features = [
"rt-multi-thread",
"fs",
"macros",
"net",
] }
futures-util = { workspace = true }
tracing = { workspace = true }
tracing-subscriber = { workspace = true, features = [
"fmt",
"env-filter",
"json",
] }
chrono = { workspace = true, features = ["serde"] }
thiserror = { workspace = true }
clap = { workspace = true, features = ["env", "string", "derive"] }
semver = { workspace = true }
anyhow = { workspace = true }
Expand Down Expand Up @@ -78,27 +85,42 @@ reqwest = { workspace = true }
tempfile = { workspace = true, optional = true }
rusk-recovery = { workspace = true, optional = true }

## testwallet dependencies
## testwallet and http-server dependencies
futures = { workspace = true, optional = true }

## http-server dependencies
axum = { workspace = true, features = ["ws", "http2", "macros"], optional = true }
axum-macros = { workspace = true, optional = true }
bytes = { workspace = true, optional = true }
either = { workspace = true, optional = true }
mockall = { workspace = true, optional = true }
metrics = { workspace = true, optional = true }
once_cell = { workspace = true, optional = true }
rustls = { workspace = true, optional = true }
tokio-tungstenite = { workspace = true, optional = true }
tower = { workspace = true, optional = true }
tower-http = { workspace = true, features = ["trace", "cors"], optional = true }

[dev-dependencies]
test-wallet = { version = "0.1.0", path = "../test-wallet" }
rusk-recovery = { workspace = true, features = ["state"] }
ff = { workspace = true }
rusk-prover = { workspace = true, features = ["no_random", "debug"] }
criterion = { workspace = true }
test-case = { workspace = true }

[build-dependencies]
rustc_tools_util = { workspace = true }

[features]
default = [
"ephemeral",
"recovery-state",
"recovery-keys",
"prover",
"chain",
"http-wasm",
"ephemeral",
"recovery-state",
"recovery-keys",
"prover",
"chain",
"http-wasm",
"http-server",
]
ephemeral = ["dep:rusk-recovery", "dep:tempfile", "recovery-state", "chain"]
recovery-state = ["rusk-recovery/state", "dep:tempfile"]
Expand All @@ -109,6 +131,20 @@ chain = ["dep:node", "dep:dusk-consensus", "dep:node-data"]
archive = ["chain", "node/archive"]
network-trace = ["node/network-trace"]
http-wasm = []
http-server = [
"dep:axum",
"dep:axum-macros",
"dep:bytes",
"dep:either",
"dep:futures",
"dep:metrics",
"dep:mockall",
"dep:rustls",
"dep:tokio-tungstenite",
"dep:tower",
"dep:tower-http",
"dep:once_cell",
]

[[bench]]
name = "block_ingestion"
Expand Down
7 changes: 7 additions & 0 deletions rusk/src/lib/http.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,13 @@
// Copyright (c) DUSK NETWORK. All rights reserved.

#![allow(unused)]
pub mod domain;
// mod infrastructure;
// mod handlers;
// mod router;
// mod state;

// pub mod application;
#[cfg(feature = "chain")]
mod chain;
mod event;
Expand All @@ -15,6 +21,7 @@ mod prover;
mod rusk;
mod stream;

// Re-export key types
pub(crate) use event::{
BinaryWrapper, DataType, ExecutionError, MessageResponse as EventResponse,
RequestData, Target,
Expand Down
Loading

0 comments on commit 0f96141

Please sign in to comment.