Skip to content
This repository has been archived by the owner on Oct 31, 2024. It is now read-only.

Commit

Permalink
fix: update default values for api endpoints (#385)
Browse files Browse the repository at this point in the history
Signed-off-by: Simon Paitrault <[email protected]>
Co-authored-by: Simon Paitrault <[email protected]>
  • Loading branch information
gruberb and Freyskeyd authored Nov 28, 2023
1 parent 581b5d7 commit 246ff0a
Showing 1 changed file with 6 additions and 16 deletions.
22 changes: 6 additions & 16 deletions crates/topos/src/config/tce.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ use serde::{Deserialize, Serialize};
use crate::config::Config;
use topos_p2p::{Multiaddr, PeerId};

const DEFAULT_IP: std::net::Ipv4Addr = std::net::Ipv4Addr::new(0, 0, 0, 0);

#[derive(Serialize, Deserialize, Debug, Clone)]
#[serde(rename_all = "kebab-case")]
pub struct TceConfig {
Expand Down Expand Up @@ -51,31 +53,19 @@ fn default_db_path() -> PathBuf {
}

const fn default_libp2p_api_addr() -> SocketAddr {
SocketAddr::V4(std::net::SocketAddrV4::new(
std::net::Ipv4Addr::new(0, 0, 0, 1),
9090,
))
SocketAddr::V4(std::net::SocketAddrV4::new(DEFAULT_IP, 9090))
}

const fn default_grpc_api_addr() -> SocketAddr {
SocketAddr::V4(std::net::SocketAddrV4::new(
std::net::Ipv4Addr::new(0, 0, 0, 1),
1340,
))
SocketAddr::V4(std::net::SocketAddrV4::new(DEFAULT_IP, 1340))
}

const fn default_graphql_api_addr() -> SocketAddr {
SocketAddr::V4(std::net::SocketAddrV4::new(
std::net::Ipv4Addr::new(0, 0, 0, 1),
4030,
))
SocketAddr::V4(std::net::SocketAddrV4::new(DEFAULT_IP, 4030))
}

const fn default_metrics_api_addr() -> SocketAddr {
SocketAddr::V4(std::net::SocketAddrV4::new(
std::net::Ipv4Addr::new(0, 0, 0, 1),
3000,
))
SocketAddr::V4(std::net::SocketAddrV4::new(DEFAULT_IP, 3000))
}

impl TceConfig {
Expand Down

0 comments on commit 246ff0a

Please sign in to comment.