Skip to content

Commit 25b1ae6

Browse files
authored
Merge pull request #127 from iotaledger/feat/add-real-world-examples
feat: add real-world examples on how to use the hierarchies
2 parents 4e034da + ffeb2d7 commit 25b1ae6

File tree

27 files changed

+3241
-46
lines changed

27 files changed

+3241
-46
lines changed

.github/workflows/shared-build-wasm.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ jobs:
5858
- name: Install wasm-bindgen-cli
5959
uses: jetli/wasm-bindgen-action@24ba6f9fff570246106ac3f80f35185600c3f6c9
6060
with:
61-
version: "0.2.101"
61+
version: "0.2.102"
6262

6363
- name: Setup sccache
6464
uses: "./.github/actions/rust/sccache/setup"

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ repository = "https://github.com/iotaledger/hierarchies"
1515
anyhow = "1.0"
1616
async-trait = "0.1"
1717
bcs = "0.1"
18+
chrono = { version = "0.4", features = ["serde"] }
1819
iota-sdk = { git = "https://github.com/iotaledger/iota.git", tag = "v1.6.1", package = "iota-sdk" }
1920
iota_interaction = { git = "https://github.com/iotaledger/product-core.git", default-features = false, tag = "v0.8.2", package = "iota_interaction" }
2021
iota_interaction_rust = { git = "https://github.com/iotaledger/product-core.git", default-features = false, tag = "v0.8.2", package = "iota_interaction_rust" }

bindings/wasm/hierarchies_wasm/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ iota_interaction_ts = { git = "https://github.com/iotaledger/product-core.git",
2323
js-sys = { version = "0.3" }
2424
serde = { version = "1.0", features = ["derive"] }
2525
serde-wasm-bindgen = "0.6"
26-
wasm-bindgen = { version = "0.2", features = ["serde-serialize"] }
26+
wasm-bindgen = { version = "=0.2.102", features = ["serde-serialize"] }
2727
wasm-bindgen-futures = { version = "0.4", default-features = false }
2828

2929
[dependencies.product_common]

bindings/wasm/hierarchies_wasm/cypress/e2e/tests.cy.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ describe(
1616
"01_get_accreditations",
1717
"02_validate_properties",
1818
"03_get_properties",
19+
"real_world_01_university_degrees",
20+
"real_world_02_supply_chain",
1921
];
2022

2123
_.each(examples, (example) => {

bindings/wasm/hierarchies_wasm/examples/README.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,54 @@ The validation examples show how to verify trust relationships and validate prop
8484
| [02_validate_properties](src/validation/02_validate_properties.ts) | Shows how to validate if an entity can attest to specific properties. |
8585
| [03_get_properties](src/validation/03_get_properties.ts) | Demonstrates retrieving properties from federations. |
8686

87+
## Real-World Examples
88+
89+
These examples demonstrate practical applications of IOTA Hierarchies in real business scenarios with comprehensive TypeScript implementation:
90+
91+
| Name | Information |
92+
| :--------------------------------------------------------------- | :------------------------------------------------------------------------- |
93+
| [01_university_degrees](src/real-world/01_university_degrees.ts) | University degree verification system with multi-level academic hierarchy. |
94+
| [02_supply_chain](src/real-world/02_supply_chain.ts) | Supply chain quality certification system with international standards. |
95+
96+
### University Degree Verification System
97+
98+
Demonstrates a comprehensive academic credential verification system optimized for web applications:
99+
100+
- University consortium federation management
101+
- Multi-level hierarchy: University → Faculty → Registrar
102+
- Academic properties: degrees, fields of study, GPAs, graduation years
103+
- Cross-institutional credential recognition
104+
- Degree revocation for academic misconduct
105+
- Mobile app integration and QR code verification
106+
107+
**Web-Specific Features:**
108+
109+
- Browser-based credential verification
110+
- Real-time validation without server round-trips
111+
- QR code integration for mobile verification
112+
- Progressive Web App (PWA) compatibility
113+
- Cross-platform TypeScript implementation
114+
115+
### Supply Chain Quality Certification System
116+
117+
Demonstrates a global supply chain certification system designed for web dashboards and e-commerce integration:
118+
119+
- International standards consortium (ISO-style) federation
120+
- Multi-regional structure with real-time status monitoring
121+
- Comprehensive certifications with web dashboard integration
122+
- Consumer-facing QR code verification
123+
- E-commerce API integration examples
124+
- Real-time certificate expiry tracking
125+
126+
**Web-Specific Features:**
127+
128+
- Interactive certification dashboard
129+
- RESTful API integration examples
130+
- Consumer-facing verification interfaces
131+
- Real-time compliance monitoring
132+
- Mobile-responsive design patterns
133+
- WebAssembly performance optimization
134+
87135
## Utility Functions
88136

89137
| Name | Information |

bindings/wasm/hierarchies_wasm/examples/src/main.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ import { createAccreditationToAccredit } from "./06_create_accreditation_to_accr
1010
import { revokeAccreditationToAccredit } from "./07_revoke_accreditation_to_accredit";
1111
import { revokeRootAuthority } from "./08_revoke_root_authority";
1212
import { reinstateRootAuthority } from "./09_reinstate_root_authority";
13+
import { universityDegrees } from "./real-world/01_university_degrees";
14+
import { supplyChain } from "./real-world/02_supply_chain";
1315
import { getAccreditations } from "./validation/01_get_accreditations";
1416
import { validateProperties } from "./validation/02_validate_properties";
1517
import { getProperties } from "./validation/03_get_properties";
@@ -34,6 +36,8 @@ export async function main(example?: string) {
3436
await reinstateRootAuthority();
3537
await getAccreditations();
3638
await validateProperties();
39+
await universityDegrees();
40+
await supplyChain();
3741
return await getProperties();
3842
case "01_create_federation":
3943
return await createFederation();
@@ -59,6 +63,10 @@ export async function main(example?: string) {
5963
return await validateProperties();
6064
case "03_get_properties":
6165
return await getProperties();
66+
case "real_world_01_university_degrees":
67+
return await universityDegrees();
68+
case "real_world_02_supply_chain":
69+
return await supplyChain();
6270
default:
6371
throw "Unknown example name: '" + argument + "'";
6472
}

0 commit comments

Comments
 (0)