mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-03 00:31:50 +00:00
Altair validator client and HTTP API (#2404)
## Proposed Changes * Implement the validator client and HTTP API changes necessary to support Altair Co-authored-by: realbigsean <seananderson33@gmail.com> Co-authored-by: Michael Sproul <michael@sigmaprime.io>
This commit is contained in:
@@ -40,13 +40,22 @@ pub async fn run<T: EthSpec>(config: BootNodeConfig<T>, log: slog::Logger) {
|
||||
};
|
||||
|
||||
// construct the discv5 server
|
||||
let mut discv5 = Discv5::new(config.local_enr, config.local_key, discv5_config).unwrap();
|
||||
let mut discv5 =
|
||||
Discv5::new(config.local_enr.clone(), config.local_key, discv5_config).unwrap();
|
||||
|
||||
// If there are any bootnodes add them to the routing table
|
||||
for enr in config.boot_nodes {
|
||||
info!(log, "Adding bootnode"; "address" => format!("{:?}", enr.udp_socket()), "peer_id" => enr.peer_id().to_string(), "node_id" => enr.node_id().to_string());
|
||||
if let Err(e) = discv5.add_enr(enr) {
|
||||
slog::warn!(log, "Failed adding ENR"; "error" => e.to_string());
|
||||
info!(
|
||||
log,
|
||||
"Adding bootnode";
|
||||
"address" => ?enr.udp_socket(),
|
||||
"peer_id" => enr.peer_id().to_string(),
|
||||
"node_id" => enr.node_id().to_string()
|
||||
);
|
||||
if enr != config.local_enr {
|
||||
if let Err(e) = discv5.add_enr(enr) {
|
||||
slog::warn!(log, "Failed adding ENR"; "error" => e.to_string());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user