Bootstrap geth Rust workspace
This commit is contained in:
commit
26f81ff1ef
73 changed files with 4835 additions and 0 deletions
10
crates/geth-discovery/Cargo.toml
Normal file
10
crates/geth-discovery/Cargo.toml
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
[package]
|
||||
name = "geth-discovery"
|
||||
version = "0.1.0"
|
||||
edition.workspace = true
|
||||
rust-version.workspace = true
|
||||
license.workspace = true
|
||||
|
||||
[dependencies]
|
||||
serde.workspace = true
|
||||
geth-types = { path = "../geth-types" }
|
||||
18
crates/geth-discovery/src/lib.rs
Normal file
18
crates/geth-discovery/src/lib.rs
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
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"
|
||||
}
|
||||
Loading…
Reference in a new issue