Skip to content

Commit

Permalink
Move binary crates into a dedicated dir (dojoengine#1471)
Browse files Browse the repository at this point in the history
refactor
  • Loading branch information
kariy authored Jan 23, 2024
1 parent 30b900b commit 3620d72
Show file tree
Hide file tree
Showing 57 changed files with 160 additions and 39 deletions.
43 changes: 43 additions & 0 deletions Cargo.lock

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

42 changes: 39 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,18 @@
resolver = "2"

members = [
"bin/dojo-language-server",
"bin/katana",
"bin/sozo",
"bin/torii",
"crates/benches",
"crates/dojo-bindgen",
"crates/dojo-core",
"crates/dojo-lang",
"crates/dojo-language-server",
"crates/dojo-test-utils",
"crates/dojo-types",
"crates/dojo-world",
"crates/dojo-world/abigen",
"crates/katana",
"crates/katana/core",
"crates/katana/executor",
"crates/katana/primitives",
Expand All @@ -25,7 +27,6 @@ members = [
"crates/katana/storage/db",
"crates/katana/storage/provider",
"crates/metrics",
"crates/sozo",
"crates/sozo/signers",
"crates/torii/client",
"crates/torii/server",
Expand All @@ -47,6 +48,41 @@ inherits = "release"
lto = "fat"

[workspace.dependencies]
# metrics
metrics = { path = "crates/metrics" }

# dojo-lang
dojo-bindgen = { path = "crates/dojo-bindgen" }
dojo-core = { path = "crates/dojo-core" }
dojo-lang = { path = "crates/dojo-lang" }
dojo-test-utils = { path = "crates/dojo-test-utils" }
dojo-types = { path = "crates/dojo-types" }
dojo-world = { path = "crates/dojo-world" }

# katana
katana-codecs = { path = "crates/katana/storage/codecs" }
katana-codecs-derive = { path = "crates/katana/storage/codecs/derive" }
katana-core = { path = "crates/katana/core" }
katana-db = { path = "crates/katana/storage/db" }
katana-executor = { path = "crates/katana/executor" }
katana-primitives = { path = "crates/katana/primitives" }
katana-provider = { path = "crates/katana/storage/provider" }
katana-rpc = { path = "crates/katana/rpc/rpc" }
katana-rpc-api = { path = "crates/katana/rpc/rpc-api" }
katana-rpc-types = { path = "crates/katana/rpc/rpc-types" }
katana-rpc-types-builder = { path = "crates/katana/rpc/rpc-types-builder" }
katana-runner = { path = "crates/katana/runner" }

# torii
torii-client = { path = "crates/torii/client" }
torii-core = { path = "crates/torii/core" }
torii-graphql = { path = "crates/torii/graphql" }
torii-grpc = { path = "crates/torii/grpc" }
torii-server = { path = "crates/torii/server" }

# sozo
sozo-signers = { path = "crates/sozo/signers" }

anyhow = "1.0.75"
assert_matches = "1.5.0"
async-trait = "0.1.68"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ name = "dojo-language-server"
version.workspace = true

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[[bin]]
name = "dojo-language-server"
path = "src/bin/language_server.rs"

[dependencies]
anyhow.workspace = true
Expand All @@ -19,7 +16,7 @@ cairo-lang-starknet.workspace = true
cairo-lang-test-plugin.workspace = true
cairo-lang-utils.workspace = true
clap.workspace = true
dojo-lang = { path = "../dojo-lang" }
dojo-lang.workspace = true
log = "0.4.14"
salsa = "0.16.1"
smol_str.workspace = true
Expand Down
File renamed without changes.
10 changes: 5 additions & 5 deletions crates/katana/Cargo.toml → bin/katana/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ version.workspace = true
clap.workspace = true
clap_complete.workspace = true
console.workspace = true
katana-core = { path = "core" }
katana-primitives = { path = "primitives" }
katana-rpc = { path = "rpc/rpc" }
katana-rpc-api = { path = "rpc/rpc-api" }
metrics = { path = "../metrics" }
katana-core.workspace = true
katana-primitives.workspace = true
katana-rpc-api.workspace = true
katana-rpc.workspace = true
metrics-process.workspace = true
metrics.workspace = true
serde_json.workspace = true
starknet_api.workspace = true
tokio.workspace = true
Expand Down
File renamed without changes.
File renamed without changes.
12 changes: 6 additions & 6 deletions crates/sozo/Cargo.toml → bin/sozo/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ clap-verbosity-flag = "2.0.1"
clap.workspace = true
clap_complete.workspace = true
console.workspace = true
dojo-bindgen = { path = "../dojo-bindgen" }
dojo-lang = { path = "../dojo-lang" }
dojo-types = { path = "../dojo-types" }
dojo-world = { path = "../dojo-world", features = [ "contracts", "metadata", "migration" ] }
dojo-bindgen.workspace = true
dojo-lang.workspace = true
dojo-types.workspace = true
dojo-world = { workspace = true, features = [ "contracts", "metadata", "migration" ] }
notify = "6.0.1"
notify-debouncer-mini = "0.3.0"
scarb-ui.workspace = true
Expand All @@ -46,6 +46,6 @@ url.workspace = true

[dev-dependencies]
assert_fs = "1.0.10"
dojo-test-utils = { path = "../dojo-test-utils", features = [ "build-examples" ] }
katana-runner = { path = "../katana/runner" }
dojo-test-utils = { workspace = true, features = [ "build-examples" ] }
katana-runner.workspace = true
snapbox = "0.4.6"
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.
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.
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.
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.
53 changes: 53 additions & 0 deletions bin/torii/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
[package]
edition.workspace = true
name = "torii"
version.workspace = true

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
anyhow.workspace = true
async-trait.workspace = true
base64 = "0.21.2"
camino.workspace = true
chrono.workspace = true
clap.workspace = true
ctrlc = { version = "3.4", features = [ "termination" ] }
dojo-types.workspace = true
dojo-world.workspace = true
either = "1.9.0"
futures.workspace = true
http = "0.2.9"
http-body = "0.4.5"
hyper-reverse-proxy = { git = "https://github.com/tarrencev/hyper-reverse-proxy" }
hyper.workspace = true
indexmap = "1.9.3"
lazy_static.workspace = true
metrics-process.workspace = true
metrics.workspace = true
scarb.workspace = true
serde.workspace = true
serde_json.workspace = true
sqlx.workspace = true
starknet-crypto.workspace = true
starknet.workspace = true
tokio-stream = "0.1.11"
tokio-util = "0.7.7"
tokio.workspace = true
torii-core.workspace = true
torii-graphql.workspace = true
torii-grpc = { workspace = true, features = [ "server" ] }
torii-server.workspace = true
tower = "0.4.13"
tower-http = "0.4.4"
tracing-subscriber.workspace = true
tracing.workspace = true
url.workspace = true

[dev-dependencies]
camino.workspace = true

[features]
default = [ "jemalloc", "sqlite" ]
jemalloc = [ "metrics/jemalloc" ]
sqlite = [ "sqlx/sqlite" ]
7 changes: 7 additions & 0 deletions bin/torii/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# `dojoup`

```sh
curl -L https://install.dojoengine.org | bash
```

[Documentation](https://book.dojoengine.org/toolchain/torii/overview.html)
7 changes: 2 additions & 5 deletions crates/torii/server/src/cli.rs → bin/torii/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
//! documentation for usage details. This is **not recommended on Windows**. See [here](https://rust-lang.github.io/rfcs/1974-global-allocators.html#jemalloc)
//! for more info.

mod proxy;

use std::net::SocketAddr;
use std::str::FromStr;
use std::sync::Arc;
Expand All @@ -36,12 +34,11 @@ use torii_core::processors::store_transaction::StoreTransactionProcessor;
use torii_core::simple_broker::SimpleBroker;
use torii_core::sql::Sql;
use torii_core::types::Model;
use torii_server::proxy::Proxy;
use tracing::info;
use tracing_subscriber::{fmt, EnvFilter};
use url::Url;

use crate::proxy::Proxy;

/// Dojo World Indexer
#[derive(Parser, Debug)]
#[command(name = "torii", author, version, about, long_about = None)]
Expand Down Expand Up @@ -115,7 +112,7 @@ async fn main() -> anyhow::Result<()> {
.connect_with(options)
.await?;

sqlx::migrate!("../migrations").run(&pool).await?;
sqlx::migrate!("../../crates/torii/migrations").run(&pool).await?;

let provider: Arc<_> =
JsonRpcClient::new(HttpTransport::new(format!("http://{}", args.rpc).parse::<Url>()?))
Expand Down
2 changes: 1 addition & 1 deletion crates/benches/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ anyhow.workspace = true
futures.workspace = true
hex.workspace = true
lazy_static.workspace = true
sozo = { path = "../sozo" }
sozo = { path = "../../bin/sozo" }
starknet.workspace = true
tokio.workspace = true
9 changes: 0 additions & 9 deletions crates/katana/README.md

This file was deleted.

2 changes: 1 addition & 1 deletion crates/torii/core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ tracing.workspace = true
camino.workspace = true
dojo-test-utils = { path = "../../dojo-test-utils" }
scarb.workspace = true
sozo = { path = "../../sozo" }
sozo = { path = "../../../bin/sozo" }
2 changes: 1 addition & 1 deletion crates/torii/graphql/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,6 @@ dojo-test-utils = { path = "../../dojo-test-utils", features = [ "build-examples
dojo-world = { path = "../../dojo-world" }
scarb.workspace = true
serial_test = "2.0.0"
sozo = { path = "../../sozo" }
sozo = { path = "../../../bin/sozo" }
starknet-crypto.workspace = true
starknet.workspace = true
4 changes: 0 additions & 4 deletions crates/torii/server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,3 @@ camino.workspace = true
default = [ "jemalloc", "sqlite" ]
jemalloc = [ "metrics/jemalloc" ]
sqlite = [ "sqlx/sqlite" ]

[[bin]]
name = "torii"
path = "src/cli.rs"
1 change: 1 addition & 0 deletions crates/torii/server/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pub mod proxy;

0 comments on commit 3620d72

Please sign in to comment.