Skip to content

Commit

Permalink
refactor: minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
hugocaillard committed Mar 22, 2024
1 parent 5efae40 commit 63eebfe
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 25 deletions.
22 changes: 9 additions & 13 deletions components/stacks-network/src/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,23 +78,19 @@ pub fn send_status_update(
status: Status,
comment: &str,
) {
let signer_order_start = if with_nakamoto { 2 } else { 0 };
let subnet_order_start = if with_subnets {
5 + signer_order_start
} else {
signer_order_start
};
let signers_services = if with_nakamoto { 2 } else { 0 };
let subnet_services = if with_subnets { 2 } else { 0 };

let order = match name {
"bitcoin-node" => 0,
"stacks-node" => 1,
"stacks-signer-1" => signer_order_start,
"stacks-signer-2" => signer_order_start + 1,
"stacks-api" => signer_order_start + 2,
"subnet-node" => subnet_order_start,
"subnet-api" => subnet_order_start + 1,
"stacks-explorer" => subnet_order_start + 2,
"bitcoin-explorer" => subnet_order_start + 3,
"stacks-signer-1" => 2,
"stacks-signer-2" => 3,
"stacks-api" => signers_services + 2,
"subnet-node" => signers_services + 3,
"subnet-api" => signers_services + 4,
"stacks-explorer" => signers_services + subnet_services + 3,
"bitcoin-explorer" => signers_services + subnet_services + 4,
_ => return,
};

Expand Down
25 changes: 13 additions & 12 deletions components/stacks-network/src/orchestrator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1109,28 +1109,29 @@ amount = {}
account.stx_address, account.balance
));
}

stacks_conf.push_str(&format!(
r#"
if devnet_config.use_nakamoto {
stacks_conf.push_str(&format!(
r#"
[[events_observer]]
endpoint = "stacks-signer-1.{}:30000"
endpoint = "stacks-signer-1.{}:30001"
retry_count = 255
include_data_events = false
events_keys = ["stackerdb", "block_proposal", "burn_blocks"]
"#,
self.network_name
));
self.network_name
));

stacks_conf.push_str(&format!(
r#"
stacks_conf.push_str(&format!(
r#"
[[events_observer]]
endpoint = "stacks-signer-2.{}:30000"
endpoint = "stacks-signer-2.{}:30002"
retry_count = 255
include_data_events = false
events_keys = ["stackerdb", "block_proposal", "burn_blocks"]
"#,
self.network_name
));
self.network_name
));
}

stacks_conf.push_str(&format!(
r#"
Expand Down Expand Up @@ -1429,7 +1430,7 @@ start_height = {epoch_3_0}
stacks_private_key = "{signer_private_key}"
node_host = "stacks-node.{network_name}:{stacks_node_rpc_port}" # eg "127.0.0.1:20443"
# must be added as event_observer in node config:
endpoint = "0.0.0.0:30000" # e.g 127.0.0.1:30000
endpoint = "0.0.0.0:3000{signer_id}"
network = "testnet"
auth_password = "12345"
db_path = "stacks-signer-{signer_id}.sqlite"
Expand Down

0 comments on commit 63eebfe

Please sign in to comment.