Permalink
Browse files

feat: EOS 1.4 and microservices architecture (#7)

* feat: move microservices structure

* refactor: use monstereos base

* docs(readme): update features section

* refactor(demux): fix tslint errors

* docs(readme): update gulp scripts section

* docs(readme): improve contributing section

* docs(readme): add reactjs client details

* docs(readme): add CI and CD to feature list

* refactor(frontend): update dependencies

* refactor: upgrade EOS nodes to 1.4.1

* docs(readme): general updates

* fix: account names length
  • Loading branch information...
gaboesquivel authored and rubenabix committed Oct 27, 2018
1 parent 2864b38 commit c56476b071a7894f5b778a8a9e989e8fbb251d8a
Showing with 19,257 additions and 889 deletions.
  1. +23 βˆ’0 .all-contributorsrc
  2. +6 βˆ’10 .editorconfig
  3. +24 βˆ’15 .gitignore
  4. +0 βˆ’1 .node-version
  5. +12 βˆ’0 .travis.yml
  6. +2 βˆ’62 CONTRIBUTING.md
  7. +139 βˆ’20 README.md
  8. +1 βˆ’1 cleos.sh
  9. +5 βˆ’0 contributing.md
  10. +97 βˆ’34 docker-compose.yml
  11. +2 βˆ’0 flush.sh
  12. +21 βˆ’0 license
  13. +21 βˆ’0 netlify.toml
  14. +0 βˆ’31 package.json
  15. +202 βˆ’0 readme.md
  16. +17 βˆ’0 scripts/cleos.sh
  17. +35 βˆ’0 services/demux/Dockerfile
  18. +13 βˆ’0 services/demux/database/migrations/0001_create.sql
  19. +20 βˆ’0 services/demux/migrate.sh
  20. +82 βˆ’0 services/demux/package.json
  21. +39 βˆ’0 services/demux/pm2.config.js
  22. +3 βˆ’0 services/demux/readme.md
  23. +92 βˆ’0 services/demux/src/MongoActionReader.ts
  24. +88 βˆ’0 services/demux/src/MongoBlock.ts
  25. +12 βˆ’0 services/demux/src/effects.ts
  26. +74 βˆ’0 services/demux/src/index.ts
  27. +61 βˆ’0 services/demux/src/services/data-cleaner.ts
  28. +30 βˆ’0 services/demux/src/services/postgraphile.ts
  29. +31 βˆ’0 services/demux/src/updaters.ts
  30. +3 βˆ’0 services/demux/start.sh
  31. +59 βˆ’0 services/demux/tsconfig.json
  32. +13 βˆ’0 services/demux/tslint.json
  33. +5,533 βˆ’0 services/demux/yarn.lock
  34. +15 βˆ’0 services/eos-dev/Dockerfile
  35. +168 βˆ’0 services/eos-dev/config/config.ini
  36. +7 βˆ’0 services/eos-dev/contracts/.clang-format
  37. +36 βˆ’0 services/eos-dev/contracts/.gitignore
  38. +42 βˆ’0 services/eos-dev/contracts/CMakeLists.txt
  39. +14 βˆ’0 services/eos-dev/contracts/UnitTestsExternalProject.txt
  40. +15 βˆ’0 services/eos-dev/contracts/build.sh
  41. +2 βˆ’0 services/eos-dev/contracts/eoslocal/readme.md
  42. 0 services/eos-dev/contracts/tests/.keep
  43. +163 βˆ’0 services/eos-dev/scripts/0000_init-chain.sh
  44. +51 βˆ’0 services/eos-dev/scripts/init_wallet.sh
  45. +7 βˆ’0 services/eos-dev/start.sh
  46. +19 βˆ’0 services/eos-node/Dockerfile
  47. +81 βˆ’0 services/eos-node/config-full-node.ini
  48. +137 βˆ’0 services/eos-node/config-main-node.ini
  49. +94 βˆ’0 services/eos-node/config.ini
  50. +23 βˆ’0 services/eos-node/genesis.json
  51. +23 βˆ’0 services/eos-node/mainnet-genesis.json
  52. +7 βˆ’0 services/eos-node/start.sh
  53. +2 βˆ’0 services/frontend/.env
  54. +11 βˆ’0 services/frontend/.eslintrc
  55. +21 βˆ’0 services/frontend/.gitignore
  56. +1 βˆ’0 services/frontend/.node-version
  57. +35 βˆ’0 services/frontend/Dockerfile
  58. +8 βˆ’0 services/frontend/config-overrides.js
  59. +71 βˆ’0 services/frontend/package.json
  60. BIN services/frontend/public/favicon.ico
  61. +24 βˆ’0 services/frontend/public/index.html
  62. +15 βˆ’0 services/frontend/public/manifest.json
  63. +61 βˆ’0 services/frontend/readme.md
  64. +19 βˆ’0 services/frontend/src/app.js
  65. +113 βˆ’0 services/frontend/src/components/app-bar.js
  66. +12 βˆ’0 services/frontend/src/components/button.js
  67. +21 βˆ’0 services/frontend/src/components/checkbox.js
  68. +7 βˆ’0 services/frontend/src/components/form-control.js
  69. +38 βˆ’0 services/frontend/src/components/icon/index.js
  70. +1 βˆ’0 services/frontend/src/components/icon/menu.svg
  71. +69 βˆ’0 services/frontend/src/components/layout.js
  72. +159 βˆ’0 services/frontend/src/components/main-drawer.js
  73. +32 βˆ’0 services/frontend/src/components/select.js
  74. +13 βˆ’0 services/frontend/src/components/text-field.js
  75. +21 βˆ’0 services/frontend/src/config/i18n.js
  76. +20 βˆ’0 services/frontend/src/config/store.js
  77. +7 βˆ’0 services/frontend/src/config/theme.js
  78. +30 βˆ’0 services/frontend/src/index.js
  79. +17 βˆ’0 services/frontend/src/language/en.json
  80. +17 βˆ’0 services/frontend/src/language/es.json
  81. +7 βˆ’0 services/frontend/src/language/index.js
  82. +3 βˆ’0 services/frontend/src/models/index.js
  83. +36 βˆ’0 services/frontend/src/models/location.js
  84. +31 βˆ’0 services/frontend/src/models/session.js
  85. +19 βˆ’0 services/frontend/src/models/settings.js
  86. +31 βˆ’0 services/frontend/src/routes/account/index.js
  87. +11 βˆ’0 services/frontend/src/routes/home/index.js
  88. +20 βˆ’0 services/frontend/src/routes/index.js
  89. +11 βˆ’0 services/frontend/src/routes/not-found/index.js
  90. +98 βˆ’0 services/frontend/src/routes/settings/index.js
  91. +127 βˆ’0 services/frontend/src/serviceWorker.js
  92. +7 βˆ’0 services/frontend/src/services/graphql.js
  93. +49 βˆ’0 services/frontend/src/services/scatter.js
  94. 0 services/frontend/src/utils/.keep
  95. +10,258 βˆ’0 services/frontend/yarn.lock
  96. +31 βˆ’0 setup.sh
  97. +7 βˆ’0 start.sh
  98. +2 βˆ’0 stop.sh
  99. +0 βˆ’715 yarn.lock
@@ -33,6 +33,19 @@
"review"
]
},
{
"login": "murillojorge",
"name": "Jorge Murillo",
"avatar_url": "https://avatars1.githubusercontent.com/u/1179619?v=4",
"profile": "https://github.com/murillojorge",
"contributions": [
"ideas",
"doc",
"design",
"code",
"review"
]
},
{
"login": "xavier506",
"name": "Xavier Fernandez",
@@ -44,6 +57,16 @@
"talk",
"infra"
]
},
{
"login": "rubenabix",
"name": "RubΓ©n Abarca Navarro",
"avatar_url": "https://avatars2.githubusercontent.com/u/13205620?v=4",
"profile": "https://github.com/rubenabix",
"contributions": [
"ideas",
"review"
]
}
]
}
@@ -1,22 +1,18 @@
# EditorConfig helps developers define and maintain consistent
# coding styles between different editors and IDEs.
# editorconfig.org

# http://editorconfig.org
root = true

[*]

# We recommend you to keep these unchanged.
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = true
max_line_length = 130
trim_trailing_whitespace = true

[package.json]
indent_style = space
indent_size = 2

[*.md]
max_line_length = 0
trim_trailing_whitespace = false

[COMMIT_EDITMSG]
max_line_length = 72
@@ -1,21 +1,30 @@
node_modules
# Compiled codes
build/
dist/
*.wast

*~
*#
.DS_STORE
Thumbs.db
.netbeans
nbproject
# IDE's
.vscode
.idea
.node_history
*.iml

*.seed
# Dependency directories
node_modules
*.log
*.out
*.pid
npm-debug.log

package-lock.json
# Desktop Services Store on macOS
.DS_Store

# Temp
temp
.mongo-data
.pgsql-data

# database data
.dbdata/

# wallet keys
keys

# This is where we will be creating and storing our EOS local keys
keys/
# netlify cli
.netlify/

This file was deleted.

Oops, something went wrong.
@@ -0,0 +1,12 @@
sudo: required

services:
- docker

install:
- docker build -t eoslocal/demux ./services/demux
- docker build -t eoslocal/frontend ./services/frontend

script:
- docker run eoslocal/demux yarn lint
- docker run eoslocal/frontend yarn lint
@@ -1,65 +1,5 @@
# Contributing

<!-- START doctoc generated TOC please keep comment here to allow auto update -->
We follow EOS Costa Rica's Open Source Contributing Guidelines.

<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->

## Contents

* [Reporting bugs](#reporting-bugs)
* [Git Workflow](#git-workflow)
* [Pull Request General Guidelines](#pull-request-general-guidelines)
* [Commit Standards](#commit-standards)
* [Working on Your First Pull Request?](#working-on-your-first-pull-request)
* [Advanced Git tools](#advanced-git-tools)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

## Reporting bugs

Before submitting your issue please check that you've completed the following steps:

* Made sure you're on the latest version
* Used the search feature to ensure that the bug hasn't been reported before

Bug reports should contain the following information:

* Summary: A brief description.
* Steps to reproduce: How did you encounter the bug? Instructions to reproduce it.
* Expected behavior: How did you expect it to behave?
* Actual behavior: How did it actually behave?
* References: Links to any related tickets or information sources.
* If possible, attach visual documentation of the bug. Screenshot or animated gif

## Development Process

At EOS Costa Rica we use Github's Projects board to prioritize the work and the standard Github Flow https://guides.github.com/introduction/flow/ for code changes.

![](https://gaboesquivel.com/img/2018/05/github-flow.png)

## Pull Request General Guidelines

* Please check to make sure that there aren't existing pull requests attempting to address the issue mentioned.
* Check for related issues on the issue tracker.
* Non-trivial changes should be discussed on an issue first.
* Let us know you're working on the issue.
* Develop in a topic branch, not master.
* Provide useful pull request description
* Write a good description of your PR.
* Make well scoped pull requests. 1 PR per feature of bug fix.
* Reference the github issue on the pull request description.

### Commit Standards

* Make atomic commits, don't mix unrelated code changes.
* Provide useful commit messages.
* Provide a short commit message in the first line (50-100 character). Looking at the output of `gitk` or `git log --oneline` might help you understand why.

### Working on Your First Pull Request?

You can learn how from this _free_ series [How to Contribute to an Open Source Project on GitHub](https://egghead.io/series/how-to-contribute-to-an-open-source-project-on-github)

## Advanced Git tools

There are also tools like [Hub](https://hub.github.com/) and [git-extras](https://github.com/tj/git-extras) that facilitate interacting with Github.
You can leverage these tools to contribute to this repository.
https://learn.eoscostarica.io/open-source/
159 README.md
@@ -23,39 +23,154 @@
# EOS Local

A docker compose based development environment for EOS DApp Development.

This is easiest way maintain a local environment for development that is guaranteed to work out-of-the-box across the different host operating systems: Mac OS, Windows and Linux.

**Important Disclaimer: This is a Work in Progress**
**Important Disclaimer: This is a Work in Progress**

EOS Local is a community-driven project lead by EOS Costa Rica. We welcome contributions of all sorts. There are many ways to help, from reporting issues, proposing features, improving documentation, contributing code, design/ux proposals.

Most recent developments can be found in the [fast-forward-env](https://github.com/eoscostarica/eos-dapp-dev-env/tree/fast-forward-env) branch.
A common reusable docker based microservices architecture boilerplate and development environment that will allow to deploy EOS appliactions faster.

Please follow the [EOS 1.4 and Microservices Architecture](https://github.com/eoscostarica/eos-local/pull/7)
It's based on MonsterEOS EOSIO DreamStack architecture.

## Features

- fully virtualized EOS blockchain development environment.
- microservices architecture with docker compose with:
- nginx reverse proxy for virtual host resolution from the host machine.
- network specific service aliases for "virtual host" resolution within the containers.
- out-of-box services:
- postgres database
- mongodb database
- demux
- eos-dev node for contract dev and compilation
- eos fullnode with history
- graphql endpoint
- reactjs client
- handy scripts for interacting with the local EOS services.
- gulp as task manager.
- Fully virtualized EOS blockchain development environment.
- Fnteligent automated blockchain replay. ( no more replay flag shenanigans )
- Microservices architecture with docker compose with:
- Nginx reverse proxy for virtual host resolution from the host machine.
- Network specific service aliases for "virtual host" resolution within the containers.
- Out-of-box services:
- Postgres database.
- Mongodb database.
- Demux service.
- Eos-dev node for contract dev and compilation.
- Eos fullnode with history.
- Graphql endpoint.
- reactjs client with:
- Scatter integration.
- Lynx integration.
- Eosaccount profile page.
- Material UI.
- GraphQL Apollo client.
- Handy scripts for interacting with the local EOS services.
- Gulp as global task manager.
- Automated code linting and testing.
- Continuous Integration and Deployment. ( Travis and Netlify )

## Getting started

Basic knowledge about Docker, Docker Compose, EOS and NodeJS is required to use this environment.

Please look at our [Getting Started With EOS]

**Global Dependencies**

- Docker https://docs.docker.com/install/.
At least 7GB RAM (Docker -> Preferences -> Advanced -> Memory -> 7GB or above)
- Install node.js v8 ( carbon ) on your machine.
We recommend using [nvm](https://github.com/creationix/nvm) and [avn](https://github.com/wbyoung/avn) to [manage multiple node.js versions on your computer](https://gaboesquivel.com/blog/2015/automatic-node.js-version-switching/).
- Yarn https://yarnpkg.com/lang/en/docs/install/.

*Note: at the moment we are not using a docker container for running dapp due to issues related to reloading the app*

**Client Side Dependencies**

- `yarn` install node packages

**Commands**

- `gulp setup` run chain initilization and database migrations.
- `gulp start` starts the docker containers with nodeos and keosd processes.
- `gulp stop` stops and removes all containers.
- `gulp restart` restarts all services.
- `gulp flush` remove all blockchain and database data.
- `gulp cleos` executes cleos on the virtualized environment against the eosiodev node.

Eg:

```shell
➜ eos-dapp-dev-env git:(master) yarn cleos get info
yarn run v1.5.1
$ ./cleos.sh get info
{
"server_version": "ad4ba283",
"chain_id": "cf057bbfb72640471fd910bcb67639c22df9f92470936cddc1ade0e2f2e7dc4f",
"head_block_num": 166769,
"last_irreversible_block_num": 166768,
"last_irreversible_block_id": "00028b701ab37605eb05fc3735a185c8cb1087d58a53f162cbae02f25918299f",
"head_block_id": "00028b7148565b4056e20566a9e96187c9157dc30a3b758dc6ab795b39f0656e",
"head_block_time": "2018-08-10T13:07:48.500",
"head_block_producer": "eosio",
"virtual_block_cpu_limit": 200000000,
"virtual_block_net_limit": 1048576000,
"block_cpu_limit": 199900,
"block_net_limit": 1048576
}
```

## Directory Structure

```
.
β”œβ”€β”€ docs/ .............................................. documentation files and media
β”œβ”€β”€ services/ .......................................... microservices
| β”œβ”€β”€ eosiodev/ ........................................ eos node for contact development
| | β”œβ”€β”€ config/ ........................................ eos node config
| | β”œβ”€β”€ contracts/ ..................................... smart contracts
| └── frontend/ ........................................ reactjs frontend
| β”œβ”€β”€ public/ ........................................ static and public files
| β”œβ”€β”€ src/ ........................................... reactjs views and components
| β”œβ”€β”€ config-overrides.js ............................ configuration overrides for `cra`
| β”œβ”€β”€ .env ........................................... environment variables
| β”œβ”€β”€ .eslintrc ...................................... code style rules
| └── package.json ................................... dependencies manifest
β”œβ”€β”€ docker-compose.yaml ................................ docker compose for local dev
β”œβ”€β”€ contributing.md .................................... contributing guidelines
β”œβ”€β”€ LICENSE ............................................ project license
β”œβ”€β”€ README.md .......................................... project homepage
β”œβ”€β”€ netlify.toml ....................................... netlify configuration file
└── .travis.yml ........................................ travis ci configuration file
```

## Services

### demux

https://eosio.github.io/demux-js/

### eosiodev

### fullnode

### postgres

### mongodb

https://developers.eos.io/eosio-nodeos/docs/local-single-node-testnet

## EOS Documentation & Resources

- https://developers.eos.io
- https://learn.eoscostarica.io
- https://github.com/slowmist/eos-smart-contract-security-best-practices
- https://nadejde.github.io/eos-token-sale

## Contributing

Read the [contributing guidelines](CONTRIBUTING.md) for details.

We use a Kanban-style board with built-in triggers to automatically move issues and pull requests across New Issues, To Do, In Progress and Done columns. That's were we prioritize the work. [Go to Project Board](https://github.com/eoscostarica/eos-local/projects/3).

The main communication channels for organizing and collaborating are [github issues](https://github.com/eoscostarica/eos-local/issues) and the [EOS Costa Rica Discord server](https://eoscostarica.io/discord). Feel to join and ask as many questions you may have.


We follow EOS Costa Rica's Open Source Contributing Guidelines. https://learn.eoscostarica.io/open-source/

Our weekly sync call is every Monday 7pm-8pm Costa Rica / Central Standard Time at [meet.eoscostarica.io](https:/meet.eoscostarica.io).

Please report bugs big and small by [opening an issue](https://github.com/eoscostarica/eos-local/issues)


## About EOS Costa Rica

@@ -67,12 +182,16 @@ We challenge ourselves to provide the EOS platform with a strong geographical an

[eoscostarica.io](https://eoscostarica.io)

## License

MIT Β© [EOS Costa Rica](https://eoscostarica.io)

## Contributors

<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
<!-- prettier-ignore -->
| [<img src="https://avatars0.githubusercontent.com/u/391270?v=4" width="100px;"/><br /><sub><b>Gabo Esquivel</b></sub>](https://gaboesquivel.com)<br />[πŸ€”](#ideas-gaboesquivel "Ideas, Planning, & Feedback") [πŸ“–](https://github.com/eoscostarica/eos-dapp-dev-env/commits?author=gaboesquivel "Documentation") [πŸ’»](https://github.com/eoscostarica/eos-dapp-dev-env/commits?author=gaboesquivel "Code") [πŸ‘€](#review-gaboesquivel "Reviewed Pull Requests") | [<img src="https://avatars2.githubusercontent.com/u/349542?v=4" width="100px;"/><br /><sub><b>Daniel Prado</b></sub>](https://github.com/danazkari)<br />[πŸ’»](https://github.com/eoscostarica/eos-dapp-dev-env/commits?author=danazkari "Code") [πŸ“–](https://github.com/eoscostarica/eos-dapp-dev-env/commits?author=danazkari "Documentation") [πŸ€”](#ideas-danazkari "Ideas, Planning, & Feedback") [πŸ‘€](#review-danazkari "Reviewed Pull Requests") | [<img src="https://avatars0.githubusercontent.com/u/5632966?v=4" width="100px;"/><br /><sub><b>Xavier Fernandez</b></sub>](https://github.com/xavier506)<br />[πŸ€”](#ideas-xavier506 "Ideas, Planning, & Feedback") [πŸ“](#blog-xavier506 "Blogposts") [πŸ“’](#talk-xavier506 "Talks") [πŸš‡](#infra-xavier506 "Infrastructure (Hosting, Build-Tools, etc)") |
| :---: | :---: | :---: |
| [<img src="https://avatars0.githubusercontent.com/u/391270?v=4" width="100px;"/><br /><sub><b>Gabo Esquivel</b></sub>](https://gaboesquivel.com)<br />[πŸ€”](#ideas-gaboesquivel "Ideas, Planning, & Feedback") [πŸ“–](https://github.com/eoscostarica/eos-dapp-dev-env/commits?author=gaboesquivel "Documentation") [πŸ’»](https://github.com/eoscostarica/eos-dapp-dev-env/commits?author=gaboesquivel "Code") [πŸ‘€](#review-gaboesquivel "Reviewed Pull Requests") | [<img src="https://avatars2.githubusercontent.com/u/349542?v=4" width="100px;"/><br /><sub><b>Daniel Prado</b></sub>](https://github.com/danazkari)<br />[πŸ’»](https://github.com/eoscostarica/eos-dapp-dev-env/commits?author=danazkari "Code") [πŸ“–](https://github.com/eoscostarica/eos-dapp-dev-env/commits?author=danazkari "Documentation") [πŸ€”](#ideas-danazkari "Ideas, Planning, & Feedback") [πŸ‘€](#review-danazkari "Reviewed Pull Requests") | [<img src="https://avatars1.githubusercontent.com/u/1179619?v=4" width="100px;"/><br /><sub><b>Jorge Murillo</b></sub>](https://github.com/murillojorge)<br />[πŸ€”](#ideas-murillojorge "Ideas, Planning, & Feedback") [πŸ“–](https://github.com/eoscostarica/eos-dapp-dev-env/commits?author=murillojorge "Documentation") [🎨](#design-murillojorge "Design") [πŸ’»](https://github.com/eoscostarica/eos-dapp-dev-env/commits?author=murillojorge "Code") [πŸ‘€](#review-murillojorge "Reviewed Pull Requests") | [<img src="https://avatars0.githubusercontent.com/u/5632966?v=4" width="100px;"/><br /><sub><b>Xavier Fernandez</b></sub>](https://github.com/xavier506)<br />[πŸ€”](#ideas-xavier506 "Ideas, Planning, & Feedback") [πŸ“](#blog-xavier506 "Blogposts") [πŸ“’](#talk-xavier506 "Talks") [πŸš‡](#infra-xavier506 "Infrastructure (Hosting, Build-Tools, etc)") | [<img src="https://avatars2.githubusercontent.com/u/13205620?v=4" width="100px;"/><br /><sub><b>RubΓ©n Abarca Navarro</b></sub>](https://github.com/rubenabix)<br />[πŸ€”](#ideas-rubenabix "Ideas, Planning, & Feedback") [πŸ‘€](#review-rubenabix "Reviewed Pull Requests") |
| :---: | :---: | :---: | :---: | :---: |
<!-- ALL-CONTRIBUTORS-LIST:END -->
Thanks goes to these wonderful people ([emoji key](https://github.com/kentcdodds/all-contributors#emoji-key)):

@@ -4,7 +4,7 @@
# Go into cmd loop: sudo ./cleos.sh
# Run single cmd: sudo ./cleos.sh <cleos paramers>

PREFIX="docker-compose exec keosd cleos --url http://nodeosd:8888"
PREFIX="docker-compose exec eosiodev cleos --url http://localhost:8888"
if [ -z $1 ] ; then
while :
do
Oops, something went wrong.

0 comments on commit c56476b

Please sign in to comment.