From 3189a73137bb9ca53175d9abddbfbe80c78a383c Mon Sep 17 00:00:00 2001 From: G8XSU <3442979+G8XSU@users.noreply.github.com> Date: Fri, 14 Mar 2025 10:12:57 -0700 Subject: [PATCH 1/2] Add README for Rust-based VSS implementation. --- rust/README.md | 41 +++++++++++++++++++++++++++++++++++++++-- 1 file changed, 39 insertions(+), 2 deletions(-) diff --git a/rust/README.md b/rust/README.md index 03d99ca..8e3fa9e 100644 --- a/rust/README.md +++ b/rust/README.md @@ -1,2 +1,39 @@ -## WIP -Not ready for use !! \ No newline at end of file +# Versioned Storage Service (Rust) + +This directory hosts the Rust-based implementation of the Versioned Storage Service (VSS). + +### Prerequisites + +- Install Rust and Cargo (https://www.rust-lang.org/tools/install). +- Install PostgreSQL 15 (https://www.postgresql.org/download/) + +### Building + +``` +git clone https://github.com/lightningdevkit/vss-server.git +cd vss-server/rust + +cargo build --release +``` + +### Running +1. **Edit Configuration**: Modify `./vss_server_config.toml` to set application configuration and + environment variables as needed. Add PostgreSQL endpoint configuration. +2. Create table in PostgreSQL using `./impls/src/postgres/sql/` +3. Start server: + ``` + cargo run -- vss-server-config.toml + ``` +3. VSS endpoint should be reachable at `http://localhost:8080/vss`. + +### Configuration + +Refer `./vss_server_config.toml` to see available configuration options. + +### Support + +If you encounter any issues or have questions, feel free to open an issue on +the [GitHub repository](https://github.com/lightningdevkit/vss-server/issues). For further assistance or to discuss the +development of VSS, you can reach out to us in the [LDK Discord](https://discord.gg/5AcknnMfBw) in the `#vss` channel. + +[LDK Discord]: https://discord.gg/5AcknnMfBw From ab5d53ad1ce17b6e067b73db6005ad2a542329f6 Mon Sep 17 00:00:00 2001 From: G8XSU <3442979+G8XSU@users.noreply.github.com> Date: Fri, 14 Mar 2025 12:31:23 -0700 Subject: [PATCH 2/2] Commit SQLs to file for vss-rust. --- rust/impls/src/postgres/sql/v0_create_vss_db.sql | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 rust/impls/src/postgres/sql/v0_create_vss_db.sql diff --git a/rust/impls/src/postgres/sql/v0_create_vss_db.sql b/rust/impls/src/postgres/sql/v0_create_vss_db.sql new file mode 100644 index 0000000..8d91c25 --- /dev/null +++ b/rust/impls/src/postgres/sql/v0_create_vss_db.sql @@ -0,0 +1,10 @@ +CREATE TABLE vss_db ( + user_token character varying(120) NOT NULL CHECK (user_token <> ''), + store_id character varying(120) NOT NULL CHECK (store_id <> ''), + key character varying(600) NOT NULL, + value bytea NULL, + version bigint NOT NULL, + created_at TIMESTAMP WITH TIME ZONE, + last_updated_at TIMESTAMP WITH TIME ZONE, + PRIMARY KEY (user_token, store_id, key) +);