Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Web3review v2 #15

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 34 additions & 34 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -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]
Expand Down
61 changes: 61 additions & 0 deletions cratePublish.sh
Original file line number Diff line number Diff line change
@@ -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


4 changes: 2 additions & 2 deletions docs/INSTRUCTIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
14 changes: 11 additions & 3 deletions host/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>"]
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"] }
Expand All @@ -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"

1 change: 1 addition & 0 deletions host/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
For documentation, see [github](https://github.com/element36-io/hyperfridge-r0/).
2 changes: 1 addition & 1 deletion host/out/IMAGE_ID.hex
Original file line number Diff line number Diff line change
@@ -1 +1 @@
cce026d9c1a561697084188f00259cb4fdcca5602225ea49ca3dd50181e3cfc5
ba3c6520925632bd6cf86bdcc716caf9f1287beca042a2102ecbdd37d3d10354
6 changes: 5 additions & 1 deletion methods/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
[package]
name = "methods"
version = "0.1.0"
version = "0.0.32"
edition = "2021"
license = "MIT"
authors = ["Walter Strametz <[email protected]>"]
description = "Proofing system for EBICS/ISO20022 (banking backend) access."

[build-dependencies]
risc0-build = { workspace = true }
Expand All @@ -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"
1 change: 1 addition & 0 deletions methods/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
For documentation, see [github](https://github.com/element36-io/hyperfridge-r0/).
2 changes: 1 addition & 1 deletion methods/guest/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion methods/guest/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
[package]
name = "hyperfridge"
version = "0.1.0"
version = "0.0.32"
edition = "2021"

license = "MIT"
authors = ["Walter Strametz <[email protected]>"]
description = "Hyperfridge - a prover for EBICS/ISO20022 (banking backend) access."


[workspace]

[features]
Expand Down
1 change: 1 addition & 0 deletions methods/guest/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
For documentation, see [github](https://github.com/element36-io/hyperfridge-r0/).
11 changes: 9 additions & 2 deletions verifier/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>"]
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 }
Expand Down
1 change: 1 addition & 0 deletions verifier/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
For documentation, see [github](https://github.com/element36-io/hyperfridge-r0/).
Loading