diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml new file mode 100644 index 0000000000..4cdacb670c --- /dev/null +++ b/.github/workflows/deploy-docs.yml @@ -0,0 +1,29 @@ +name: Deploy to GitHub Pages + +on: + push: + +jobs: + deploy: + runs-on: ubuntu-latest + + steps: + # Step 1: Checkout repository + - name: Checkout code + uses: actions/checkout@v3 + + # Step 2: Set up Node.js environment (if using Node.js) + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: 16 # Replace with your project's Node.js version + + - name: Build project + run: cd docs && bash generatedocs.sh # Adjust based on your project's build command + + # Step 4: Deploy to GitHub Pages + - name: Deploy to GitHub Pages + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./docs # Replace with your build output directory diff --git a/.gitignore b/.gitignore index d36895b670..9f7ad616e5 100644 --- a/.gitignore +++ b/.gitignore @@ -43,4 +43,8 @@ dist packages/host-node/fixtures/*.data.json # rust build -target \ No newline at end of file +target + +# generated docs +docs/packages +docs/index.* \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock index 564fe4ca4d..e93470e439 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3522,6 +3522,16 @@ version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f38d5652c16fde515bb1ecef450ab0f6a219d619a7274976324d5e377f7dceba" +[[package]] +name = "parking_lot" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" +dependencies = [ + "lock_api", + "parking_lot_core", +] + [[package]] name = "parking_lot_core" version = "0.9.10" @@ -4796,6 +4806,15 @@ version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" +[[package]] +name = "signal-hook-registry" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" +dependencies = [ + "libc", +] + [[package]] name = "signature" version = "2.2.0" @@ -5260,7 +5279,9 @@ dependencies = [ "bytes", "libc", "mio", + "parking_lot", "pin-project-lite", + "signal-hook-registry", "socket2", "tokio-macros", "windows-sys 0.52.0", diff --git a/docs/base.html b/docs/base.html new file mode 100644 index 0000000000..dc4ee216c2 --- /dev/null +++ b/docs/base.html @@ -0,0 +1,204 @@ + + + + + + + Usherlabs Docs + + + + + + + + + +
+ + +
+
+ +

+ Usher Labs +

+
+
+ + +
+ + + + + +

Packages

+ + +
+ + + +
+ + + + + + + \ No newline at end of file diff --git a/docs/generatedocs.sh b/docs/generatedocs.sh new file mode 100644 index 0000000000..c9bb40e131 --- /dev/null +++ b/docs/generatedocs.sh @@ -0,0 +1,68 @@ +#!/bin/bash +# run this command to generate docs `bash generatedocs.sh` + +# Create an array of destinations we want to generate docs for +projects_dirs=( + "../ic/libraries" + "../rs/verity-client" + "../rs/local-verify" + "../rs/remote-verify" + "../rs/verity-client" + "../zk/guest" + "../zk/host" +) + +# The template for the list +item_html_template=' +
  • + + name_placeholder + description_placeholder + +
  • +' + +# The filled template +package_list_html='' + +for current_dir in ${projects_dirs[@]}; do + # Obtain the Cargo.toml file to the current_directory in the integration + manifest_path="$current_dir/Cargo.toml" + + # Use grep and sed to extract the value of the name, description and version of the package + package_name=$(grep -oP '^name\s*=\s*"\K[^"]+' "$manifest_path") + package_description=$(grep -oP '^description\s*=\s*"\K[^"]+' "$manifest_path") + package_version=$(grep -oP '^version\s*=\s*"\K[^"]+' "../Cargo.toml") + + package_name_and_version="$package_name-$package_version" + underscore_package_name=${package_name//-/_} + + # Obtain the target_directory where the docs will be saved based on the package name + target_dir="./packages/$package_name" + + # Run the command to generate the docs + cargo doc --manifest-path "$manifest_path" --target-dir "$target_dir" + + path_to_docs=("./packages/$package_name/doc/$underscore_package_name/index.html") + + # Replace name and description placeholders in the template + processed_html=$(echo "$item_html_template" | sed -e "s|name_placeholder|$package_name_and_version|g" -e "s|description_placeholder|$package_description|g" -e "s|package_path_placeholder|$path_to_docs|g") + + # Append the processed HTML to the final string + package_list_html+="$processed_html" + +done + +input_file_path="./base.html" +output_file_path="./index.html" + +input_file=$(cat $input_file_path) + +# Split the content into parts using 'packages_list' as the delimiter +before_placeholder=${input_file%%packages_list*} +after_placeholder=${input_file#*packages_list} + +full_html="$before_placeholder $package_list_html $after_placeholder" + +# echo "Replaced 'packages_list' with the content of 'list_items' in $input_file_path." +echo $full_html >$output_file_path diff --git a/ic/canisters/asset_manager/Cargo.lock b/ic/canisters/asset_manager/Cargo.lock index 49ff7f2155..cfb7442034 100644 --- a/ic/canisters/asset_manager/Cargo.lock +++ b/ic/canisters/asset_manager/Cargo.lock @@ -198,8 +198,8 @@ name = "ccamp-data-collection" version = "0.1.0" dependencies = [ "candid", - "ic-cdk", - "ic-cdk-timers", + "ic-cdk 0.16.0", + "ic-cdk-timers 0.10.0", "verity-dp-ic", ] @@ -208,8 +208,8 @@ name = "ccamp-protocol-data-collection" version = "0.1.0" dependencies = [ "candid", - "ic-cdk", - "ic-cdk-timers", + "ic-cdk 0.16.0", + "ic-cdk-timers 0.10.0", "serde", "serde_derive", "serde_json", @@ -222,8 +222,8 @@ name = "ccamp-remittance" version = "0.1.0" dependencies = [ "candid", - "ic-cdk", - "ic-cdk-timers", + "ic-cdk 0.16.0", + "ic-cdk-timers 0.10.0", "verity-dp-ic", ] @@ -606,7 +606,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd8ecacd682fa05a985253592963306cb9799622d7b1cce4b1edb89c6ec85be1" dependencies = [ "candid", - "ic-cdk-macros", + "ic-cdk-macros 0.16.0", + "ic0", + "serde", + "serde_bytes", +] + +[[package]] +name = "ic-cdk" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2abdf9341da9f9f6b451a40609cb69645a05a8e9eb7784c16209f16f2c0f76f" +dependencies = [ + "candid", + "ic-cdk-macros 0.17.0", "ic0", "serde", "serde_bytes", @@ -626,6 +639,20 @@ dependencies = [ "syn 2.0.90", ] +[[package]] +name = "ic-cdk-macros" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8df41980e95dead28735ab0f748c75477b0c5eab37a09a5641c78ec406a1db0" +dependencies = [ + "candid", + "proc-macro2", + "quote", + "serde", + "serde_tokenstream", + "syn 2.0.90", +] + [[package]] name = "ic-cdk-timers" version = "0.10.0" @@ -633,7 +660,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c7c528bbb3d4d934b43a364855995d318649217c7510f40f92ad52eba3ff7be" dependencies = [ "futures", - "ic-cdk", + "ic-cdk 0.16.0", + "ic0", + "serde", + "serde_bytes", + "slotmap", +] + +[[package]] +name = "ic-cdk-timers" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb8fd812a9e26f6aa00594546f8fbf4d4853f39c3ba794c8ff11ecf86fd3c9e4" +dependencies = [ + "futures", + "ic-cdk 0.17.0", "ic0", "serde", "serde_bytes", @@ -1365,15 +1406,12 @@ dependencies = [ "eth-encode-packed", "getrandom", "hex", - "ic-cdk", - "ic-cdk-timers", + "ic-cdk 0.17.0", + "ic-cdk-timers 0.11.0", "libsecp256k1", "rand", "serde", - "serde_derive", "serde_json", - "sha3 0.10.8", - "solabi", ] [[package]] diff --git a/rs/verity-client/Cargo.toml b/rs/verity-client/Cargo.toml index e14223115c..98a3c8f963 100644 --- a/rs/verity-client/Cargo.toml +++ b/rs/verity-client/Cargo.toml @@ -15,7 +15,7 @@ http = { workspace = true } reqwest = { workspace = true, features = ["json"] } reqwest-eventsource = { workspace = true } serde = { workspace = true, features = ["derive"] } -tokio = { workspace = true } +tokio = { workspace = true, features = ["full"] } tokio-util = { workspace = true } tracing = { workspace = true } uuid = { workspace = true, features = ["v4"] }