Skip to content

Commit

Permalink
Merge pull request #325 from dashpay/develop
Browse files Browse the repository at this point in the history
1.0.0
  • Loading branch information
QuantumExplorer authored Jul 28, 2024
2 parents d4e550d + f028ddb commit a3575f8
Show file tree
Hide file tree
Showing 19 changed files with 539 additions and 109 deletions.
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -237,10 +237,6 @@ From here we can build:
There is a work in progress implementation of a debugger layer for GroveDB. To use this library with
these capabilities enabled one needs to set a dependency with `grovedbg` feature.

At build time this requires two environment dependencies:
1. `wasm32-unknown-unknown` Rust toolchain;
2. [trunk](https://trunkrs.dev/) utility.

Then, to launch visualizer tool to observe the database structure inside of your browser on a port,
let's say 10000, the following snippet should do:

Expand Down
2 changes: 1 addition & 1 deletion costs/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "grovedb-costs"
version = "1.0.0-rc.2"
version = "1.0.0"
edition = "2021"
license = "MIT"
description = "Costs extension crate for GroveDB"
Expand Down
6 changes: 3 additions & 3 deletions grovedb-version/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
name = "grovedb-version"
authors = ["Samuel Westrich <[email protected]>"]
description = "Versioning library for Platform"
version = "1.0.0-rc.2"
version = "1.0.0"
edition = "2021"
license = "MIT"

[dependencies]
thiserror = { version = "1.0.59" }
versioned-feature-core = { git = "https://github.com/dashpay/versioned-feature-core", version = "1.0.0" }
thiserror = "1.0.59"
versioned-feature-core = "1.0.0"

[features]
mock-versions = []
26 changes: 14 additions & 12 deletions grovedb/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "grovedb"
description = "Fully featured database using balanced hierarchical authenticated data structures"
version = "1.0.0-rc.2"
version = "1.0.0"
authors = ["Samuel Westrich <[email protected]>", "Wisdom Ogwu <[email protected]", "Evgeny Fomin <[email protected]>"]
edition = "2021"
license = "MIT"
Expand All @@ -11,29 +11,29 @@ readme = "../README.md"
documentation = "https://docs.rs/grovedb"

[dependencies]
grovedb-merk = { version = "1.0.0-rc.2", path = "../merk", optional = true, default-features = false }
grovedb-merk = { version = "1.0.0", path = "../merk", optional = true, default-features = false }
thiserror = { version = "1.0.59", optional = true }
tempfile = { version = "3.10.1", optional = true }
bincode = { version = "2.0.0-rc.3" }
grovedb-storage = { version = "1.0.0-rc.2", path = "../storage", optional = true }
grovedb-visualize = { version = "1.0.0-rc.2", path = "../visualize", optional = true }
hex = { version = "0.4.3"}
grovedb-storage = { version = "1.0.0", path = "../storage", optional = true }
grovedb-visualize = { version = "1.0.0", path = "../visualize", optional = true }
hex = "0.4.3"
itertools = { version = "0.12.1", optional = true }
derive_more = { version = "0.99.18" }
derive_more = "0.99.18"
integer-encoding = { version = "4.0.0", optional = true }
grovedb-costs = { version = "1.0.0-rc.2", path = "../costs", optional = true }
grovedb-costs = { version = "1.0.0", path = "../costs", optional = true }
nohash-hasher = { version = "0.2.0", optional = true }
indexmap = { version = "2.2.6"}
indexmap = "2.2.6"
intmap = { version = "2.0.0", optional = true }
grovedb-path = { version = "1.0.0-rc.2", path = "../path" }
grovedbg-types = { version = "1.0.0-rc.2", path = "../grovedbg-types", optional = true }
grovedb-path = { version = "1.0.0", path = "../path" }
grovedbg-types = { version = "1.0.0", path = "../grovedbg-types", optional = true }
tokio = { version = "1.37.0", features = ["rt-multi-thread", "net"], optional = true }
axum = { version = "0.7.5", features = ["macros"], optional = true }
tower-http = { version = "0.5.2", features = ["fs"], optional = true }
blake3 = "1.4.0"
bitvec = "1"
zip-extensions = { version ="0.6.2", optional = true }
grovedb-version = { version = "1.0.0-rc.2", path = "../grovedb-version" }
grovedb-version = { path = "../grovedb-version", version = "1.0.0" }

[dev-dependencies]
rand = "0.8.5"
Expand Down Expand Up @@ -82,4 +82,6 @@ grovedbg = [
]

[build-dependencies]
zip-extensions = "0.6.2"
hex-literal = "0.4.1"
reqwest = { version = "0.12.5", features = ["blocking"] }
sha2 = "0.10.8"
49 changes: 23 additions & 26 deletions grovedb/build.rs
Original file line number Diff line number Diff line change
@@ -1,36 +1,33 @@
#[cfg(feature = "grovedbg")]
fn main() {
use std::{
env,
path::PathBuf,
process::{Command, ExitStatus, Output},
};
use std::{env, fs::File, io::Cursor, path::PathBuf};

use hex_literal::hex;
use sha2::{digest::FixedOutput, Digest, Sha256};

const GROVEDBG_SHA256: [u8; 32] =
hex!("c6636f10b43c703128b621a7c4b94139a1a7d0a603e26fca1771734a7994bb7c");
const GROVEDBG_VERSION: &str = "v1.0.0-rc.5";

let out_dir = PathBuf::from(&env::var_os("OUT_DIR").unwrap());
let grovedbg_zip_path = out_dir.join("grovedbg.zip");

if !grovedbg_zip_path.exists() {
let response = reqwest::blocking::get(format!("https://github.com/dashpay/grovedbg/releases/download/{GROVEDBG_VERSION}/grovedbg-{GROVEDBG_VERSION}.zip"))
.expect("can't download GroveDBG artifact");

let Output {
status,
stdout,
stderr,
} = Command::new("trunk")
.arg("build")
.arg("--release")
.arg("--dist")
.arg(&out_dir)
.arg("grovedbg/index.html")
.output()
.expect("cannot start trunk process");

if !status.success() {
let stdout_msg = String::from_utf8_lossy(&stdout);
let stderr_msg = String::from_utf8_lossy(&stderr);
let bindgen_version = env::var_os("TRUNK_TOOLS_WASM_BINDGEN").unwrap_or_default();
panic!("Error running `trunk build --release`\nbindgen version:{bindgen_version:?}\n{stdout_msg}\n{stderr_msg}");
let mut grovedbg_zip = File::create(&grovedbg_zip_path).unwrap();
let mut content = Cursor::new(response.bytes().unwrap());
std::io::copy(&mut content, &mut grovedbg_zip).unwrap();
}

let zip_file = out_dir.join("grovedbg.zip");
zip_extensions::write::zip_create_from_directory(&zip_file, &out_dir)
.expect("can't create a grovedbg zip archive");
let mut grovedbg_zip = File::open(&grovedbg_zip_path).unwrap();

let mut sha256 = Sha256::new();
std::io::copy(&mut grovedbg_zip, &mut sha256).unwrap();
let hash = sha256.finalize_fixed();

assert_eq!(hash.as_slice(), GROVEDBG_SHA256);
}

#[cfg(not(feature = "grovedbg"))]
Expand Down
1 change: 0 additions & 1 deletion grovedb/grovedbg
Submodule grovedbg deleted from 954be7
Loading

0 comments on commit a3575f8

Please sign in to comment.