Files
lighthouse/watch/src/server/config.rs
Mac L 8630ddfec4 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.
2023-04-03 05:35:11 +00:00

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(),
}
}
}