Skip to content
This repository has been archived by the owner on Aug 31, 2021. It is now read-only.

Commit

Permalink
Merge branch 'master' into add_postgraphile_subscription
Browse files Browse the repository at this point in the history
  • Loading branch information
TakaGoto authored Sep 12, 2018
2 parents 13b19c0 + faefd62 commit c8b002d
Show file tree
Hide file tree
Showing 366 changed files with 35,786 additions and 596 deletions.
30 changes: 28 additions & 2 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Vulcanize DB is a set of tools that make it easier for developers to write appli

## Installation
`go get github.com/vulcanize/vulcanizedb`
`go get gopkg.in/DataDog/dd-trace-go.v1/ddtrace`

## Setting up the Database
1. Install Postgres
Expand All @@ -27,6 +28,9 @@ Vulcanize DB is a set of tools that make it easier for developers to write appli

* See below for configuring additional environments

## Create a migration file (up and down)
1. ./script/create_migrate create_bite_table

## Configuration
- To use a local Ethereum node, copy `environments/public.toml.example` to
`environments/public.toml` and update the `ipcPath` and `levelDbPath`.
Expand Down
2 changes: 2 additions & 0 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ func init() {
rootCmd.PersistentFlags().String("database-password", "", "database password")
rootCmd.PersistentFlags().String("client-ipcPath", "", "location of geth.ipc file")
rootCmd.PersistentFlags().String("client-levelDbPath", "", "location of levelDb chaindata")
rootCmd.PersistentFlags().String("datadog-name", "vulcanize-test", "datadog service name")

viper.BindPFlag("database.name", rootCmd.PersistentFlags().Lookup("database-name"))
viper.BindPFlag("database.port", rootCmd.PersistentFlags().Lookup("database-port"))
Expand All @@ -78,6 +79,7 @@ func init() {
viper.BindPFlag("database.password", rootCmd.PersistentFlags().Lookup("database-password"))
viper.BindPFlag("client.ipcPath", rootCmd.PersistentFlags().Lookup("client-ipcPath"))
viper.BindPFlag("client.levelDbPath", rootCmd.PersistentFlags().Lookup("client-levelDbPath"))
viper.BindPFlag("datadog.name", rootCmd.PersistentFlags().Lookup("datadog-name"))
}

func initConfig() {
Expand Down
10 changes: 3 additions & 7 deletions db/migrations/1532468319_create_flip_kick_table.up.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,11 @@ CREATE TABLE maker.flip_kick (
db_id SERIAL PRIMARY KEY,
header_id INTEGER NOT NULL REFERENCES headers (id) ON DELETE CASCADE,
id NUMERIC NOT NULL UNIQUE,
mom VARCHAR,
vat VARCHAR,
ilk VARCHAR,
lot NUMERIC,
bid NUMERIC,
guy VARCHAR,
gal VARCHAR,
"end" TIMESTAMP WITH TIME ZONE,
era TIMESTAMP WITH TIME ZONE,
lad VARCHAR,
tab NUMERIC
urn VARCHAR,
tab NUMERIC,
raw_log JSONB
);
7 changes: 4 additions & 3 deletions db/migrations/1533844125_create_frob_table.up.sql
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
CREATE TABLE maker.frob (
id SERIAL PRIMARY KEY,
header_id INTEGER NOT NULL REFERENCES headers (id) ON DELETE CASCADE,
tx_idx INTEGER,
ilk bytea,
lad bytea,
urn bytea,
dink NUMERIC,
dart NUMERIC,
ink NUMERIC,
art NUMERIC,
iart NUMERIC,
iart NUMERIC,
tx_idx INTEGER NOT NUll,
raw_log JSONB,
UNIQUE (header_id, tx_idx)
);

This file was deleted.

This file was deleted.

5 changes: 2 additions & 3 deletions db/migrations/1534295712_create_tend_table.up.sql
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
CREATE TABLE maker.tend (
db_id SERIAL PRIMARY KEY,
header_id INTEGER NOT NULL REFERENCES headers (id) ON DELETE CASCADE,
id NUMERIC NOT NULL UNIQUE,
bid_id NUMERIC NOT NULL UNIQUE,
lot NUMERIC,
bid NUMERIC,
guy BYTEA,
guy VARCHAR,
tic NUMERIC,
era TIMESTAMP WITH TIME ZONE,
tx_idx INTEGER NOT NUll,
raw_log JSONB
);
1 change: 1 addition & 0 deletions db/migrations/1534295713_create_bite_table.down.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DROP TABLE maker.bite;
14 changes: 14 additions & 0 deletions db/migrations/1534295713_create_bite_table.up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
CREATE TABLE maker.bite (
id SERIAL PRIMARY KEY,
header_id INTEGER NOT NULL REFERENCES headers (id) ON DELETE CASCADE,
ilk bytea,
lad bytea,
ink VARCHAR,
art VARCHAR,
iArt VARCHAR,
tab NUMERIC,
flip VARCHAR,
tx_idx INTEGER NOT NUll,
raw_log JSONB,
UNIQUE (header_id, tx_idx)
)

This file was deleted.

This file was deleted.

1 change: 1 addition & 0 deletions db/migrations/1534799167_create_dent_table.down.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DROP TABLE maker.dent;
11 changes: 11 additions & 0 deletions db/migrations/1534799167_create_dent_table.up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
CREATE TABLE maker.dent (
db_id SERIAL PRIMARY KEY,
header_id INTEGER NOT NULL REFERENCES headers (id) ON DELETE CASCADE,
bid_id NUMERIC NOT NULL UNIQUE,
lot NUMERIC,
bid NUMERIC,
guy BYTEA,
tic NUMERIC,
tx_idx INTEGER NOT NUll,
raw_log JSONB
);
3 changes: 3 additions & 0 deletions db/migrations/1535667935_create_pit_file_table.down.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
DROP TABLE maker.pit_file_ilk;
DROP TABLE maker.pit_file_stability_fee;
DROP TABLE maker.pit_file_debt_ceiling;
30 changes: 30 additions & 0 deletions db/migrations/1535667935_create_pit_file_table.up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
CREATE TABLE maker.pit_file_ilk (
id SERIAL PRIMARY KEY,
header_id INTEGER NOT NULL REFERENCES headers (id) ON DELETE CASCADE,
ilk TEXT,
what TEXT,
data NUMERIC,
tx_idx INTEGER NOT NUll,
raw_log JSONB,
UNIQUE (header_id, tx_idx)
);

CREATE TABLE maker.pit_file_stability_fee (
id SERIAL PRIMARY KEY,
header_id INTEGER NOT NULL REFERENCES headers (id) ON DELETE CASCADE,
what TEXT,
data TEXT,
tx_idx INTEGER NOT NULL,
raw_log JSONB,
UNIQUE (header_id, tx_idx)
);

CREATE TABLE maker.pit_file_debt_ceiling (
id SERIAL PRIMARY KEY,
header_id INTEGER NOT NULL REFERENCES headers (id) ON DELETE CASCADE,
what TEXT,
data NUMERIC,
tx_idx INTEGER NOT NULL,
raw_log JSONB,
UNIQUE (header_id, tx_idx)
);
1 change: 1 addition & 0 deletions db/migrations/1536267596_create_vat_init_table.down.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DROP TABLE maker.vat_init;
8 changes: 8 additions & 0 deletions db/migrations/1536267596_create_vat_init_table.up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
CREATE TABLE maker.vat_init (
id SERIAL PRIMARY KEY,
header_id INTEGER NOT NULL REFERENCES headers (id) ON DELETE CASCADE,
ilk TEXT,
tx_idx INTEGER NOT NUll,
raw_log JSONB,
UNIQUE (header_id, tx_idx)
);
Loading

0 comments on commit c8b002d

Please sign in to comment.