18 lines
460 B
Rust
18 lines
460 B
Rust
|
|
use geth_types::NodeId;
|
||
|
|
use serde::{Deserialize, Serialize};
|
||
|
|
|
||
|
|
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
|
||
|
|
pub struct PeerCard {
|
||
|
|
pub node: NodeId,
|
||
|
|
pub endpoints: Vec<String>,
|
||
|
|
pub signed_by: String,
|
||
|
|
}
|
||
|
|
|
||
|
|
pub trait DiscoveryBackend {
|
||
|
|
fn candidates(&self) -> Vec<PeerCard>;
|
||
|
|
}
|
||
|
|
|
||
|
|
#[must_use]
|
||
|
|
pub fn discovery_is_untrusted_note() -> &'static str {
|
||
|
|
"discovery returns candidate peers only and never grants trust or authorization"
|
||
|
|
}
|