Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into cg/shared_ptr-to-tr…
Browse files Browse the repository at this point in the history
…anscript
  • Loading branch information
codygunton committed Dec 1, 2023
2 parents 3507874 + d889359 commit aec1f9a
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 60 deletions.
2 changes: 2 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1014,6 +1014,8 @@ jobs:
export TF_VAR_BOOTNODE_2_PEER_ID=$BOOTNODE_2_PEER_ID
export TF_VAR_BOOTNODE_1_PRIVATE_KEY=$BOOTNODE_1_PRIVATE_KEY
export TF_VAR_BOOTNODE_2_PRIVATE_KEY=$BOOTNODE_2_PRIVATE_KEY
export TF_VAR_SEQ_1_PUBLISHER_PRIVATE_KEY=$SEQ_1_PUBLISHER_PRIVATE_KEY
export TF_VAR_SEQ_2_PUBLISHER_PRIVATE_KEY=$SEQ_2_PUBLISHER_PRIVATE_KEY
deploy_terraform p2p-bootstrap yarn-project/p2p-bootstrap/terraform
deploy_terraform aztec-node yarn-project/aztec-node/terraform
deploy_terraform aztec-faucet yarn-project/aztec-faucet/terraform
Expand Down
40 changes: 20 additions & 20 deletions yarn-project/aztec-node/terraform/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -369,23 +369,23 @@ resource "aws_security_group_rule" "allow-node-tcp" {
## NLB listeners can't have a 'weight' property defined. You will see there isn't one here but that doesn't
## stop it trying to automatically specify one and giving an error

resource "aws_lb_listener" "aztec-node-tcp-listener" {
count = local.node_count
load_balancer_arn = data.terraform_remote_state.aztec-network_iac.outputs.nlb_arn
port = var.NODE_TCP_PORT + count.index
protocol = "TCP"

tags = {
name = "aztec-node-${count.index}-tcp-listener"
}

default_action {
type = "forward"

forward {
target_group {
arn = aws_lb_target_group.aztec-bootstrap-target-group[count.index].arn
}
}
}
}
# resource "aws_lb_listener" "aztec-node-tcp-listener" {
# count = local.node_count
# load_balancer_arn = data.terraform_remote_state.aztec-network_iac.outputs.nlb_arn
# port = var.NODE_TCP_PORT + count.index
# protocol = "TCP"

# tags = {
# name = "aztec-node-${count.index}-tcp-listener"
# }

# default_action {
# type = "forward"

# forward {
# target_group {
# arn = aws_lb_target_group.aztec-bootstrap-target-group[count.index].arn
# }
# }
# }
# }
22 changes: 4 additions & 18 deletions yarn-project/aztec-node/terraform/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,6 @@ variable "API_KEY" {
type = string
}

variable "CONTRACT_DEPLOYMENT_EMITTER_ADDRESS" {
type = string
}

variable "ROLLUP_CONTRACT_ADDRESS" {
type = string
}

variable "INBOX_CONTRACT_ADDRESS" {
type = string
}

variable "REGISTRY_CONTRACT_ADDRESS" {
type = string
}

variable "SEQ_1_PUBLISHER_PRIVATE_KEY" {
type = string
}
Expand Down Expand Up @@ -54,11 +38,13 @@ variable "NODE_TCP_PORT" {
}

variable "NODE_1_PRIVATE_KEY" {
type = string
type = string
default = ""
}

variable "NODE_2_PRIVATE_KEY" {
type = string
type = string
default = ""
}

variable "DOCKERHUB_ACCOUNT" {
Expand Down
47 changes: 26 additions & 21 deletions yarn-project/p2p-bootstrap/terraform/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ resource "aws_cloudwatch_log_group" "aztec-bootstrap-log-group" {
}

resource "aws_service_discovery_service" "aztec-bootstrap" {
name = "${var.DEPLOY_TAG}-aztec-bootstrap-${count.index + 1}"
count = local.bootnode_count
name = "${var.DEPLOY_TAG}-aztec-bootstrap-${count.index + 1}"

health_check_custom_config {
failure_threshold = 1
Expand Down Expand Up @@ -223,23 +224,27 @@ resource "aws_security_group_rule" "allow-bootstrap-tcp" {
security_group_id = data.terraform_remote_state.aztec-network_iac.outputs.p2p_security_group_id
}

resource "aws_lb_listener" "aztec-bootstrap-tcp-listener" {
count = local.bootnode_count
load_balancer_arn = data.terraform_remote_state.aztec-network_iac.outputs.nlb_arn
port = var.BOOTNODE_LISTEN_PORT + count.index
protocol = "TCP"

tags = {
name = "aztec-bootstrap-${count.index}-target-group"
}

default_action {
type = "forward"

forward {
target_group {
arn = aws_lb_target_group.aztec-bootstrap-target-group[count.index].arn
}
}
}
}
## Commented out here and setup manually as terraform (or the aws provider version we are using) has a bug
## NLB listeners can't have a 'weight' property defined. You will see there isn't one here but that doesn't
## stop it trying to automatically specify one and giving an error

# resource "aws_lb_listener" "aztec-bootstrap-tcp-listener" {
# count = local.bootnode_count
# load_balancer_arn = data.terraform_remote_state.aztec-network_iac.outputs.nlb_arn
# port = var.BOOTNODE_LISTEN_PORT + count.index
# protocol = "TCP"

# tags = {
# name = "aztec-bootstrap-${count.index}-target-group"
# }

# default_action {
# type = "forward"

# forward {
# target_group {
# arn = aws_lb_target_group.aztec-bootstrap-target-group[count.index].arn
# }
# }
# }
# }
2 changes: 1 addition & 1 deletion yarn-project/p2p/src/service/libp2p_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const INITIAL_PEER_REFRESH_INTERVAL = 20000;
* @returns The peer ID.
*/
export async function createLibP2PPeerId(privateKey?: string) {
if (!privateKey) {
if (!privateKey?.length) {
return await createSecp256k1PeerId();
}
const base64 = Buffer.from(privateKey, 'hex').toString('base64');
Expand Down

0 comments on commit aec1f9a

Please sign in to comment.