Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: follower node in devnet #1516

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions components/clarinet-files/src/network_manifest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ pub struct DevnetConfigFile {
pub stacks_node_first_attempt_time_ms: Option<u32>,
pub stacks_node_subsequent_attempt_time_ms: Option<u32>,
pub stacks_node_env_vars: Option<Vec<String>>,
pub stacks_follower_p2p_port: Option<u16>,
pub stacks_follower_rpc_port: Option<u16>,
pub stacks_follower_env_vars: Option<Vec<String>>,
pub stacks_api_env_vars: Option<Vec<String>>,
pub stacks_explorer_env_vars: Option<Vec<String>>,
pub subnet_node_env_vars: Option<Vec<String>>,
Expand Down Expand Up @@ -114,13 +117,15 @@ pub struct DevnetConfigFile {
pub bitcoin_node_image_url: Option<String>,
pub bitcoin_explorer_image_url: Option<String>,
pub stacks_node_image_url: Option<String>,
pub stacks_follower_image_url: Option<String>,
pub stacks_signer_image_url: Option<String>,
pub stacks_api_image_url: Option<String>,
pub stacks_explorer_image_url: Option<String>,
pub postgres_image_url: Option<String>,
pub disable_bitcoin_explorer: Option<bool>,
pub disable_stacks_explorer: Option<bool>,
pub disable_stacks_api: Option<bool>,
pub disable_stacks_follower: Option<bool>,
pub bind_containers_volumes: Option<bool>,
pub enable_subnet_node: Option<bool>,
pub subnet_node_image_url: Option<String>,
Expand Down Expand Up @@ -243,6 +248,9 @@ pub struct DevnetConfig {
pub stacks_node_subsequent_attempt_time_ms: u32,
pub stacks_node_events_observers: Vec<String>,
pub stacks_node_env_vars: Vec<String>,
pub stacks_follower_p2p_port: u16,
pub stacks_follower_rpc_port: u16,
pub stacks_follower_env_vars: Vec<String>,
pub stacks_api_port: u16,
pub stacks_api_events_port: u16,
pub stacks_api_env_vars: Vec<String>,
Expand Down Expand Up @@ -273,6 +281,7 @@ pub struct DevnetConfig {
pub execute_script: Vec<ExecuteScript>,
pub bitcoin_node_image_url: String,
pub stacks_node_image_url: String,
pub stacks_follower_image_url: String,
pub stacks_signer_image_url: String,
pub stacks_api_image_url: String,
pub stacks_explorer_image_url: String,
Expand All @@ -281,6 +290,7 @@ pub struct DevnetConfig {
pub disable_bitcoin_explorer: bool,
pub disable_stacks_explorer: bool,
pub disable_stacks_api: bool,
pub disable_stacks_follower: bool,
pub bind_containers_volumes: bool,
pub enable_subnet_node: bool,
pub subnet_node_image_url: String,
Expand Down Expand Up @@ -510,6 +520,14 @@ impl NetworkManifest {
devnet_config.stacks_node_events_observers = Some(val.clone());
}

if let Some(val) = devnet_override.stacks_follower_p2p_port {
devnet_config.stacks_follower_p2p_port = Some(val);
}

if let Some(val) = devnet_override.stacks_follower_rpc_port {
devnet_config.stacks_follower_rpc_port = Some(val);
}

if let Some(val) = devnet_override.stacks_api_port {
devnet_config.stacks_api_port = Some(val);
}
Expand Down Expand Up @@ -590,6 +608,10 @@ impl NetworkManifest {
devnet_config.stacks_node_image_url = Some(val.clone());
}

if let Some(ref val) = devnet_override.stacks_follower_image_url {
devnet_config.stacks_follower_image_url = Some(val.clone());
}

if let Some(ref val) = devnet_override.stacks_api_image_url {
devnet_config.stacks_api_image_url = Some(val.clone());
}
Expand Down Expand Up @@ -835,6 +857,8 @@ impl NetworkManifest {
stacks_node_subsequent_attempt_time_ms: devnet_config
.stacks_node_subsequent_attempt_time_ms
.unwrap_or(1_000),
stacks_follower_p2p_port: devnet_config.stacks_follower_p2p_port.unwrap_or(21444),
stacks_follower_rpc_port: devnet_config.stacks_follower_rpc_port.unwrap_or(21443),
stacks_api_port: devnet_config.stacks_api_port.unwrap_or(3999),
stacks_api_events_port: devnet_config.stacks_api_events_port.unwrap_or(3700),
stacks_explorer_port: devnet_config.stacks_explorer_port.unwrap_or(8000),
Expand Down Expand Up @@ -883,6 +907,10 @@ impl NetworkManifest {
.stacks_node_image_url
.take()
.unwrap_or(DEFAULT_STACKS_NODE_IMAGE.to_string()),
stacks_follower_image_url: devnet_config
.stacks_follower_image_url
.take()
.unwrap_or(DEFAULT_STACKS_NODE_IMAGE.to_string()),
stacks_signer_image_url: devnet_config
.stacks_signer_image_url
.take()
Expand All @@ -906,6 +934,7 @@ impl NetworkManifest {
pox_stacking_orders: devnet_config.pox_stacking_orders.take().unwrap_or_default(),
disable_bitcoin_explorer: devnet_config.disable_bitcoin_explorer.unwrap_or(false),
disable_stacks_api: devnet_config.disable_stacks_api.unwrap_or(false),
disable_stacks_follower: devnet_config.disable_stacks_follower.unwrap_or(true),
disable_stacks_explorer: devnet_config.disable_stacks_explorer.unwrap_or(false),
bind_containers_volumes: devnet_config.bind_containers_volumes.unwrap_or(false),
enable_subnet_node,
Expand Down Expand Up @@ -952,6 +981,10 @@ impl NetworkManifest {
.stacks_node_env_vars
.take()
.unwrap_or_default(),
stacks_follower_env_vars: devnet_config
.stacks_follower_env_vars
.take()
.unwrap_or_default(),
stacks_api_env_vars: devnet_config.stacks_api_env_vars.take().unwrap_or_default(),
stacks_explorer_env_vars: devnet_config
.stacks_explorer_env_vars
Expand Down
Loading
Loading