Skip to content

Commit

Permalink
Update docs/README.md and add file path
Browse files Browse the repository at this point in the history
  • Loading branch information
adrien.boulay committed Sep 3, 2020
1 parent 81b4719 commit 52dab8c
Show file tree
Hide file tree
Showing 6 changed files with 146 additions and 41 deletions.
36 changes: 36 additions & 0 deletions docs/How_to_run_locally.md
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
```
42 changes: 42 additions & 0 deletions docs/How_to_run_on_AWS.md
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
```
20 changes: 20 additions & 0 deletions docs/Project_organization.md
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
59 changes: 18 additions & 41 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,40 +2,24 @@

## Table of Contents

- [Project organization](#project-organization)
- [Run services locally on the machine](#run-services-locally-on-the-machine)
- [Build all services](#build-all-services)
- [Tests all services](#tests-all-services)
- [Frontend](#frontend)
- [Services](#services)
- [API](#api)
- [Proxy](#proxy)
- [Snapshot exporter](#snapshot-exporter)
- [Infrastructure](#infrastructure)
- [Architecture](#architecture)
- [Requirements](#requirements)
- [How To Deploy](#how-to-deploy)
- [Documentation](#documentation)
- [References](#references)

## Project Organization

The repository is currently following this organization:
1 - [Project organization](./Project_organization.md)

```
.
├── 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
```
2 - [Architecture](./Architecture.md)

3 - [Run the project on the machine](./How_to_run_locally.md)

4 - [Deploy the project on a cloud provider](./How_to_deploy_on_AWS.md)

5 - [Services](./services)
- [API](./services/API.md)
- [Proxy](./services/Proxy.md)
- [Frontend](./services/Frontend.md)

6 - [Lambdas](./lambdas)
- [Snapshot exporter](./lambdas/Snapshot_Exporter.md)
- [Metrics cleaner](./lambdas/Metrics_Cleaner.md)

A - [References](./References)

## Run services locally on the machine with mockup blockchain node

Expand Down Expand Up @@ -227,11 +211,4 @@ $> terragrunt plan

# To apply the change
$> terragrunt apply
```

## References

This repo took some ideas & code from:

- https://github.com/tezexInfo/TezProxy
- https://github.com/AymericBethencourt/serverless-mern-stack/
```
9 changes: 9 additions & 0 deletions docs/References.md
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
21 changes: 21 additions & 0 deletions docs/services/Proxy.md
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`)

0 comments on commit 52dab8c

Please sign in to comment.