Skip to content

Commit

Permalink
added TF code changes for RPC endpoint and Redis integration
Browse files Browse the repository at this point in the history
  • Loading branch information
auto-mausx committed Nov 21, 2024
1 parent 0872644 commit f3af774
Show file tree
Hide file tree
Showing 8 changed files with 110 additions and 12 deletions.
25 changes: 23 additions & 2 deletions infra/multichain-mainnet/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,16 @@ module "gce-container" {

container = {
image = var.image
args = ["start"]
port = "3000"

port = "3000"

volumeMounts = [
{
mountPath = "/data"
name = "host-path"
readOnly = false
}
]

env = concat(var.static_env, [
{
Expand Down Expand Up @@ -62,9 +70,22 @@ module "gce-container" {
{
name = "MPC_ENV",
value = var.env
},
{
name = "MPC_REDIS_URL",
value = var.redis_url
}
])
}

volumes = [
{
name = "host-path"
hostPath = {
path = "/var/redis"
}
}
]
}

resource "google_service_account" "service_account" {
Expand Down
7 changes: 6 additions & 1 deletion infra/multichain-mainnet/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ variable "static_env" {
default = [
{
name = "MPC_NEAR_RPC"
value = "https://rpc.mainnet.near.org"
value = "https://rpc.mainnet.fastnear.com"
},
{
name = "MPC_CONTRACT_ID"
Expand Down Expand Up @@ -138,4 +138,9 @@ variable "static_env" {
variable "domain" {
description = "DNS name for your node"
default = null
}

variable "redis_url" {
type = string
default = "redis://127.0.0.1:6379"
}
23 changes: 21 additions & 2 deletions infra/multichain-testnet/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,15 @@ module "gce-container" {

container = {
image = var.image
args = ["start"]
port = "3000"

port = "3000"
volumeMounts = [
{
mountPath = "/data"
name = "host-path"
readOnly = false
}
]

env = concat(var.static_env, [
{
Expand Down Expand Up @@ -67,8 +74,20 @@ module "gce-container" {
name = "MPC_GCP_PROJECT_ID"
value = var.project_id
},
{
name = "MPC_REDIS_URL",
value = var.redis_url
}
])
}
volumes = [
{
name = "host-path"
hostPath = {
path = "/var/redis"
}
}
]
}

resource "google_service_account" "service_account" {
Expand Down
7 changes: 6 additions & 1 deletion infra/multichain-testnet/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ variable "static_env" {
default = [
{
name = "MPC_NEAR_RPC"
value = "https://rpc.testnet.near.org"
value = "https://rpc.testnet.fastnear.com"
},
{
name = "MPC_CONTRACT_ID"
Expand Down Expand Up @@ -130,3 +130,8 @@ variable "create_network" {
default = false
description = "Do you want to create a new VPC network (true) or use default GCP network (false)?"
}

variable "redis_url" {
type = string
default = "redis://127.0.0.1:6379"
}
23 changes: 21 additions & 2 deletions infra/partner-mainnet/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,15 @@ module "gce-container" {

container = {
image = var.image
args = ["start"]
port = "3000"

port = "3000"
volumeMounts = [
{
mountPath = "/data"
name = "host-path"
readOnly = false
}
]

env = concat(var.static_env, [
{
Expand Down Expand Up @@ -63,9 +70,21 @@ module "gce-container" {
{
name = "MPC_ENV",
value = var.env
},
{
name = "MPC_REDIS_URL",
value = var.redis_url
}
])
}
volumes = [
{
name = "host-path"
hostPath = {
path = "/var/redis"
}
}
]
}

resource "google_service_account" "service_account" {
Expand Down
7 changes: 6 additions & 1 deletion infra/partner-mainnet/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ variable "static_env" {
default = [
{
name = "MPC_NEAR_RPC"
value = "https://rpc.mainnet.near.org"
value = "https://rpc.mainnet.fastnear.com"
},
{
name = "MPC_CONTRACT_ID"
Expand Down Expand Up @@ -144,3 +144,8 @@ variable "domain" {
description = "DNS name for your node"
default = ""
}

variable "redis_url" {
type = string
default = "redis://127.0.0.1:6379"
}
23 changes: 21 additions & 2 deletions infra/partner-testnet/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,15 @@ module "gce-container" {

container = {
image = var.image
args = ["start"]
port = "3000"

port = "3000"
volumeMounts = [
{
mountPath = "/data"
name = "host-path"
readOnly = false
}
]

env = concat(var.static_env, [
{
Expand Down Expand Up @@ -63,9 +70,21 @@ module "gce-container" {
{
name = "MPC_ENV",
value = var.env
},
{
name = "MPC_REDIS_URL",
value = var.redis_url
}
])
}
volumes = [
{
name = "host-path"
hostPath = {
path = "/var/redis"
}
}
]
}

resource "google_service_account" "service_account" {
Expand Down
7 changes: 6 additions & 1 deletion infra/partner-testnet/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ variable "static_env" {
default = [
{
name = "MPC_NEAR_RPC"
value = "https://rpc.testnet.near.org"
value = "https://rpc.testnet.fastnear.com"
},
{
name = "MPC_CONTRACT_ID"
Expand Down Expand Up @@ -132,3 +132,8 @@ variable "create_network" {
default = false
description = "Do you want to create a new VPC network (true) or use default GCP network (false)?"
}

variable "redis_url" {
type = string
default = "redis://127.0.0.1:6379"
}

0 comments on commit f3af774

Please sign in to comment.