2021-05-13 22:14:05 +00:00
|
|
|
# ipld-eth-db
|
|
|
|
Schemas and utils for IPLD ETH Postgres database
|
2021-08-29 19:00:39 +00:00
|
|
|
|
|
|
|
## Database UML
|
2022-04-29 03:03:16 +00:00
|
|
|
![](vulcanize_db.png)
|
|
|
|
|
|
|
|
## Run
|
|
|
|
|
|
|
|
* Remove any existing containers / volumes:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
docker-compose down -v --remove-orphans
|
|
|
|
```
|
|
|
|
|
2022-05-17 07:36:54 +00:00
|
|
|
* Spin up a TimescaleDB instance using [docker-compose.test.yml](./docker-compose.test.yml):
|
2022-04-29 03:03:16 +00:00
|
|
|
|
|
|
|
```bash
|
2022-05-10 10:45:57 +00:00
|
|
|
docker-compose -f docker-compose.test.yml up
|
2022-04-29 03:03:16 +00:00
|
|
|
```
|
|
|
|
|
2022-05-17 07:36:54 +00:00
|
|
|
Following final output should be seen:
|
2022-04-29 03:03:16 +00:00
|
|
|
|
|
|
|
```
|
|
|
|
LOG: TimescaleDB background worker launcher connected to shared catalogs
|
|
|
|
```
|
|
|
|
|
|
|
|
* In another `ipld-eth-db` terminal window, build an image `migrations-test` using [Dockerfile](./db/Dockerfile):
|
|
|
|
|
|
|
|
```bash
|
|
|
|
docker build -t migrations-test -f ./db/Dockerfile .
|
|
|
|
```
|
|
|
|
|
2022-05-17 07:36:54 +00:00
|
|
|
* Start a container using `migrations-test` image to run the db migrations:
|
2022-04-29 03:03:16 +00:00
|
|
|
|
|
|
|
```bash
|
|
|
|
# Here, we are running the container using host network.
|
2022-05-17 07:36:54 +00:00
|
|
|
# So connect to TimescaleDB on 127.0.0.1:8066
|
|
|
|
docker run --rm --network host -e DATABASE_USER=vdbm -e DATABASE_PASSWORD=password -e DATABASE_HOSTNAME=127.0.0.1 -e DATABASE_PORT=8066 -e DATABASE_NAME=vulcanize_testing_v4 migrations-test
|
2022-04-29 03:03:16 +00:00
|
|
|
```
|