1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
//! Rollkit Rust Client Library
//!
//! This library provides a Rust client for interacting with Rollkit nodes via gRPC.
//!
//! # Example
//!
//! ```no_run
//! use ev_client::{Client, HealthClient};
//!
//! #[tokio::main]
//! async fn main() -> Result<(), Box<dyn std::error::Error>> {
//! // Connect to a Rollkit node
//! let client = Client::connect("http://localhost:50051").await?;
//!
//! // Check health
//! let health = HealthClient::new(&client);
//! let is_healthy = health.is_healthy().await?;
//! println!("Node healthy: {}", is_healthy);
//!
//! Ok(())
//! }
//! ```
//!
//! # Using the Builder Pattern
//!
//! ```no_run
//! use ev_client::Client;
//! use std::time::Duration;
//!
//! #[tokio::main]
//! async fn main() -> Result<(), Box<dyn std::error::Error>> {
//! // Create a client with custom timeouts
//! let client = Client::builder()
//! .endpoint("http://localhost:50051")
//! .timeout(Duration::from_secs(30))
//! .connect_timeout(Duration::from_secs(10))
//! .build()
//! .await?;
//!
//! Ok(())
//! }
//! ```
//!
//! # Using TLS
//!
//! ```no_run
//! use ev_client::Client;
//! use tonic::transport::ClientTlsConfig;
//!
//! #[tokio::main]
//! async fn main() -> Result<(), Box<dyn std::error::Error>> {
//! // Create a client with TLS enabled
//! let client = Client::builder()
//! .endpoint("https://secure-node.rollkit.dev")
//! .tls() // Enable TLS with default configuration
//! .build()
//! .await?;
//!
//! // Or with custom TLS configuration
//! let tls_config = ClientTlsConfig::new()
//! .domain_name("secure-node.rollkit.dev");
//!
//! let client = Client::builder()
//! .endpoint("https://secure-node.rollkit.dev")
//! .tls_config(tls_config)
//! .build()
//! .await?;
//!
//! Ok(())
//! }
//! ```
// Re-export main types for convenience
pub use ;
pub use ;
pub use HealthClient;
pub use P2PClient;
pub use SignerClient;
pub use StoreClient;
// Re-export types from rollkit-types for convenience
pub use v1;
// Re-export tonic transport types for convenience
pub use ClientTlsConfig;