Skip to content

Commit

Permalink
Initialize katana grpc api
Browse files Browse the repository at this point in the history
  • Loading branch information
tarrencev committed Nov 12, 2024
1 parent caaf06b commit 3e33e97
Show file tree
Hide file tree
Showing 7 changed files with 751 additions and 1 deletion.
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.

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ members = [
"crates/katana/controller",
"crates/katana/core",
"crates/katana/executor",
"crates/katana/grpc",
"crates/katana/node",
"crates/katana/node-bindings",
"crates/katana/pipeline",
Expand Down Expand Up @@ -179,8 +180,8 @@ jsonrpsee = { version = "0.16.2", default-features = false }
lazy_static = "1.4.0"
log = "0.4.21"
metrics = "0.23.0"
num-traits = { version = "0.2", default-features = false }
num-bigint = "0.4.3"
num-traits = { version = "0.2", default-features = false }
once_cell = "1.0"
parking_lot = "0.12.1"
postcard = { version = "1.0.10", features = [ "use-std" ], default-features = false }
Expand Down
52 changes: 52 additions & 0 deletions crates/katana/grpc/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
[package]
edition.workspace = true
license-file.workspace = true
name = "katana-grpc"
repository.workspace = true
version.workspace = true

[dependencies]
dojo-types.workspace = true
futures-util.workspace = true
futures.workspace = true
num-traits.workspace = true
rayon.workspace = true
starknet-crypto.workspace = true
starknet.workspace = true
thiserror.workspace = true

crypto-bigint.workspace = true
serde.workspace = true
strum.workspace = true
strum_macros.workspace = true

# server
dojo-world.workspace = true
http.workspace = true
hyper.workspace = true
prost.workspace = true
rand.workspace = true
serde_json.workspace = true
sqlx.workspace = true
tokio-stream = "0.1.14"
tokio.workspace = true
tonic-reflection.workspace = true
tonic-web.workspace = true
tonic.workspace = true
tower-http.workspace = true
tower.workspace = true
tracing.workspace = true

[dev-dependencies]
cainome.workspace = true
camino.workspace = true
dojo-test-utils.workspace = true
dojo-utils.workspace = true
katana-runner.workspace = true
scarb.workspace = true
sozo-scarbext.workspace = true
tempfile.workspace = true

[build-dependencies]
tonic-build.workspace = true
wasm-tonic-build.workspace = true
19 changes: 19 additions & 0 deletions crates/katana/grpc/build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
use std::path::PathBuf;

fn main() -> Result<(), Box<dyn std::error::Error>> {
let out_dir =
PathBuf::from(std::env::var("OUT_DIR").expect("OUT_DIR environment variable not set"));
let target = std::env::var("TARGET").expect("TARGET environment variable not set");
let feature_client = std::env::var("CARGO_FEATURE_CLIENT");
let feature_server = std::env::var("CARGO_FEATURE_SERVER");

tonic_build::configure()
.build_server(feature_server.is_ok())
.build_client(feature_client.is_ok())
.file_descriptor_set_path(out_dir.join("starknet_descriptor.bin"))
.compile(&["proto/starknet.proto"], &["proto"])?;

println!("cargo:rerun-if-changed=proto");

Ok(())
}
Loading

0 comments on commit 3e33e97

Please sign in to comment.