Skip to content

Commit ddc267a

Browse files
committed
Add README
1 parent 876ff00 commit ddc267a

File tree

1 file changed

+94
-0
lines changed

1 file changed

+94
-0
lines changed

mithril-infra/README.md

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
# Mithril infrastructure
2+
3+
**This is a work in progress** :hammer_and_wrench:
4+
5+
This infrastructure creates an ad hoc Mithril network on Google Cloud platform
6+
7+
---
8+
9+
## Pre-requisites
10+
11+
**Install Terraform**
12+
13+
- Install [terraform](https://www.terraform.io/downloads) tools (latest stable version).
14+
15+
16+
## Create a new environment
17+
18+
If you want to run this terraform automation for multiple environments from the same source, you need to create a new workspace:
19+
20+
* Create en env variable:
21+
```bash
22+
DEPLOY_ENVIRONMENT=**new-environment**
23+
```
24+
25+
* Create the terraform worspace if needed:
26+
```bash
27+
terraform workspace new $DEPLOY_ENVIRONMENT
28+
```
29+
30+
* Switch to the terraform worspace if needed:
31+
```bash
32+
terraform workspace select $DEPLOY_ENVIRONMENT
33+
```
34+
35+
* Init terraform state for this workspace:
36+
```bash
37+
terraform init
38+
```
39+
40+
* Create a terraform variable file (and then add the variable values that you want to set):
41+
```bash
42+
touch env.$DEPLOY_ENVIRONMENT.tfvars
43+
```
44+
45+
:warning: You can also add a custom variable value by using the cli arg `-var "var_name=**THE_VALUE**"`
46+
47+
* Lint terraform deployment (optional):
48+
```bash
49+
terraform fmt -check
50+
```
51+
52+
* Plan terraform deployment:
53+
```bash
54+
terraform plan --var-file=env.$DEPLOY_ENVIRONMENT.tfvars
55+
```
56+
57+
* Apply terraform deployment:
58+
```bash
59+
terraform apply --var-file=env.$DEPLOY_ENVIRONMENT.tfvars
60+
```
61+
62+
You should see this output from terraform:
63+
```bash
64+
aggregator_endpoint = "https://aggregator.***.api.mithril.network/aggregator"
65+
api_subdomain = "***.api.mithril.network."
66+
external-ip = "35.195.148.171"
67+
google_project = "mithril"
68+
name_servers = tolist([
69+
"ns-cloud-d1.googledomains.com.",
70+
"ns-cloud-d2.googledomains.com.",
71+
"ns-cloud-d3.googledomains.com.",
72+
"ns-cloud-d4.googledomains.com.",
73+
])
74+
```
75+
76+
You will need to update the `NS` records of the **API sub domain** given by `api_subdomain` with the name servers listed in `name_servers`.
77+
78+
## Destroy an environment
79+
80+
* Destroy terraform deployment (optional):
81+
```bash
82+
terraform destroy --var-file=env.$DEPLOY_ENVIRONMENT.tfvars
83+
```
84+
85+
## Bootstrap a Genesis Certificate (test only)
86+
87+
:warning: This operation will reset and invalidate the current `Certificate Chain`
88+
89+
The commands to run when bootstrapping is:
90+
91+
* Open a bash terminal on the VM and run the following command once connected:
92+
```bash
93+
docker exec mithril-aggregator /app/bin/mithril-aggregator -vvv genesis bootstrap
94+
```

0 commit comments

Comments
 (0)