-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update docs/README.md and add file path
- Loading branch information
adrien.boulay
committed
Sep 3, 2020
1 parent
81b4719
commit 52dab8c
Showing
6 changed files
with
146 additions
and
41 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Local deployment of the service | ||
|
||
> Blockchain nodes are mocked up for development environment the be as lightweight as possible. | ||
## Requirements | ||
|
||
- `Docker` | ||
- `docker-compose` | ||
- `Yarn` (setup with 1.22.0) | ||
- `Golang` (setup with 1.13) | ||
- `GNU Make` (setup with 3.81) | ||
- `Node.js` (setup with 11.14.0) | ||
|
||
## How to | ||
|
||
To run services locally on the machine, you will need to run those commands : | ||
|
||
```bash | ||
$> make deps | ||
$> make build-docker | ||
$> make run-dev | ||
``` | ||
|
||
It will run: | ||
|
||
- `tezos-link_proxy` | ||
- `tezos-link_proxy-carthagenet` | ||
- `tezos-link_api` | ||
- `mockserver/mockserver:mockserver-5.9.0` (mocking a blockchain node) | ||
- `postgres:9.6` | ||
|
||
The only endpoint served by the blockchain mock is: | ||
|
||
```bash | ||
curl -X PUT localhost:8001/v1/<YOUR_PROJECT_ID>/mockserver/status | ||
``` |
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,42 @@ | ||
# How to deploy | ||
|
||
< TODO : To improve> | ||
|
||
## Requirements | ||
|
||
- `Terraform` (version == 0.12.20) | ||
- `Terragrunt` (version == 0.21.4) | ||
|
||
> We recommend to install `tf-env` to manage easily your terraform environments. | ||
## Deployment process | ||
|
||
All the files related to the infrastructure are based on the `infra` folder. | ||
|
||
First, you will need to update the configuration (if needed). To do this, you will find `common.tfvars` and `<env>.tfvars` in the folder `infra/terragrunt`. | ||
|
||
> Currently, database password is encrypted inside the file `vaulted.tfvars`. To see it content, you will need ansible-vault and a passphrase to decrypt it with the command `ansible-vault decrypt vaulted.tfvars`. | ||
> | ||
> This will be changed soon with AWS Secret Manager. | ||
When they are updated, we will use Terragrunt to deploy our infrastructure by running: | ||
|
||
```bash | ||
# To check if all is OK | ||
$> terragrunt plan-all | ||
|
||
# To apply the change | ||
$> terragrunt apply-all | ||
``` | ||
|
||
If you want to apply a specific part of the infrastructure (ex: `00_network`), you can run | ||
|
||
```bash | ||
$> cd infra/terragrunt/00_network | ||
|
||
# To check if all is OK | ||
$> terragrunt plan | ||
|
||
# To apply the change | ||
$> terragrunt apply | ||
``` |
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,20 @@ | ||
# Project organization | ||
|
||
The repository is currently following this organization: | ||
|
||
``` | ||
. | ||
├── api # api documentation | ||
├── build # packaging | ||
├── cmd # mains | ||
├── config # config parsers | ||
├── data # config and migrations | ||
├── infra # infrastructure | ||
├── internal # services | ||
├── test # test-specific files | ||
└── web # frontend | ||
└── public | ||
└── docs # usage documentation | ||
``` | ||
|
||
TODO : to write |
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,9 @@ | ||
# References | ||
|
||
Libraries & tools: | ||
- https://github.com/AymericBethencourt/serverless-mern-stack/ | ||
- https://registry.terraform.io/providers/hashicorp/aws/latest/docs | ||
- https://terragrunt.gruntwork.io/ | ||
|
||
Ideas: | ||
- https://github.com/tezexInfo/TezProxy |
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,21 @@ | ||
# Proxy | ||
|
||
- HTTP proxy in front of the nodes | ||
- In-memory (LRU) cache | ||
|
||
## Dependencies | ||
|
||
- `PostgreSQL` (setup with 9.6) | ||
|
||
## Environment variables | ||
|
||
- `DATABASE_URL` (default: `postgres:5432`) | ||
- `DATABASE_USERNAME` (default: `user`) | ||
- `DATABASE_PASSWORD` (default: `pass`) | ||
- `DATABASE_TABLE` (default: `tezoslink`) | ||
- `DATABASE_ADDITIONAL_PARAMETER` (default: `sslmode=disable`) | ||
- `ARCHIVE_NODES_URL` (default: `node`) | ||
- `TEZOS_ARCHIVE_PORT` (default: `1090`) | ||
- `ROLLING_NODES_URL` (default: `node`) | ||
- `TEZOS_ROLLING_PORT` (default: `1090`) | ||
- `SERVER_PORT` (default: `8001`) |