Skip to content

Commit

Permalink
feat: make repo a cargo workspace with an sdk member
Browse files Browse the repository at this point in the history
  • Loading branch information
tlovell-sxt committed Oct 28, 2024
1 parent 42560ff commit b4e8e0c
Show file tree
Hide file tree
Showing 12 changed files with 44 additions and 23 deletions.
22 changes: 6 additions & 16 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,30 +1,20 @@
[package]
name = "sxt-proof-of-sql-sdk"
version = "0.1.0"
edition = "2021"
[workspace]
members = ["./scripts/count-ethereum-core", "sdk"]

[dependencies]
[workspace.dependencies]
ark-serialize = { version = "0.4.0", default-features = false }
clap = { version = "4.5.20", features = ["derive", "env"] }
dotenv = "0.15"
flexbuffers = { version = "2.0.0" }
futures = { version = "0.3.31"}
postcard = { version = "1.0.10", default-features = false }
proof-of-sql = { version = "0.33.15" }
proof-of-sql-parser = { version = "0.33.15" }
proof-of-sql = { version = "0.34.1" }
proof-of-sql-parser = { version = "0.34.1" }
prost = "0.12"
reqwest = { version = "0.12", features = ["json"] }
serde = { version = "1.0", features = ["serde_derive"] }
serde_json = "1.0"
subxt = "0.37.0"
sxt-proof-of-sql-sdk = { path = "sdk" }
tokio = { version = "1.0", features = ["rt-multi-thread", "macros"] }
tonic = { version = "0.11", features = ["tls", "tls-roots"] }

[dev-dependencies]
log = "0.4.22"
indexmap = "2.6.0"
futures = "0.3.31"

[build-dependencies]
prost-build = "0.12"
tonic-build = { version = "0.11" }
26 changes: 26 additions & 0 deletions sdk/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[package]
name = "sxt-proof-of-sql-sdk"
version = "0.1.0"
edition = "2021"

[dependencies]
ark-serialize.workspace = true
clap.workspace = true
dotenv.workspace = true
flexbuffers.workspace = true
futures.workspace = true
postcard.workspace = true
proof-of-sql-parser.workspace = true
prost.workspace = true
reqwest.workspace = true
serde.workspace = true
serde_json.workspace = true
subxt.workspace = true
tokio.workspace = true
tonic.workspace = true
proof-of-sql.workspace = true


[build-dependencies]
prost-build = "0.12"
tonic-build = { version = "0.11" }
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
19 changes: 12 additions & 7 deletions src/lib.rs → sdk/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,20 @@ mod auth;
mod substrate;
mod sxt_chain_runtime;

use proof_of_sql::{
base::database::{OwnedTable, TableRef},
proof_primitive::dory::{
DoryScalar, DynamicDoryCommitment, DynamicDoryEvaluationProof, VerifierSetup,
},
sql::{parse::QueryExpr, proof::VerifiableQueryResult},
use std::collections::HashMap;
use std::path::Path;

use proof_of_sql::base::database::{OwnedTable, TableRef};
use proof_of_sql::proof_primitive::dory::{
DoryScalar,
DynamicDoryCommitment,
DynamicDoryEvaluationProof,
VerifierSetup,
};
use proof_of_sql::sql::parse::QueryExpr;
use proof_of_sql::sql::proof::VerifiableQueryResult;
use prover::{ProverContextRange, ProverQuery, ProverResponse};
use reqwest::Client;
use std::{collections::HashMap, path::Path};

mod prover {
tonic::include_proto!("sxt.core");
Expand Down Expand Up @@ -42,6 +46,7 @@ pub async fn query_and_verify(
// Send the query to the prover
let mut query_context = HashMap::new();
let commitment_range = accessor[&table_ref].range();

query_context.insert(
table_ref.to_string().to_uppercase(),
ProverContextRange {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit b4e8e0c

Please sign in to comment.