Compare commits
8
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b59505eab2 | ||
|
|
4e948c58ce | ||
|
|
65b7bee7a6 | ||
|
|
48eb594ea9 | ||
|
|
a44724c3d7 | ||
|
|
60074a945c | ||
|
|
91d30b9ea1 | ||
|
|
3f034d40ce |
@@ -3,6 +3,13 @@ name: Docker Build
|
|||||||
on: [pull_request]
|
on: [pull_request]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
build:
|
||||||
|
name: Run docker build
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Run docker build
|
||||||
|
run: make docker-build
|
||||||
test:
|
test:
|
||||||
# Add a dummy job to avoid failing GitHub CI checks.
|
# Add a dummy job to avoid failing GitHub CI checks.
|
||||||
# Other checks to be added later.
|
# Other checks to be added later.
|
||||||
|
|||||||
+2
-1
@@ -1 +1,2 @@
|
|||||||
.idea/
|
.idea/
|
||||||
|
.vscode
|
||||||
|
|||||||
+1
-4
@@ -1,4 +1,4 @@
|
|||||||
FROM golang:1.16-alpine as builder
|
FROM golang:1.18-alpine as builder
|
||||||
|
|
||||||
RUN apk --update --no-cache add make git g++ linux-headers
|
RUN apk --update --no-cache add make git g++ linux-headers
|
||||||
|
|
||||||
@@ -17,9 +17,6 @@ WORKDIR /app
|
|||||||
|
|
||||||
COPY --from=builder /go/src/github.com/vulcanize/ipld-eth-db/scripts/startup_script.sh .
|
COPY --from=builder /go/src/github.com/vulcanize/ipld-eth-db/scripts/startup_script.sh .
|
||||||
|
|
||||||
# copy over file for TimescaleDB setup
|
|
||||||
COPY --from=builder /go/src/github.com/vulcanize/ipld-eth-db/docker-compose.test.yml docker-tsdb/docker-compose.test.yml
|
|
||||||
|
|
||||||
COPY --from=builder /go/src/github.com/pressly/goose/cmd/goose/goose goose
|
COPY --from=builder /go/src/github.com/pressly/goose/cmd/goose/goose goose
|
||||||
COPY --from=builder /go/src/github.com/vulcanize/ipld-eth-db/db/migrations migrations/vulcanizedb
|
COPY --from=builder /go/src/github.com/vulcanize/ipld-eth-db/db/migrations migrations/vulcanizedb
|
||||||
|
|
||||||
|
|||||||
@@ -115,7 +115,7 @@ import:
|
|||||||
## Build docker image with schema
|
## Build docker image with schema
|
||||||
.PHONY: docker-build
|
.PHONY: docker-build
|
||||||
docker-build:
|
docker-build:
|
||||||
docker-compose build
|
docker-compose -f docker-compose.test.yml build
|
||||||
|
|
||||||
## Build docker image for migration
|
## Build docker image for migration
|
||||||
.PHONY: docker-concise-migration-build
|
.PHONY: docker-concise-migration-build
|
||||||
|
|||||||
@@ -12,28 +12,24 @@ Schemas and utils for IPLD ETH Postgres database
|
|||||||
docker-compose down -v --remove-orphans
|
docker-compose down -v --remove-orphans
|
||||||
```
|
```
|
||||||
|
|
||||||
* Spin up a TimescaleDB instance using [docker-compose.test.yml](./docker-compose.test.yml):
|
* Spin up `ipld-eth-db` using an existing image:
|
||||||
|
|
||||||
```bash
|
* Update image source used for running the migrations in [docker-compose.yml](./docker-compose.yml) (if required).
|
||||||
docker-compose -f docker-compose.test.yml up
|
|
||||||
```
|
|
||||||
|
|
||||||
Following final output should be seen:
|
* Run:
|
||||||
|
|
||||||
```
|
```
|
||||||
LOG: TimescaleDB background worker launcher connected to shared catalogs
|
docker-compose -f docker-compose.yml up
|
||||||
```
|
```
|
||||||
|
|
||||||
* In another `ipld-eth-db` terminal window, build an image `migrations-test` using [Dockerfile](./db/Dockerfile):
|
* Spin up `ipld-eth-db` using a locally built image:
|
||||||
|
|
||||||
```bash
|
* Update [Dockerfile](./Dockerfile) (if required).
|
||||||
docker build -t migrations-test -f ./db/Dockerfile .
|
|
||||||
```
|
|
||||||
|
|
||||||
* Start a container using `migrations-test` image to run the db migrations:
|
* Update build context used for running the migrations in [docker-compose.test.yml](./docker-compose.test.yml) (if required).
|
||||||
|
|
||||||
```bash
|
* Run:
|
||||||
# Here, we are running the container using host network.
|
|
||||||
# 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
|
docker-compose -f docker-compose.test.yml up --build
|
||||||
```
|
```
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
FROM golang:1.16-alpine as builder
|
FROM golang:1.18-alpine as builder
|
||||||
|
|
||||||
RUN apk --update --no-cache add make git g++ linux-headers
|
RUN apk --update --no-cache add make git g++ linux-headers
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ CREATE TABLE IF NOT EXISTS eth.transaction_cids (
|
|||||||
tx_data BYTEA,
|
tx_data BYTEA,
|
||||||
tx_type INTEGER,
|
tx_type INTEGER,
|
||||||
value NUMERIC,
|
value NUMERIC,
|
||||||
PRIMARY KEY (tx_hash, block_number)
|
PRIMARY KEY (tx_hash, header_id, block_number)
|
||||||
);
|
);
|
||||||
|
|
||||||
-- +goose Down
|
-- +goose Down
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
-- +goose Up
|
-- +goose Up
|
||||||
CREATE TABLE IF NOT EXISTS eth.receipt_cids (
|
CREATE TABLE IF NOT EXISTS eth.receipt_cids (
|
||||||
block_number BIGINT NOT NULL,
|
block_number BIGINT NOT NULL,
|
||||||
|
header_id VARCHAR(66) NOT NULL,
|
||||||
tx_id VARCHAR(66) NOT NULL,
|
tx_id VARCHAR(66) NOT NULL,
|
||||||
leaf_cid TEXT NOT NULL,
|
leaf_cid TEXT NOT NULL,
|
||||||
contract VARCHAR(66),
|
contract VARCHAR(66),
|
||||||
@@ -9,7 +10,7 @@ CREATE TABLE IF NOT EXISTS eth.receipt_cids (
|
|||||||
post_state VARCHAR(66),
|
post_state VARCHAR(66),
|
||||||
post_status INTEGER,
|
post_status INTEGER,
|
||||||
log_root VARCHAR(66),
|
log_root VARCHAR(66),
|
||||||
PRIMARY KEY (tx_id, block_number)
|
PRIMARY KEY (tx_id, header_id, block_number)
|
||||||
);
|
);
|
||||||
|
|
||||||
-- +goose Down
|
-- +goose Down
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
-- +goose Up
|
-- +goose Up
|
||||||
CREATE TABLE IF NOT EXISTS eth.log_cids (
|
CREATE TABLE IF NOT EXISTS eth.log_cids (
|
||||||
block_number BIGINT NOT NULL,
|
block_number BIGINT NOT NULL,
|
||||||
|
header_id VARCHAR(66) NOT NULL,
|
||||||
leaf_cid TEXT NOT NULL,
|
leaf_cid TEXT NOT NULL,
|
||||||
leaf_mh_key TEXT NOT NULL,
|
leaf_mh_key TEXT NOT NULL,
|
||||||
rct_id VARCHAR(66) NOT NULL,
|
rct_id VARCHAR(66) NOT NULL,
|
||||||
@@ -11,7 +12,7 @@ CREATE TABLE IF NOT EXISTS eth.log_cids (
|
|||||||
topic2 VARCHAR(66),
|
topic2 VARCHAR(66),
|
||||||
topic3 VARCHAR(66),
|
topic3 VARCHAR(66),
|
||||||
log_data BYTEA,
|
log_data BYTEA,
|
||||||
PRIMARY KEY (rct_id, index, block_number)
|
PRIMARY KEY (rct_id, index, header_id, block_number)
|
||||||
);
|
);
|
||||||
|
|
||||||
-- +goose Down
|
-- +goose Down
|
||||||
|
|||||||
@@ -14,13 +14,14 @@ CREATE INDEX uncle_header_id_index ON eth.uncle_cids USING btree (header_id);
|
|||||||
-- transaction indexes
|
-- transaction indexes
|
||||||
CREATE INDEX tx_block_number_index ON eth.transaction_cids USING brin (block_number);
|
CREATE INDEX tx_block_number_index ON eth.transaction_cids USING brin (block_number);
|
||||||
CREATE INDEX tx_header_id_index ON eth.transaction_cids USING btree (header_id);
|
CREATE INDEX tx_header_id_index ON eth.transaction_cids USING btree (header_id);
|
||||||
CREATE UNIQUE INDEX tx_cid_index ON eth.transaction_cids USING btree (cid, block_number);
|
CREATE INDEX tx_cid_index ON eth.transaction_cids USING btree (cid, block_number);
|
||||||
CREATE UNIQUE INDEX tx_mh_block_number_index ON eth.transaction_cids USING btree (mh_key, block_number);
|
CREATE INDEX tx_mh_block_number_index ON eth.transaction_cids USING btree (mh_key, block_number);
|
||||||
CREATE INDEX tx_dst_index ON eth.transaction_cids USING btree (dst);
|
CREATE INDEX tx_dst_index ON eth.transaction_cids USING btree (dst);
|
||||||
CREATE INDEX tx_src_index ON eth.transaction_cids USING btree (src);
|
CREATE INDEX tx_src_index ON eth.transaction_cids USING btree (src);
|
||||||
|
|
||||||
-- receipt indexes
|
-- receipt indexes
|
||||||
CREATE INDEX rct_block_number_index ON eth.receipt_cids USING brin (block_number);
|
CREATE INDEX rct_block_number_index ON eth.receipt_cids USING brin (block_number);
|
||||||
|
CREATE INDEX rct_header_id_index ON eth.receipt_cids USING btree (header_id);
|
||||||
CREATE INDEX rct_leaf_cid_index ON eth.receipt_cids USING btree (leaf_cid);
|
CREATE INDEX rct_leaf_cid_index ON eth.receipt_cids USING btree (leaf_cid);
|
||||||
CREATE INDEX rct_leaf_mh_block_number_index ON eth.receipt_cids USING btree (leaf_mh_key, block_number);
|
CREATE INDEX rct_leaf_mh_block_number_index ON eth.receipt_cids USING btree (leaf_mh_key, block_number);
|
||||||
CREATE INDEX rct_contract_index ON eth.receipt_cids USING btree (contract);
|
CREATE INDEX rct_contract_index ON eth.receipt_cids USING btree (contract);
|
||||||
@@ -55,6 +56,7 @@ CREATE INDEX access_list_storage_keys_index ON eth.access_list_elements USING gi
|
|||||||
|
|
||||||
-- log indexes
|
-- log indexes
|
||||||
CREATE INDEX log_block_number_index ON eth.log_cids USING brin (block_number);
|
CREATE INDEX log_block_number_index ON eth.log_cids USING brin (block_number);
|
||||||
|
CREATE INDEX log_header_id_index ON eth.log_cids USING btree (header_id);
|
||||||
CREATE INDEX log_leaf_mh_block_number_index ON eth.log_cids USING btree (leaf_mh_key, block_number);
|
CREATE INDEX log_leaf_mh_block_number_index ON eth.log_cids USING btree (leaf_mh_key, block_number);
|
||||||
CREATE INDEX log_cid_index ON eth.log_cids USING btree (leaf_cid);
|
CREATE INDEX log_cid_index ON eth.log_cids USING btree (leaf_cid);
|
||||||
CREATE INDEX log_address_index ON eth.log_cids USING btree (address);
|
CREATE INDEX log_address_index ON eth.log_cids USING btree (address);
|
||||||
@@ -72,6 +74,7 @@ DROP INDEX eth.log_topic0_index;
|
|||||||
DROP INDEX eth.log_address_index;
|
DROP INDEX eth.log_address_index;
|
||||||
DROP INDEX eth.log_cid_index;
|
DROP INDEX eth.log_cid_index;
|
||||||
DROP INDEX eth.log_leaf_mh_block_number_index;
|
DROP INDEX eth.log_leaf_mh_block_number_index;
|
||||||
|
DROP INDEX eth.log_header_id_index;
|
||||||
DROP INDEX eth.log_block_number_index;
|
DROP INDEX eth.log_block_number_index;
|
||||||
|
|
||||||
-- access list indexes
|
-- access list indexes
|
||||||
@@ -106,6 +109,7 @@ DROP INDEX eth.rct_contract_hash_index;
|
|||||||
DROP INDEX eth.rct_contract_index;
|
DROP INDEX eth.rct_contract_index;
|
||||||
DROP INDEX eth.rct_leaf_mh_block_number_index;
|
DROP INDEX eth.rct_leaf_mh_block_number_index;
|
||||||
DROP INDEX eth.rct_leaf_cid_index;
|
DROP INDEX eth.rct_leaf_cid_index;
|
||||||
|
DROP INDEX eth.rct_header_id_index;
|
||||||
DROP INDEX eth.rct_block_number_index;
|
DROP INDEX eth.rct_block_number_index;
|
||||||
|
|
||||||
-- transaction indexes
|
-- transaction indexes
|
||||||
|
|||||||
@@ -22,17 +22,20 @@ BEGIN
|
|||||||
ELSIF (TG_TABLE_NAME = 'log_cids') THEN
|
ELSIF (TG_TABLE_NAME = 'log_cids') THEN
|
||||||
obj := json_build_array(
|
obj := json_build_array(
|
||||||
TG_TABLE_NAME,
|
TG_TABLE_NAME,
|
||||||
|
NEW.header_id,
|
||||||
NEW.rct_id,
|
NEW.rct_id,
|
||||||
NEW.index
|
NEW.index
|
||||||
);
|
);
|
||||||
ELSIF (TG_TABLE_NAME = 'receipt_cids') THEN
|
ELSIF (TG_TABLE_NAME = 'receipt_cids') THEN
|
||||||
obj := json_build_array(
|
obj := json_build_array(
|
||||||
TG_TABLE_NAME,
|
TG_TABLE_NAME,
|
||||||
|
NEW.header_id,
|
||||||
NEW.tx_id
|
NEW.tx_id
|
||||||
);
|
);
|
||||||
ELSIF (TG_TABLE_NAME = 'transaction_cids') THEN
|
ELSIF (TG_TABLE_NAME = 'transaction_cids') THEN
|
||||||
obj := json_build_array(
|
obj := json_build_array(
|
||||||
TG_TABLE_NAME,
|
TG_TABLE_NAME,
|
||||||
|
NEW.header_id,
|
||||||
NEW.tx_hash
|
NEW.tx_hash
|
||||||
);
|
);
|
||||||
ELSIF (TG_TABLE_NAME = 'access_list_elements') THEN
|
ELSIF (TG_TABLE_NAME = 'access_list_elements') THEN
|
||||||
|
|||||||
@@ -155,26 +155,26 @@ BEGIN
|
|||||||
END IF;
|
END IF;
|
||||||
|
|
||||||
-- select all of the state nodes for this snapshot: the latest state node record at every unique path
|
-- select all of the state nodes for this snapshot: the latest state node record at every unique path
|
||||||
SELECT DISTINCT ON (state_path) blocks.data, state_cids.state_leaf_key, state_cids.cid, state_cids.state_path,
|
SELECT ARRAY (SELECT DISTINCT ON (state_path) ROW (blocks.data, state_cids.state_leaf_key, state_cids.cid, state_cids.state_path,
|
||||||
state_cids.node_type, state_cids.mh_key
|
state_cids.node_type, state_cids.mh_key)
|
||||||
INTO results
|
|
||||||
FROM eth.state_cids
|
FROM eth.state_cids
|
||||||
INNER JOIN public.blocks
|
INNER JOIN public.blocks
|
||||||
ON (state_cids.mh_key, state_cids.block_number) = (blocks.key, blocks.block_number)
|
ON (state_cids.mh_key, state_cids.block_number) = (blocks.key, blocks.block_number)
|
||||||
WHERE state_cids.block_number BETWEEN starting_height AND ending_height
|
WHERE state_cids.block_number BETWEEN starting_height AND ending_height
|
||||||
ORDER BY state_path, block_number DESC;
|
ORDER BY state_path, state_cids.block_number DESC)
|
||||||
|
INTO results;
|
||||||
|
|
||||||
-- from the set returned above, insert public.block records at the ending_height block number
|
-- from the set returned above, insert public.block records at the ending_height block number
|
||||||
INSERT INTO public.blocks (block_number, key, data)
|
INSERT INTO public.blocks (block_number, key, data)
|
||||||
SELECT ending_height, r.mh_key, r.data
|
SELECT ending_height, r.mh_key, r.data
|
||||||
FROM results r;
|
FROM unnest(results) r;
|
||||||
|
|
||||||
-- from the set returned above, insert eth.state_cids records at the ending_height block number
|
-- from the set returned above, insert eth.state_cids records at the ending_height block number
|
||||||
-- anchoring all the records to the canonical header found at ending_height
|
-- anchoring all the records to the canonical header found at ending_height
|
||||||
INSERT INTO eth.state_cids (block_number, header_id, state_leaf_key, cid, state_path, node_type, diff, mh_key)
|
INSERT INTO eth.state_cids (block_number, header_id, state_leaf_key, cid, state_path, node_type, diff, mh_key)
|
||||||
SELECT ending_height, canonical_hash, r.state_leaf_key, r.cid, r.state_path, r.node_type, false, r.mh_key
|
SELECT ending_height, canonical_hash, r.state_leaf_key, r.cid, r.state_path, r.node_type, false, r.mh_key
|
||||||
FROM results r
|
FROM unnest(results) r
|
||||||
ON CONFLICT (state_path, header_id) DO NOTHING;
|
ON CONFLICT (state_path, header_id, block_number) DO NOTHING;
|
||||||
END
|
END
|
||||||
$BODY$
|
$BODY$
|
||||||
LANGUAGE 'plpgsql';
|
LANGUAGE 'plpgsql';
|
||||||
@@ -208,29 +208,29 @@ BEGIN
|
|||||||
END IF;
|
END IF;
|
||||||
|
|
||||||
-- select all of the storage nodes for this snapshot: the latest storage node record at every unique state leaf key
|
-- select all of the storage nodes for this snapshot: the latest storage node record at every unique state leaf key
|
||||||
SELECT DISTINCT ON (state_leaf_key, storage_path) block.data, storage_cids.state_path, storage_cids.storage_leaf_key,
|
SELECT ARRAY (SELECT DISTINCT ON (state_leaf_key, storage_path) ROW (blocks.data, storage_cids.state_path, storage_cids.storage_leaf_key,
|
||||||
storage_cids.cid, storage_cids.storage_path, storage_cids.node_type, storage_cids.mh_key
|
storage_cids.cid, storage_cids.storage_path, storage_cids.node_type, storage_cids.mh_key)
|
||||||
INTO results
|
|
||||||
FROM eth.storage_cids
|
FROM eth.storage_cids
|
||||||
INNER JOIN public.blocks
|
INNER JOIN public.blocks
|
||||||
ON (storage_cids.mh_key, storage_cids.block_number) = (blocks.key, blocks.block_number)
|
ON (storage_cids.mh_key, storage_cids.block_number) = (blocks.key, blocks.block_number)
|
||||||
INNER JOIN eth.state_cids
|
INNER JOIN eth.state_cids
|
||||||
ON (storage_cids.state_path, storage_cids.header_id) = (state_cids.state_path, state_cids.header_id)
|
ON (storage_cids.state_path, storage_cids.header_id) = (state_cids.state_path, state_cids.header_id)
|
||||||
WHERE storage_cids.block_number BETWEEN starting_height AND ending_height
|
WHERE storage_cids.block_number BETWEEN starting_height AND ending_height
|
||||||
ORDER BY state_path, storage_path, block_number DESC;
|
ORDER BY state_leaf_key, storage_path, storage_cids.state_path, storage_cids.block_number DESC)
|
||||||
|
INTO results;
|
||||||
|
|
||||||
-- from the set returned above, insert public.block records at the ending_height block number
|
-- from the set returned above, insert public.block records at the ending_height block number
|
||||||
INSERT INTO public.blocks (block_number, key, data)
|
INSERT INTO public.blocks (block_number, key, data)
|
||||||
SELECT ending_height, r.mh_key, r.data
|
SELECT ending_height, r.mh_key, r.data
|
||||||
FROM results r;
|
FROM unnest(results) r;
|
||||||
|
|
||||||
-- from the set returned above, insert eth.state_cids records at the ending_height block number
|
-- from the set returned above, insert eth.state_cids records at the ending_height block number
|
||||||
-- anchoring all the records to the canonical header found at ending_height
|
-- anchoring all the records to the canonical header found at ending_height
|
||||||
INSERT INTO eth.storage_cids (block_number, header_id, state_path, storage_leaf_key, cid, storage_path,
|
INSERT INTO eth.storage_cids (block_number, header_id, state_path, storage_leaf_key, cid, storage_path,
|
||||||
node_type, diff, mh_key)
|
node_type, diff, mh_key)
|
||||||
SELECT ending_height, canonical_hash, r.state_path, r.storage_leaf_key, r.cid, r.storage_path, r.node_type, false, r.mh_key
|
SELECT ending_height, canonical_hash, r.state_path, r.storage_leaf_key, r.cid, r.storage_path, r.node_type, false, r.mh_key
|
||||||
FROM results r
|
FROM unnest(results) r
|
||||||
ON CONFLICT (storage_path, state_path, header_id) DO NOTHING;
|
ON CONFLICT (storage_path, state_path, header_id, block_number) DO NOTHING;
|
||||||
END
|
END
|
||||||
$BODY$
|
$BODY$
|
||||||
LANGUAGE 'plpgsql';
|
LANGUAGE 'plpgsql';
|
||||||
|
|||||||
+17
-4
@@ -1,14 +1,27 @@
|
|||||||
version: '3.2'
|
version: '3.2'
|
||||||
|
|
||||||
services:
|
services:
|
||||||
access-node:
|
migrations:
|
||||||
|
restart: on-failure
|
||||||
|
depends_on:
|
||||||
|
- ipld-eth-db
|
||||||
|
image: vulcanize/ipld-eth-db
|
||||||
|
# Build image using local context
|
||||||
|
build: .
|
||||||
|
environment:
|
||||||
|
DATABASE_USER: "vdbm"
|
||||||
|
DATABASE_NAME: "vulcanize_testing"
|
||||||
|
DATABASE_PASSWORD: "password"
|
||||||
|
DATABASE_HOSTNAME: "ipld-eth-db"
|
||||||
|
DATABASE_PORT: 5432
|
||||||
|
|
||||||
|
ipld-eth-db:
|
||||||
image: timescale/timescaledb:latest-pg14
|
image: timescale/timescaledb:latest-pg14
|
||||||
restart: always
|
restart: always
|
||||||
container_name: access-node
|
|
||||||
command: ["postgres", "-c", "log_statement=all"]
|
command: ["postgres", "-c", "log_statement=all"]
|
||||||
environment:
|
environment:
|
||||||
POSTGRES_USER: "vdbm"
|
POSTGRES_USER: "vdbm"
|
||||||
POSTGRES_DB: "vulcanize_testing_v4"
|
POSTGRES_DB: "vulcanize_testing"
|
||||||
POSTGRES_PASSWORD: "password"
|
POSTGRES_PASSWORD: "password"
|
||||||
ports:
|
ports:
|
||||||
- "127.0.0.1:8066:5432"
|
- "127.0.0.1:8077:5432"
|
||||||
|
|||||||
+16
-4
@@ -1,14 +1,26 @@
|
|||||||
version: '3.2'
|
version: '3.2'
|
||||||
|
|
||||||
services:
|
services:
|
||||||
|
migrations:
|
||||||
|
restart: on-failure
|
||||||
|
depends_on:
|
||||||
|
- ipld-eth-db
|
||||||
|
# Use an existing image
|
||||||
|
image: vulcanize/ipld-eth-db:v4.1.4-alpha
|
||||||
|
environment:
|
||||||
|
DATABASE_USER: "vdbm"
|
||||||
|
DATABASE_NAME: "vulcanize_testing"
|
||||||
|
DATABASE_PASSWORD: "password"
|
||||||
|
DATABASE_HOSTNAME: "ipld-eth-db"
|
||||||
|
DATABASE_PORT: 5432
|
||||||
|
|
||||||
ipld-eth-db:
|
ipld-eth-db:
|
||||||
|
image: timescale/timescaledb:latest-pg14
|
||||||
restart: always
|
restart: always
|
||||||
image: vulcanize/ipld-eth-db
|
command: ["postgres", "-c", "log_statement=all"]
|
||||||
build: .
|
|
||||||
environment:
|
environment:
|
||||||
POSTGRES_USER: "vdbm"
|
POSTGRES_USER: "vdbm"
|
||||||
POSTGRES_DB: "vulcanize_testing"
|
POSTGRES_DB: "vulcanize_testing"
|
||||||
POSTGRES_PASSWORD: "password"
|
POSTGRES_PASSWORD: "password"
|
||||||
hostname: db
|
|
||||||
ports:
|
ports:
|
||||||
- "127.0.0.1:8077:5432"
|
- "127.0.0.1:8077:5432"
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ echo "Running database migrations"
|
|||||||
# If the db migrations ran without err
|
# If the db migrations ran without err
|
||||||
if [[ $? -eq 0 ]]; then
|
if [[ $? -eq 0 ]]; then
|
||||||
echo "Migration process ran successfully"
|
echo "Migration process ran successfully"
|
||||||
|
tail -f /dev/null
|
||||||
else
|
else
|
||||||
echo "Could not run migrations. Are the database details correct?"
|
echo "Could not run migrations. Are the database details correct?"
|
||||||
exit 1
|
exit 1
|
||||||
|
|||||||
Reference in New Issue
Block a user