This repository has been archived by the owner on Jan 29, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #165 from cybercongress/158-dev-env
Documentation for configure development environment
- Loading branch information
Showing
11 changed files
with
172 additions
and
3 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,74 @@ | ||
# Development environment | ||
|
||
## Prestart | ||
* Instal Java 8 JDK | ||
* Install Docker and Docker Compose | ||
* Install Intellij Idea | ||
|
||
## Run Kafka, Elassandra, Prometheus and Grafana | ||
### Start containers(required) | ||
For mac: | ||
```bash | ||
docker-compose -f dev-environment/env-mac.yml up -d | ||
``` | ||
For linux family: | ||
```bash | ||
docker-compose -f dev-environment/env.yml up -d | ||
``` | ||
### Bootstrap Elassandra with keyspaces(required) | ||
```bash | ||
docker cp dev-environment/elassandra-bootstrap.cql elassandra-markets:/elassandra-bootstrap.cql | ||
docker exec -it elassandra-markets bash | ||
cqlsh -f elassandra-bootstrap.cql | ||
``` | ||
Then copy paste all content from elassandra-bootstrap.cql to interactive console and press enter. Write twice exit to | ||
exit from container shell. | ||
|
||
### Stop kafka and delete kafka data(cheat sheet) | ||
```bash | ||
docker stop fast-data-dev-markets | ||
docker rm fast-data-dev-markets | ||
``` | ||
### Stop elassandra and delete elassandra data(cheat sheet) | ||
```bash | ||
docker stop elassandra-markets | ||
docker rm elassandra-markets | ||
``` | ||
|
||
## Start required chain nodes(Examples) | ||
### Run parity node(cheat sheet) | ||
```bash | ||
sudo docker run -d -p 8545:8545 --name parity_eth \ | ||
-v ${REPLACE_IT_BY_HOST_FOLDER}:/cyberdata parity/parity:stable \ | ||
--db-path /cyberdata --jsonrpc-hosts all --jsonrpc-interface all --jsonrpc-threads 4 | ||
``` | ||
|
||
### Access chains from remote machine(mars)(cheat sheet) | ||
```bash | ||
ssh -L 18332:localhost:18332 -L 8332:localhost:8332 \ | ||
-L 18545:localhost:18545 -L 8545:localhost:8545 \ | ||
[email protected] -p 33322 | ||
``` | ||
|
||
## Import project to Intellij Idea | ||
Open Project in idea by selecting: Import Project -> selecting build.gradle file from the repository root | ||
![Select Import Project](images/select-import-project.png) | ||
![Select Build Gradle](images/select-build-gradle.png) | ||
![Import Settings](images/gradle-settings.png) | ||
Wait for dependency downloading and indexation | ||
|
||
## Run Exchanges Connector, Tickers, or API from intellij Idea | ||
Go to ExchangesConnectorApplication.kt and press green triangle on left to the code (on example line 16): | ||
![Start Pump](images/start-exchanges-connector.png) | ||
|
||
If, you use parity endpoint different rather that localhost:8545, than Etherdelta connector will fail due to lack of environment property PARITY_URL. | ||
Let's define it: Select "Edit Configurations" | ||
|
||
![Select Edit Run Configuration](images/select-edit-configurations.png) | ||
|
||
Add next properties: | ||
|
||
![Add variables](images/add-environment-variables.png) | ||
|
||
Now, run exchanges connector one more time then etherdelta connector should start. | ||
You can add environment variables in the same way for Tickers, APIs and etc. |
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,44 @@ | ||
version: '3' | ||
services: | ||
|
||
fast-data-dev: | ||
container_name: fast-data-dev-markets | ||
image: landoop/fast-data-dev:latest | ||
ports: | ||
- "3030:3030" | ||
- "9092:9092" | ||
- "2181:2181" | ||
- "9581-9584:9581-9584" | ||
- "8081-8083:8081-8083" | ||
environment: | ||
RUNTESTS: 0 | ||
SAMPLEDATA: 0 | ||
FORWARDLOGS: 0 | ||
ADV_HOST: 127.0.0.1 | ||
|
||
elassandra: | ||
container_name: elassandra-markets | ||
image: strapdata/elassandra:5.5.0.13 | ||
ports: | ||
- "9042:9042" | ||
- "9200:9200" | ||
- "7199:7199" | ||
environment: | ||
CASSANDRA_DC: DEVELOPMENT | ||
CASSANDRA_CLUSTER_NAME: CYBER_SEARCH | ||
|
||
prometheus: | ||
container_name: prometheus | ||
restart: on-failure | ||
image: prom/prometheus:v2.1.0 | ||
volumes: | ||
- ./prometheus.yml:/etc/prometheus/prometheus.yml | ||
ports: | ||
- "9090:9090" | ||
|
||
grafana: | ||
container_name: grafana | ||
restart: on-failure | ||
image: grafana/grafana:5.0.4 | ||
ports: | ||
- "3000:3000" |
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 @@ | ||
version: '3' | ||
services: | ||
|
||
fast-data-dev: | ||
container_name: fast-data-dev-markets | ||
image: landoop/fast-data-dev:latest | ||
ports: | ||
- "3030:3030" | ||
- "9092:9092" | ||
- "2181:2181" | ||
- "9581-9584:9581-9584" | ||
- "8081-8083:8081-8083" | ||
environment: | ||
RUNTESTS: 0 | ||
SAMPLEDATA: 0 | ||
FORWARDLOGS: 0 | ||
ADV_HOST: 127.0.0.1 | ||
|
||
elassandra: | ||
container_name: elassandra-markets | ||
image: strapdata/elassandra:5.5.0.13 | ||
ports: | ||
- "9042:9042" | ||
- "9200:9200" | ||
- "7199:7199" | ||
environment: | ||
CASSANDRA_DC: DEVELOPMENT | ||
CASSANDRA_CLUSTER_NAME: CYBER_SEARCH | ||
|
||
prometheus: | ||
container_name: prometheus | ||
network_mode: host | ||
restart: on-failure | ||
image: prom/prometheus:v2.1.0 | ||
volumes: | ||
- ./prometheus.yml:/etc/prometheus/prometheus.yml | ||
|
||
grafana: | ||
container_name: grafana | ||
network_mode: host | ||
restart: on-failure | ||
image: grafana/grafana:5.0.4 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 @@ | ||
global: | ||
scrape_interval: 5s | ||
scrape_timeout: 5s | ||
evaluation_interval: 5s | ||
scrape_configs: | ||
- job_name: 'markets-monitoring' | ||
metrics_path: '/actuator/prometheus' | ||
static_configs: | ||
- targets: ['localhost:8080','localhost:8081','host.docker.internal:8080','host.docker.internal:8081'] |