mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-29 02:33:48 +00:00
Add beacon.watch (#3362)
> This is currently a WIP and all features are subject to alteration or removal at any time. ## Overview The successor to #2873. Contains the backbone of `beacon.watch` including syncing code, the initial API, and several core database tables. See `watch/README.md` for more information, requirements and usage.
This commit is contained in:
28
watch/src/server/config.rs
Normal file
28
watch/src/server/config.rs
Normal file
@@ -0,0 +1,28 @@
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::net::IpAddr;
|
||||
|
||||
pub const LISTEN_ADDR: &str = "127.0.0.1";
|
||||
|
||||
pub const fn listen_port() -> u16 {
|
||||
5059
|
||||
}
|
||||
fn listen_addr() -> IpAddr {
|
||||
LISTEN_ADDR.parse().expect("Server address is not valid")
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Config {
|
||||
#[serde(default = "listen_addr")]
|
||||
pub listen_addr: IpAddr,
|
||||
#[serde(default = "listen_port")]
|
||||
pub listen_port: u16,
|
||||
}
|
||||
|
||||
impl Default for Config {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
listen_addr: listen_addr(),
|
||||
listen_port: listen_port(),
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user