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
//! JSON-RPC access to Hive nodes.
//!
//! # Transport is pluggable, and the signing path does not depend on it
//!
//! The core of this crate — keys, serialization, signing — has no network dependency
//! at all, and this module is behind the `rpc` feature so that it stays that way for
//! callers who only sign. That is deliberate: `beem` pulled `requests`,
//! `websocket-client` and their transitive trees into every process that wanted to
//! produce a signature.
//!
//! [`Transport`] is the seam. Implement it over whatever HTTP client an application
//! already has, or enable the `ureq-transport` feature for a working default.
//!
//! # Failover
//!
//! [`NodeClient`] tries nodes in order and moves on when one fails. By default it does
//! **not** rank nodes by health, size waves, or manage retry budgets — an application
//! that cares about tail latency will already have policy of its own, and a library
//! that imposes its own would fight it. What this provides is the mechanism: an ordered
//! list, a per-node timeout, and an error that names every node that failed.
//!
//! That default has one sharp edge in a long-running process, though: walking the list
//! from the front every time means a dead first node costs its full timeout on *every*
//! call, forever. [`NodeClient::with_health_tracking`] is the opt-in answer — it
//! remembers which nodes and which node-and-method pairs are failing, notices nodes
//! that answer promptly with stale data, and sorts accordingly. It only ever reorders
//! the list; no node is excluded, so it cannot turn a partial outage into a total one.
//! Applications with their own policy are unaffected, because it stays off unless
//! asked for.
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use UreqTransport;
/// Public Hive API nodes, in no particular order of preference.
///
/// Provided as a starting point. Applications should prefer their own list: node
/// availability changes, and a hard-coded default that goes stale is exactly the kind
/// of thing that rots in an unmaintained library.
pub const DEFAULT_NODES: & = &;