Skip to content

Commit

Permalink
Merge pull request #137 from MonsterEOS/staging
Browse files Browse the repository at this point in the history
Staging deploy
  • Loading branch information
leordev authored Oct 17, 2018
2 parents afc937a + 5774630 commit 7109098
Show file tree
Hide file tree
Showing 63 changed files with 158 additions and 674,614 deletions.
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,35 +87,35 @@ git clone https://github.com/MonsterEOS/monstereos
cd monstereos
```

You will need to install node (version 8+), yarn and docker.

### Chain and Backend

We structured everything in microservices and it can be automagically initialized by docker! Don't be afraid of docker, a lot of people hear docker and run away but we already did the hard part (configuration) for you. You will just need to install docker in your computer (a simple installer that you will press next next next finish lol).

After you installed docker just run the following commands:

**Start docker container**
```
docker-compose up -d
```

**Create postgres database and init chain and monster data**
**Start docker containers and Create postgres database and init chain and monster data**
```
./setup.sh
```

**Restart docker container**
Now that you have installed everything you can always start the app with the following command:

```
docker-compose restart
./start.sh
```

Open Kitematic (a nice UI for docker containers management that comes by default on docker installation) and you will see all the containers running:
Note: the postgres password is `pass`, you can change it in `docker-compose.yml`

Open [Kitematic](https://docs.docker.com/kitematic/userguide/) (a nice UI for docker containers management that comes by default on docker installation) and you will see all the containers running (or run the command `docker-compose logs -f`):

- eosdev: this is the local single-producer blockchain with basic data (ready for development) and development of the contracts
- fullnode: this is a node that will simulate your mainnet fullnode that will listen for the blockchain and persist data in mongo with mongodb_plugin
- mongo: this is our chain database, fed by fullnode
- postgres: this is our database, the chain is the source of truth, and this is just a cache layer to help our application to query nice and fast reports
- demux: The backend for monstereosio, it consists of the following node services (using pm2):
- demux: this is the blockchain watcher, demux is a tool from Block.one that allows us to watch the blockchain data through MongoDB, manage state saving records to database and also any side effects as submit emails, notifications, external apis etc <3
- demux: this is the blockchain watcher, demux is a tool from Block.one that allows us to watch the blockchain data through MongoDB, manage state saving records to database and also any side effects as submit emails, notifications, external apis etc <3
- postgraphile: we serve data with GraphQL out-of-the-box through postgraphile under port 3030
- data-cleaner: updates data about monsters and battle arenas according to our business rules

Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ services:

demux:
build:
context: .
context: ./services/demux
dockerfile: ./Dockerfile
args:
SERVICE: "demux"
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile → services/demux/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ RUN apk add --no-cache postgresql-client
RUN pm2 install typescript
RUN pm2 install ts-node

COPY ./docker /opt/application/docker
COPY ./services/$SERVICE/package.json /opt/application/node/package.json
COPY ./install-all-local.sh /opt/application/docker/install-all-local.sh
COPY ./package.json /opt/application/node/package.json

WORKDIR /opt/application/node

RUN /opt/application/docker/install-all-local.sh

COPY ./services/$SERVICE /opt/application/node
COPY ./ /opt/application/node

EXPOSE 80

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion services/demux/src/services/data-cleaner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import fetch from "node-fetch"

const BLOCK_SYNC_TOLERANCE = process.env.BLOCK_SYNC_TOLERANCE || 10

const NODEOS = process.env.CHAIN_HOST || "http://localhost:8830"
const NODEOS = process.env.CHAIN_HOST || "http://localhost:8840"
const rpc = new Rpc.JsonRpc(NODEOS, { fetch })

const dbConfig = {
Expand Down
6 changes: 3 additions & 3 deletions services/eos-dev/scripts/playground.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,6 @@ cleos -u http://eosiodev:8888 set contract monstereosmt ../market
cleos -u http://eosiodev:8888 push action eosio.token transfer '["monsterusera", "monstereosio", "1.0000 EOS", "MTT3"]' -p monsterusera

# deploy configs
cleos -u http://localhost:8830 push action monstereosio changemktfee '[100, "Market fee of 1%"]' -p monstereosio
cleos -u http://localhost:8830 push action monstereosio changecreawk '[1, "Awake immediately after creation"]' -p monstereosio
cleos -u http://localhost:8830 push action monstereosio changehungtz '[129601, "Three days of hungerness"]' -p monstereosio
cleos -u http://localhost:8888 push action monstereosio changemktfee '[100, "Market fee of 1%"]' -p monstereosio
cleos -u http://localhost:8888 push action monstereosio changecreawk '[1, "Awake immediately after creation"]' -p monstereosio
cleos -u http://localhost:8888 push action monstereosio changehungtz '[129601, "Three days of hungerness"]' -p monstereosio
2 changes: 1 addition & 1 deletion services/frontend/jungle-build.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
REACT_APP_CHAIN_HOST=dev.cryptolions.io REACT_APP_CHAIN_PORT=38888 REACT_APP_CHAIN_PROTOCOL=http REACT_APP_CHAIN_ID=038f4b0fc8ff18a4f0842a8f0564611f6e96e8535901dd45e43ac8691a1c4dca REACT_APP_HISTORY_URL=http://junglehistory.cryptolions.io:18888 REACT_APP_GRAPHQL_ENDPOINT=http://144.76.165.114:3030/graphql REACT_APP_PAGE_HERO_COLOR=is-success REACT_APP_PAGE_WELCOME="A Wild Animals Tamagotchi and Battle game for EOS JungleNet Blockchain! :)" REACT_APP_VERSION=0.3.0 REACT_APP_NETWORK="Jungle Test Net" yarn build
REACT_APP_CHAIN_HOST=dev.cryptolions.io REACT_APP_CHAIN_PORT=38888 REACT_APP_CHAIN_PROTOCOL=http REACT_APP_CHAIN_ID=038f4b0fc8ff18a4f0842a8f0564611f6e96e8535901dd45e43ac8691a1c4dca REACT_APP_HISTORY_URL=http://junglehistory.cryptolions.io:18888 REACT_APP_GRAPHQL_ENDPOINT=http://144.76.165.114:3030/graphql REACT_APP_PAGE_HERO_COLOR=is-success REACT_APP_PAGE_WELCOME="A Wild Animals Tamagotchi and Battle game for EOS JungleNet Blockchain! :)" REACT_APP_VERSION=0.5.5 REACT_APP_NETWORK="Jungle Test Net" yarn build
rm -rf build/images/monsters && mv build/images/jungle-animals build/images/monsters
2 changes: 1 addition & 1 deletion services/frontend/jungle-start.sh
Original file line number Diff line number Diff line change
@@ -1 +1 @@
REACT_APP_CHAIN_HOST=dev.cryptolions.io REACT_APP_CHAIN_PORT=38888 REACT_APP_CHAIN_PROTOCOL=http REACT_APP_CHAIN_ID=038f4b0fc8ff18a4f0842a8f0564611f6e96e8535901dd45e43ac8691a1c4dca REACT_APP_HISTORY_URL=http://junglehistory.cryptolions.io:18888 REACT_APP_GRAPHQL_ENDPOINT=http://144.76.165.114:3030/graphql REACT_APP_PAGE_HERO_COLOR=is-success REACT_APP_PAGE_WELCOME="A Wild Animals Tamagotchi and Battle game for EOS JungleNet Blockchain! :)" REACT_APP_VERSION=0.3.0 REACT_APP_NETWORK="Jungle Test Net" yarn start
REACT_APP_CHAIN_HOST=dev.cryptolions.io REACT_APP_CHAIN_PORT=38888 REACT_APP_CHAIN_PROTOCOL=http REACT_APP_CHAIN_ID=038f4b0fc8ff18a4f0842a8f0564611f6e96e8535901dd45e43ac8691a1c4dca REACT_APP_HISTORY_URL=http://junglehistory.cryptolions.io:18888 REACT_APP_GRAPHQL_ENDPOINT=http://144.76.165.114:3030/graphql REACT_APP_PAGE_HERO_COLOR=is-success REACT_APP_PAGE_WELCOME="A Wild Animals Tamagotchi and Battle game for EOS JungleNet Blockchain! :)" REACT_APP_VERSION=0.5.5 REACT_APP_NETWORK="Jungle Test Net" yarn start
2 changes: 1 addition & 1 deletion services/frontend/mainnet-build.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
REACT_APP_CHAIN_HOST=api.cypherglass.com REACT_APP_CHAIN_PORT=443 REACT_APP_CHAIN_PROTOCOL=https REACT_APP_CHAIN_ID=aca376f206b8fc25a6ed44dbdc66547c36c6c33e3a119ffbeaef943642f0e906 REACT_APP_GRAPHQL_ENDPOINT=https://monstereos-api.cypherglass.com/graphql REACT_APP_VERSION=0.5.4 REACT_APP_NETWORK="EOS MainNet" yarn build
REACT_APP_CHAIN_HOST=api.cypherglass.com REACT_APP_CHAIN_PORT=443 REACT_APP_CHAIN_PROTOCOL=https REACT_APP_CHAIN_ID=aca376f206b8fc25a6ed44dbdc66547c36c6c33e3a119ffbeaef943642f0e906 REACT_APP_GRAPHQL_ENDPOINT=https://monstereos-api.cypherglass.com/graphql REACT_APP_VERSION=0.5.5 REACT_APP_NETWORK="EOS MainNet" yarn build
rm -rf build/images/jungle-animals
2 changes: 1 addition & 1 deletion services/frontend/mainnet-start.sh
Original file line number Diff line number Diff line change
@@ -1 +1 @@
REACT_APP_CHAIN_HOST=api.cypherglass.com REACT_APP_CHAIN_PORT=443 REACT_APP_CHAIN_PROTOCOL=https REACT_APP_CHAIN_ID=aca376f206b8fc25a6ed44dbdc66547c36c6c33e3a119ffbeaef943642f0e906 REACT_APP_GRAPHQL_ENDPOINT=https://monstereos-api.cypherglass.com/graphql REACT_APP_VERSION=0.5.4 REACT_APP_NETWORK="EOS MainNet" yarn start
REACT_APP_CHAIN_HOST=api.cypherglass.com REACT_APP_CHAIN_PORT=443 REACT_APP_CHAIN_PROTOCOL=https REACT_APP_CHAIN_ID=aca376f206b8fc25a6ed44dbdc66547c36c6c33e3a119ffbeaef943642f0e906 REACT_APP_GRAPHQL_ENDPOINT=https://monstereos-api.cypherglass.com/graphql REACT_APP_VERSION=0.5.5 REACT_APP_NETWORK="EOS MainNet" yarn start
3 changes: 1 addition & 2 deletions services/frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"name": "monstereos-webapp-ui",
"version": "0.5.4",
"private": true,
"version": "0.5.5",
"dependencies": {
"@types/classnames": "^2.2.6",
"@types/enzyme": "^3.1.13",
Expand Down
Binary file removed services/frontend/public/images/zzz.gif
Binary file not shown.
Loading

0 comments on commit 7109098

Please sign in to comment.