diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2025-12-04 11:49:31 +0000 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2025-12-04 11:49:31 +0000 |
| commit | a2bb8ff62366d805ddb8ee08ac70ea71250a1c2d (patch) | |
| tree | 19987408c1553dfeea8e8396cbb9f886f1e67721 /grasp-audit/examples | |
| parent | 9f23a5677ebb2b0b31b31d6ebecb5d65eae10289 (diff) | |
docs: update grasp-audit docs
Diffstat (limited to 'grasp-audit/examples')
| -rw-r--r-- | grasp-audit/examples/simple_audit.rs | 53 |
1 files changed, 0 insertions, 53 deletions
diff --git a/grasp-audit/examples/simple_audit.rs b/grasp-audit/examples/simple_audit.rs deleted file mode 100644 index 57d4ac8..0000000 --- a/grasp-audit/examples/simple_audit.rs +++ /dev/null | |||
| @@ -1,53 +0,0 @@ | |||
| 1 | //! Simple audit example | ||
| 2 | //! | ||
| 3 | //! Run with: cargo run --example simple_audit | ||
| 4 | |||
| 5 | use grasp_audit::*; | ||
| 6 | |||
| 7 | #[tokio::main] | ||
| 8 | async fn main() -> Result<()> { | ||
| 9 | // Create audit config with shared fixtures (default for CLI) | ||
| 10 | let config = AuditConfig::shared(); | ||
| 11 | |||
| 12 | println!("GRASP Audit Example"); | ||
| 13 | println!("=================="); | ||
| 14 | println!("Audit Run ID: {}", config.run_id); | ||
| 15 | println!(); | ||
| 16 | |||
| 17 | // Connect to relay | ||
| 18 | println!("Connecting to relay at ws://localhost:7000..."); | ||
| 19 | let client = match AuditClient::new("ws://localhost:7000", config).await { | ||
| 20 | Ok(c) => c, | ||
| 21 | Err(e) => { | ||
| 22 | eprintln!("Failed to connect: {}", e); | ||
| 23 | eprintln!(); | ||
| 24 | eprintln!("Make sure a Nostr relay is running at ws://localhost:7000"); | ||
| 25 | eprintln!("You can use: https://github.com/rust-nostr/nostr/tree/master/crates/nostr-relay-builder"); | ||
| 26 | return Err(e); | ||
| 27 | } | ||
| 28 | }; | ||
| 29 | |||
| 30 | if !client.is_connected().await { | ||
| 31 | eprintln!("Not connected to relay"); | ||
| 32 | return Err(anyhow!("Connection failed")); | ||
| 33 | } | ||
| 34 | |||
| 35 | println!("✓ Connected"); | ||
| 36 | println!(); | ||
| 37 | |||
| 38 | // Run NIP-01 smoke tests | ||
| 39 | println!("Running NIP-01 smoke tests..."); | ||
| 40 | println!(); | ||
| 41 | |||
| 42 | let results = specs::Nip01SmokeTests::run_all(&client).await; | ||
| 43 | |||
| 44 | // Print results | ||
| 45 | results.print_report(); | ||
| 46 | |||
| 47 | // Exit with error if tests failed | ||
| 48 | if !results.all_passed() { | ||
| 49 | std::process::exit(1); | ||
| 50 | } | ||
| 51 | |||
| 52 | Ok(()) | ||
| 53 | } | ||