mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-23 06:44:35 +00:00
> 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.
29 lines
613 B
Rust
29 lines
613 B
Rust
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(),
|
|
}
|
|
}
|
|
}
|