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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
//! # dig-peer-protocol
//!
//! DIG Network L2 protocol types — a superset of `chia-protocol`.
//!
//! This crate re-exports the entire Chia protocol ecosystem (`chia-protocol`,
//! `chia-sdk-client`, `chia-ssl`, `chia-traits`) plus DIG-specific extensions
//! (the `200..=219` consensus opcodes plus [`DIG_MESSAGE`] = 220, the directed
//! dig-message envelope opcode). Consumers depend on `dig-peer-protocol` alone instead
//! of importing multiple `chia-*` crates individually.
//!
//! ## What's included
//!
//! | Source crate | What's re-exported |
//! |-------------|-------------------|
//! | `chia-protocol` | All wire types: `Message`, `Handshake`, `ProtocolMessageTypes`, `NodeType`, etc. |
//! | `chia-sdk-client` | `Peer`, `Client`, `ClientError`, `ClientState`, `Network`, `PeerOptions`, rate limiting, TLS connectors |
//! | `chia-ssl` | `ChiaCertificate` |
//! | `chia-traits` | `Streamable` trait |
//! | `chia_streamable_macro` | `#[streamable]` proc macro |
//! | **DIG extensions** | `DigMessage`, `DigMessageType`, `RegisterPeer`, `RegisterAck`, introducer wire types |
//!
//! ## Feature flags
//!
//! | Flag | Forwards to | Effect |
//! |------|-------------|--------|
//! | `native-tls` | `chia-sdk-client/native-tls` | OS-native TLS; enables `Client`, `ClientState`, `Connector`, `create_native_tls_connector` |
//! | `rustls` | `chia-sdk-client/rustls` | Pure-Rust TLS; enables `Client`, `ClientState`, `Connector`, `create_rustls_connector` |
//!
//! Neither feature is enabled by default. The crate builds without either but TLS-dependent
//! re-exports (`Client`, `ClientState`, `Connector`) become unavailable.
// ============================================================================
// Re-export: chia-protocol (all wire types)
// ============================================================================
pub use *;
// ============================================================================
// Re-export: chia-sdk-client (peer IO, TLS, rate limiting)
// ============================================================================
// Backend-agnostic types — always available.
pub use ;
// `Client`, `ClientState`, and `Connector` require a TLS backend in `chia-sdk-client`.
// Enable either the `native-tls` or `rustls` feature to use them.
pub use ;
pub use create_native_tls_connector;
pub use create_rustls_connector;
// ============================================================================
// Re-export: chia-ssl (certificate types)
// ============================================================================
pub use ChiaCertificate;
// ============================================================================
// Re-export: chia-traits (serialization)
// ============================================================================
pub use Streamable;
// ============================================================================
// Re-export: chia_streamable_macro (proc macro for wire structs)
// ============================================================================
pub use streamable;
// ============================================================================
// DIG extensions
// ============================================================================
pub use DigMessage;
pub use ;
pub use ;
/// Wire opcode for a directed **dig-message** envelope (WU6, epic #796).
///
/// The `200..=219` band is the DIG L2 **consensus** band ([`DigMessageType`]); `220..=255`
/// is the **free** band for directed application protocols. Opcode **220** carries a
/// `dig-message` directed envelope as OPAQUE bytes in [`DigMessage::data`] — the transport
/// (dig-gossip) never seals, opens, or parses it; end-to-end sealing to the recipient's DID
/// key is `dig-message`'s job.
///
/// This is a cross-repo **canonical** constant — it MUST NOT drift. `dig-gossip` mirrors it
/// as `dig_gossip::DIG_MESSAGE` (and `ProtocolMessageTypes::DigMessage`) for its transport.
pub const DIG_MESSAGE: u8 = 220;