-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
05d8b63
commit 04e765c
Showing
27 changed files
with
464 additions
and
200 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
node_modules/ | ||
dist/ | ||
vendor/ | ||
cache/ | ||
.*/ | ||
*.min.* | ||
*.test.* | ||
*.spec.* | ||
*.bundle.* | ||
*.bundle-min.* | ||
*.*.js | ||
*.*.ts | ||
*.log |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# This is a auto-generated file. Do not edit! | ||
|
||
services: | ||
wallet: | ||
image: antonpegov/zeropool-frontend:${VERSION} | ||
container_name: wallet-${NETWORK_NAME} | ||
restart: always | ||
environment: | ||
- REACT_APP_TOKEN=${TOKEN_NAME} | ||
- REACT_APP_NETWORK=${NETWORK} | ||
- REACT_APP_NETWORK_NAME=${NETWORK_NAME} | ||
- REACT_APP_NETWORK_FAUCET=${FAUCET} | ||
- REACT_APP_RPC_URL=${RPC_HOST} | ||
- REACT_APP_RELAYER_URL=${RELAYER} | ||
- REACT_APP_TOKEN_ADDRESS=${TOKEN} | ||
- REACT_APP_CONTRACT_ADDRESS=${CONTRACT} | ||
- REACT_APP_PUBLIC_URL=/ | ||
- REACT_APP_TRANSACTION_URL=${TRANSACTION} | ||
- VIRTUAL_HOST=${VIRTUAL_HOST} | ||
- LETSENCRYPT_HOST=${VIRTUAL_HOST} | ||
- [email protected] | ||
volumes: | ||
- /root/params:/usr/share/nginx/html/assets | ||
|
||
networks: | ||
default: | ||
external: true | ||
name: zeropool-testnet |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
terraform { | ||
required_providers { | ||
docker = { | ||
source = "kreuzwerker/docker" | ||
version = "~> 3.0.1" | ||
} | ||
} | ||
} | ||
|
||
provider "docker" { | ||
host = "ssh://zp.dev" | ||
} | ||
|
||
locals { | ||
// List of environments and related IP's | ||
envs = { | ||
dev = "45.131.67.82", | ||
test = "45.131.67.83", | ||
prod = "45.131.67.84", | ||
} | ||
compose = base64encode(templatefile("${path.module}/_compose.yml.tmpl", { | ||
// Take value from environment variable VIRTUAL_HOST and change it's 'ENV' part to value from environment variable ENV | ||
VIRTUAL_HOST = replace(var.VIRTUAL_HOST, "ENV", var.ENV), | ||
NETWORK_NAME = var.NETWORK_NAME, | ||
TRANSACTION = var.TRANSACTION, | ||
TOKEN_NAME = var.TOKEN_NAME, | ||
CONTRACT = var.CONTRACT, | ||
RPC_HOST = var.RPC_HOST, | ||
VERSION = var.VERSION, | ||
NETWORK = var.NETWORK, | ||
RELAYER = var.RELAYER, | ||
FAUCET = var.FAUCET, | ||
TOKEN = var.TOKEN, | ||
})) | ||
} | ||
|
||
resource "null_resource" "this" { | ||
provisioner "remote-exec" { | ||
inline = [ | ||
"set -e", | ||
"mkdir -p ~/wallet", | ||
"docker compose -f ~/wallet/docker-compose-${var.NETWORK}.yml down || true", | ||
"rm -f ~/wallet/docker-compose-${var.NETWORK}.yml", | ||
"sudo bash -c 'echo ${local.compose} | base64 --decode > ~/wallet/docker-compose-${var.NETWORK}.yml'", | ||
"docker network create zeropool-testnet || true", | ||
"docker compose -f ~/wallet/docker-compose-${var.NETWORK}.yml pull", | ||
"docker compose -f ~/wallet/docker-compose-${var.NETWORK}.yml up -d", | ||
] | ||
|
||
connection { | ||
type = "ssh" | ||
user = "root" # Replace with your SSH username | ||
private_key = file("~/.ssh/zeropool") # Specify your private key path | ||
host = local.envs[var.ENV] # Replace with your instance's IP or DNS | ||
timeout = "2m" # Set a timeout to wait for the SSH connection | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/usr/bin/env bash | ||
set -e | ||
|
||
if [ -z "$1" ]; then | ||
echo "No environment supplied" | ||
exit 1 | ||
fi | ||
|
||
if [ -z "$2" ]; then | ||
echo "No version supplied" | ||
fi | ||
|
||
echo "Terraforming $2 on $1 environment" | ||
|
||
case "$1" in | ||
prod|dev|test) | ||
;; | ||
*) | ||
echo "Invalid environment: $1. It should be one of: prod, dev, test." | ||
exit 1 | ||
;; | ||
esac | ||
|
||
terraform apply -auto-approve -replace="null_resource.this" -var-file='_sepolia.tfvars' -var="VERSION=$2" -var="ENV=$1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
RPC_HOST = "https://sepolia.rpc.zeropool.network" | ||
VIRTUAL_HOST = "sepolia.testnet.frontend.ENV.v2.zeropool.network" | ||
|
||
NETWORK_NAME = "Sepolia" # TODO: rename to "sepolia" | ||
TOKEN_NAME = "eth" | ||
NETWORK = "ethereum" | ||
|
||
TOKEN = "0x25004028Dd2743FF487454eAB2216d3495667189" | ||
FAUCET = "https://sepoliafaucet.com" | ||
RELAYER = "https://sepolia.testnet.relayer.v2.zeropool.network" | ||
CONTRACT = "0xEcbD5fabA99139B2cA25f19B568fF74991a01eD3" | ||
TRANSACTION = "https://sepolia.etherscan.io/tx/{{hash}}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
|
||
variable "RPC_HOST" { | ||
type = string | ||
default = "https://sepolia.rpc.zeropool.network" | ||
} | ||
|
||
variable "VIRTUAL_HOST" { | ||
type = string | ||
default = "sepolia.testnet.frontend.ENV.v2.zeropool.network" | ||
} | ||
|
||
variable "NETWORK_NAME" { | ||
type = string | ||
default = "sepolia" | ||
} | ||
|
||
variable "TOKEN_NAME" { | ||
type = string | ||
default = "eth" | ||
} | ||
|
||
variable "NETWORK" { | ||
type = string | ||
default = "ethereum" | ||
} | ||
|
||
variable "TOKEN" { | ||
type = string | ||
default = "0x25004028Dd2743FF487454eAB2216d3495667189" | ||
} | ||
|
||
variable "FAUCET" { | ||
type = string | ||
default = "https://sepoliafaucet.com" | ||
} | ||
|
||
variable "RELAYER" { | ||
type = string | ||
default = "https://sepolia.testnet.relayer.v2.zeropool.network" | ||
} | ||
|
||
variable "CONTRACT" { | ||
type = string | ||
default = "0xEcbD5fabA99139B2cA25f19B568fF74991a01eD3" | ||
} | ||
|
||
variable "TRANSACTION" { | ||
type = string | ||
default = "https://sepolia.etherscan.io/tx/{{hash}}" | ||
} | ||
|
||
variable "ENV" { | ||
type = string | ||
default = "dev" | ||
} | ||
|
||
variable "VERSION" { | ||
type = string | ||
default = "antonpegov/zeropool-frontend:latest" | ||
} |
Oops, something went wrong.