diff --git a/Cargo.lock b/Cargo.lock index 59facd6..fc06252 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -877,6 +877,39 @@ dependencies = [ "percent-encoding", ] +[[package]] +name = "fridge-r0-client" +version = "0.0.32" +dependencies = [ + "anyhow", + "chrono", + "clap", + "clap-markdown", + "env_logger", + "methods", + "num-bigint 0.4.4", + "pem", + "pkcs1", + "risc0-zkvm", + "rsa", + "serde", + "serde_json", + "sha2 0.10.6", + "xmlparser", +] + +[[package]] +name = "fridge-r0-verifier" +version = "0.0.32" +dependencies = [ + "clap", + "clap-markdown", + "env_logger", + "risc0-zkvm", + "serde", + "serde_json", +] + [[package]] name = "funty" version = "2.0.0" @@ -1070,27 +1103,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "host" -version = "0.1.0" -dependencies = [ - "anyhow", - "chrono", - "clap", - "clap-markdown", - "env_logger", - "methods", - "num-bigint 0.4.4", - "pem", - "pkcs1", - "risc0-zkvm", - "rsa", - "serde", - "serde_json", - "sha2 0.10.6", - "xmlparser", -] - [[package]] name = "http" version = "0.2.12" @@ -1377,7 +1389,7 @@ dependencies = [ [[package]] name = "methods" -version = "0.1.0" +version = "0.0.32" dependencies = [ "risc0-build", "sha2 0.10.6", @@ -2659,18 +2671,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" -[[package]] -name = "verifier" -version = "0.1.0" -dependencies = [ - "clap", - "clap-markdown", - "env_logger", - "risc0-zkvm", - "serde", - "serde_json", -] - [[package]] name = "version_check" version = "0.9.4" diff --git a/Cargo.toml b/Cargo.toml index 368195d..7e7a24c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [workspace] resolver = "2" -members = ["host", "methods", "verifier"] +members = [ "./host" , "./methods", "./verifier"] # Always optimize; building and running the guest takes much longer without optimization. [profile.dev] diff --git a/cratePublish.sh b/cratePublish.sh new file mode 100755 index 0000000..235488d --- /dev/null +++ b/cratePublish.sh @@ -0,0 +1,61 @@ +#!/bin/bash +set -e + +echo "assumed that cargo login is already done" + +function check_and_print_version() { + # Get the Cargo.toml path from the function argument + cargo_toml_path="$1" + + # Check if Cargo.toml path exists + if [[ ! -f "$cargo_toml_path" ]]; then + echo "Error: Cargo.toml file not found at: $cargo_toml_path" + exit 1 + fi + + # Get the current version from cargo.toml (without "v" prefix) + current_version=$(grep -Eo 'version = \"[0-9]*\.[0-9]*\.[0-9]*\"' "$cargo_toml_path" | head -n 1 | cut -d '"' -f2) + if [[ -z "$current_version" ]]; then + echo "Error: Could not find version in $cargo_toml_path" + exit 1 + fi + + # Get the latest semantic version tag (without "v") from GitHub + latest_version=$(git tag -l --sort=-v:refname | head -n 1 | cut -d 'v' -f2) + + if [[ -z "$latest_version" ]]; then + echo "No semantic version tag starting with 'v' found!" + exit 1 + fi + + # Check for version mismatch + if [[ "$current_version" != "$latest_version" ]]; then + echo "Version mismatch!" + echo " $cargo_toml_path version: $current_version" + echo " Latest version from tags: $latest_version" + echo " Cargo.toml path: $cargo_toml_path" + + # Prompt user to update Cargo.toml version + read -p "Do you want to update the Cargo.toml version to $latest_version (y/N)? " answer + case "$answer" in + [Yy]*) + # Update Cargo.toml with the latest version (assuming you have write permissions) + sed -i "s/version = \"$current_version\"/version = \"$latest_version\"/" "$cargo_toml_path" + echo "Updated Cargo.toml version to: $latest_version" + ;; + [Nn]*) + echo "Skipping Cargo.toml version update." + ;; + *) + echo "Invalid input. Please enter 'y' or 'N'." + ;; + esac + fi +} + +echo " > publishing verifier" +check_and_print_version "./verifier/Cargo.toml" +# --dry-run +cargo publish -p fridge-r0-verifier + + diff --git a/docs/INSTRUCTIONS.md b/docs/INSTRUCTIONS.md index 8133636..ffedb20 100644 --- a/docs/INSTRUCTIONS.md +++ b/docs/INSTRUCTIONS.md @@ -63,14 +63,14 @@ Or test with docker using your local container on **Linux**: ```bash # optional, don't do this for first tests unless you know what you are doing -docker build -f DockerfileLinux. -t fridge +docker build -f DockerfileLinux . -t fridge ``` On **MacOs** use: ```bash # optional, don't do this for first tests unless you know what you are doing -docker build -f DockerfileMacOs. -t fridge +docker build -f DockerfileMacOs . -t fridge ``` Creating **MacOS image** will take several hours and is not possible on github free tier. The script `buildPublish.sh` is used for building and publishing the image from the local Mac. diff --git a/host/Cargo.toml b/host/Cargo.toml index e3c6860..7308fbf 100644 --- a/host/Cargo.toml +++ b/host/Cargo.toml @@ -1,11 +1,18 @@ [package] -name = "host" -version = "0.1.0" +name = "fridge-r0-client" +version = "0.0.32" edition = "2021" +license = "MIT" +authors = ["Walter Strametz "] +description = "Hyperfridge - a client for a proofing system for EBICS/ISO20022 (banking backend) access." + +[[bin]] +name = "host" +path = "src/main.rs" [dependencies] # from template -methods = { path = "../methods" } +methods = { path = "../methods",version = "*" } # Define the risc0-zkvm crate with features for testing only #risc0-zkvm = { version = "0.19.1", features = ["profiler", "prove", "getrandom" ] } risc0-zkvm = { workspace = true, features = [ "prove", "getrandom"] } @@ -32,6 +39,7 @@ clap-markdown = "0.1" #metal = ["risc0-zkvm/metal"] [dependencies.sha2] +version = "0.10.6" # Dummy version git = "https://github.com/risc0/RustCrypto-hashes" tag = "sha2-v0.10.6-risczero.0" diff --git a/host/README.md b/host/README.md new file mode 100644 index 0000000..3ffc48a --- /dev/null +++ b/host/README.md @@ -0,0 +1 @@ +For documentation, see [github](https://github.com/element36-io/hyperfridge-r0/). \ No newline at end of file diff --git a/host/out/IMAGE_ID.hex b/host/out/IMAGE_ID.hex index 815123b..282d733 100644 --- a/host/out/IMAGE_ID.hex +++ b/host/out/IMAGE_ID.hex @@ -1 +1 @@ -cce026d9c1a561697084188f00259cb4fdcca5602225ea49ca3dd50181e3cfc5 \ No newline at end of file +ba3c6520925632bd6cf86bdcc716caf9f1287beca042a2102ecbdd37d3d10354 \ No newline at end of file diff --git a/methods/Cargo.toml b/methods/Cargo.toml index c83f4c1..ff6fde2 100644 --- a/methods/Cargo.toml +++ b/methods/Cargo.toml @@ -1,7 +1,10 @@ [package] name = "methods" -version = "0.1.0" +version = "0.0.32" edition = "2021" +license = "MIT" +authors = ["Walter Strametz "] +description = "Proofing system for EBICS/ISO20022 (banking backend) access." [build-dependencies] risc0-build = { workspace = true } @@ -10,5 +13,6 @@ risc0-build = { workspace = true } methods = ["guest"] [dependencies.sha2] +version = "0.10.6" # Dummy version git = "https://github.com/risc0/RustCrypto-hashes" tag = "sha2-v0.10.6-risczero.0" diff --git a/methods/README.md b/methods/README.md new file mode 100644 index 0000000..3ffc48a --- /dev/null +++ b/methods/README.md @@ -0,0 +1 @@ +For documentation, see [github](https://github.com/element36-io/hyperfridge-r0/). \ No newline at end of file diff --git a/methods/guest/Cargo.lock b/methods/guest/Cargo.lock index 787fa51..1a2f09b 100644 --- a/methods/guest/Cargo.lock +++ b/methods/guest/Cargo.lock @@ -447,7 +447,7 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "hyperfridge" -version = "0.1.0" +version = "0.0.32" dependencies = [ "aes", "base64", diff --git a/methods/guest/Cargo.toml b/methods/guest/Cargo.toml index 8e9fc96..393c59b 100644 --- a/methods/guest/Cargo.toml +++ b/methods/guest/Cargo.toml @@ -1,8 +1,13 @@ [package] name = "hyperfridge" -version = "0.1.0" +version = "0.0.32" edition = "2021" +license = "MIT" +authors = ["Walter Strametz "] +description = "Hyperfridge - a prover for EBICS/ISO20022 (banking backend) access." + + [workspace] [features] diff --git a/methods/guest/README.md b/methods/guest/README.md new file mode 100644 index 0000000..3ffc48a --- /dev/null +++ b/methods/guest/README.md @@ -0,0 +1 @@ +For documentation, see [github](https://github.com/element36-io/hyperfridge-r0/). \ No newline at end of file diff --git a/verifier/Cargo.toml b/verifier/Cargo.toml index 2b878f6..279cdc8 100644 --- a/verifier/Cargo.toml +++ b/verifier/Cargo.toml @@ -1,7 +1,14 @@ [package] -name = "verifier" -version = "0.1.0" +name = "fridge-r0-verifier" +version = "0.0.32" edition = "2021" +license = "MIT" +authors = ["Walter Strametz "] +description = "Hyperfridge - the validator for proofing system for EBICS/ISO20022 (banking backend) access." + +[[bin]] +name = "verifier" +path = "src/main.rs" [dependencies] risc0-zkvm = { workspace = true } diff --git a/verifier/README.md b/verifier/README.md new file mode 100644 index 0000000..3ffc48a --- /dev/null +++ b/verifier/README.md @@ -0,0 +1 @@ +For documentation, see [github](https://github.com/element36-io/hyperfridge-r0/). \ No newline at end of file