Skip to content
Merged
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
1 change: 1 addition & 0 deletions build-system/scripts/deploy_terraform
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export TF_VAR_DOCKERHUB_ACCOUNT=$DOCKERHUB_ACCOUNT
export TF_VAR_FORK_MNEMONIC=$FORK_MNEMONIC
export TF_VAR_INFURA_API_KEY=$INFURA_API_KEY
export TF_VAR_API_KEY=$FORK_API_KEY
export TF_VAR_CHAIN_ID=$CHAIN_ID

# If given a repository name, use it to construct and set/override the backend key.
# Otherwise use the key as specified in the terraform.
Expand Down
2 changes: 1 addition & 1 deletion yarn-project/.gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
dest
node_modules
.cache
.env
.env*
*.log
*.swp
.tsbuildinfo
Expand Down
9 changes: 3 additions & 6 deletions yarn-project/aztec-faucet/terraform/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ data "terraform_remote_state" "aztec2_iac" {
}

locals {
api_prefix = var.API_PREFIX == "" ? "/${var.DEPLOY_TAG}/aztec-faucet" : "/${var.DEPLOY_TAG}/aztec-faucet/${var.API_PREFIX}"
api_prefix = "/${var.DEPLOY_TAG}/aztec-faucet/${var.API_KEY}"
rpc_url = "https://${var.DEPLOY_TAG}-mainnet-fork.aztec.network:8545/${var.API_KEY}"
}


Expand Down Expand Up @@ -110,11 +111,7 @@ resource "aws_ecs_task_definition" "aztec-faucet" {
},
{
"name": "RPC_URL",
"value": "${var.RPC_URL}"
},
{
"name": "API_KEY",
"value": "${var.API_KEY}"
"value": "${local.rpc_url}"
},
{
"name": "API_PREFIX",
Expand Down
11 changes: 0 additions & 11 deletions yarn-project/aztec-faucet/terraform/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,12 @@ variable "DEPLOY_TAG" {
type = string
}

variable "RPC_URL" {
type = string
default = "testnet"
}

variable "API_KEY" {
type = string
}

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

variable "CHAIN_ID" {
type = string
default = 31337
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

with current setup this will throw an error as it's not being set anywhere, even if there is a default replacement inside the faucet code

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we set it explicitly somewhere? Defaults like that can be a bit of a footgun.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep can set it as an env var

}

variable "FAUCET_PRIVATE_KEY" {
Expand Down
3 changes: 2 additions & 1 deletion yarn-project/sequencer-client/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export function getConfigEnvVars(): SequencerClientConfig {
REGISTRY_CONTRACT_ADDRESS,
INBOX_CONTRACT_ADDRESS,
CONTRACT_DEPLOYMENT_EMITTER_ADDRESS,
OUTBOX_CONTRACT_ADDRESS,
} = process.env;

const publisherPrivateKey: Hex = SEQ_PUBLISHER_PRIVATE_KEY
Expand All @@ -53,7 +54,7 @@ export function getConfigEnvVars(): SequencerClientConfig {
rollupAddress: ROLLUP_CONTRACT_ADDRESS ? EthAddress.fromString(ROLLUP_CONTRACT_ADDRESS) : EthAddress.ZERO,
registryAddress: REGISTRY_CONTRACT_ADDRESS ? EthAddress.fromString(REGISTRY_CONTRACT_ADDRESS) : EthAddress.ZERO,
inboxAddress: INBOX_CONTRACT_ADDRESS ? EthAddress.fromString(INBOX_CONTRACT_ADDRESS) : EthAddress.ZERO,
outboxAddress: EthAddress.ZERO,
outboxAddress: OUTBOX_CONTRACT_ADDRESS ? EthAddress.fromString(OUTBOX_CONTRACT_ADDRESS) : EthAddress.ZERO,
contractDeploymentEmitterAddress: CONTRACT_DEPLOYMENT_EMITTER_ADDRESS
? EthAddress.fromString(CONTRACT_DEPLOYMENT_EMITTER_ADDRESS)
: EthAddress.ZERO,
Expand Down