diff --git a/Cargo.toml b/Cargo.toml index fc393bb..6bf82c5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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" } diff --git a/sdk/Cargo.toml b/sdk/Cargo.toml new file mode 100644 index 0000000..a2646e2 --- /dev/null +++ b/sdk/Cargo.toml @@ -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" } diff --git a/build.rs b/sdk/build.rs similarity index 100% rename from build.rs rename to sdk/build.rs diff --git a/proto/ingest.proto b/sdk/proto/ingest.proto similarity index 100% rename from proto/ingest.proto rename to sdk/proto/ingest.proto diff --git a/proto/prover.proto b/sdk/proto/prover.proto similarity index 100% rename from proto/prover.proto rename to sdk/proto/prover.proto diff --git a/src/README.md b/sdk/src/README.md similarity index 100% rename from src/README.md rename to sdk/src/README.md diff --git a/src/args.rs b/sdk/src/args.rs similarity index 100% rename from src/args.rs rename to sdk/src/args.rs diff --git a/src/auth.rs b/sdk/src/auth.rs similarity index 100% rename from src/auth.rs rename to sdk/src/auth.rs diff --git a/src/lib.rs b/sdk/src/lib.rs similarity index 89% rename from src/lib.rs rename to sdk/src/lib.rs index 2a74fb7..8acf537 100644 --- a/src/lib.rs +++ b/sdk/src/lib.rs @@ -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"); @@ -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 { diff --git a/src/main.rs b/sdk/src/main.rs similarity index 100% rename from src/main.rs rename to sdk/src/main.rs diff --git a/src/substrate.rs b/sdk/src/substrate.rs similarity index 100% rename from src/substrate.rs rename to sdk/src/substrate.rs diff --git a/src/sxt_chain_runtime.rs b/sdk/src/sxt_chain_runtime.rs similarity index 100% rename from src/sxt_chain_runtime.rs rename to sdk/src/sxt_chain_runtime.rs