Skip to content

Commit

Permalink
[dag inspector] Add README.md for local environment
Browse files Browse the repository at this point in the history
  • Loading branch information
welbon committed Jun 25, 2024
1 parent 9533817 commit 0cc2200
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 5 deletions.
57 changes: 52 additions & 5 deletions docker-compose/README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,57 @@
# 如何构建本地环境
# How to build local environment

## 1. 安装 Docker
## 2. 安装 Docker Compose
## 3. 运行以下命令
## 1. Install "Docker" and "Docker Compose"
## 2. Run the command to start the database and components
```bash
docker-compose up
```
## 4. 访问 http://localhost:8080
## 3. Start starcoin-index project

### Config the startup environment variable
```dotenv
HOSTS=localhost
NETWORK=halley # select which network to scan
BG_TASK_JOBS=dag_inspector
TXN_OFFSET=0
BULK_SIZE=100
STARCOIN_ES_PWD=
STARCOIN_ES_URL=localhost
STARCOIN_ES_PROTOCOL=http
STARCOIN_ES_PORT=9200
STARCOIN_ES_USER=
SWAP_API_URL=https://swap-api.starswap.xyz
SWAP_CONTRACT_ADDR=0x8c109349c6bd91411d6bc962e080c4a3
DS_URL=jdbc:postgresql://localhost/starcoin
DB_SCHEMA=halley
DB_USER_NAME=starcoin
DB_PWD=starcoin
PROGRAM_ARGS=
# auto_repair 9411700
```

### Configuration Elasticsearch template
[IMPORTANT!!] Make sure your template has added to Elastic search service before add data, including component template and index template to ES.
Following file: [[es_pipeline.scripts](..%2Fkube%2Fmappings%2Fes_pipeline.scripts)]

1. Open the 'Kibana' site has been started in the docker-compose environment, usually the url is http://localhost:5601
2. Navigate to 'Dev Tools'
3. Follow the instructions in the file of giving above to add the template to ES

## 4. Start starcoin-scan-api project

### Config the startup enviroment variable
```dotenv
STARCOIN_ES_URL=localhost
STARCOIN_ES_PROTOCOL=http
STARCOIN_ES_PORT=9200
STARCOIN_ES_USER=
STARCOIN_ES_INDEX_VERSION=
STARCOIN_ES_PWD=
MAIN_DS_URL=jdbc:postgresql://localhost/starcoin?currentSchema=main
BARNARD_DS_URL=jdbc:postgresql://localhost/starcoin?currentSchema=barnard
HALLEY_DS_URL=jdbc:postgresql://localhost/starcoin?currentSchema=halley
DS_URL=jdbc:postgresql://localhost/starcoin
STARCOIN_USER_DS_URL="jdbc:postgresql://localhost/starcoin?currentSchema=starcoin_user"
DB_USER_NAME=starcoin
DB_PWD=starcoin
```
12 changes: 12 additions & 0 deletions docker-compose/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,18 @@ services:
depends_on:
- elasticsearch

postgresql:
image: postgres:13.2
container_name: postgres_db
environment:
POSTGRES_USER: starcoin
POSTGRES_PASSWORD: starcoin
POSTGRES_DB: starcoin
volumes:
- db_data:/var/lib/postgresql/data
ports:
- 5432:5432

volumes:
esdata:
driver: local

0 comments on commit 0cc2200

Please sign in to comment.