From 3d34a9e7c99bf43a2815f2d6194d85da2f652469 Mon Sep 17 00:00:00 2001 From: Ian Norden Date: Wed, 13 Feb 2019 15:00:09 -0600 Subject: [PATCH] remove maker migrations and convert back to timestamps and fix bug in composeAndExecute command --- .gitignore | 1 + cmd/composeAndExecute.go | 74 +- cmd/parseStorageDiffs.go | 71 - db/schema.sql | 4099 +---------------- environments/compose.toml | 5 +- environments/composeStorage.toml | 45 + libraries/shared/storage/mappings.go | 24 +- pkg/config/plugin.go | 3 +- pkg/plugin/generator_test.go | 29 +- pkg/plugin/manager/manager.go | 9 +- pkg/plugin/test_helpers/database.go | 8 +- pkg/transformers/factories/storage/EXAMPLE.md | 167 - pkg/transformers/factories/storage/README.md | 124 - .../flop_kick/flop_kick_suite_test.go | 19 - pkg/transformers/shared/shared_suite_test.go | 19 - .../storage_diffs/maker/maker_suite_test.go | 35 - .../storage_diffs/maker/pit/pit_suite_test.go | 19 - .../storage_diffs/maker/vat/vat_suite_test.go | 19 - .../storage_diffs/maker/vow/mappings.go | 152 - .../storage_diffs/maker/vow/mappings_test.go | 42 - .../storage_diffs/maker/vow/repository.go | 117 - .../storage_diffs/maker/vow/vow_suite_test.go | 13 - pkg/transformers/storage_diffs/mappings.go | 63 - plugins/example_maker_exporter | 43 - test_config/test_config.go | 45 - 25 files changed, 137 insertions(+), 5108 deletions(-) delete mode 100644 cmd/parseStorageDiffs.go create mode 100644 environments/composeStorage.toml delete mode 100644 pkg/transformers/factories/storage/EXAMPLE.md delete mode 100644 pkg/transformers/factories/storage/README.md delete mode 100644 pkg/transformers/flop_kick/flop_kick_suite_test.go delete mode 100644 pkg/transformers/shared/shared_suite_test.go delete mode 100644 pkg/transformers/storage_diffs/maker/maker_suite_test.go delete mode 100644 pkg/transformers/storage_diffs/maker/pit/pit_suite_test.go delete mode 100644 pkg/transformers/storage_diffs/maker/vat/vat_suite_test.go delete mode 100644 pkg/transformers/storage_diffs/maker/vow/mappings.go delete mode 100644 pkg/transformers/storage_diffs/maker/vow/mappings_test.go delete mode 100644 pkg/transformers/storage_diffs/maker/vow/repository.go delete mode 100644 pkg/transformers/storage_diffs/maker/vow/vow_suite_test.go delete mode 100644 pkg/transformers/storage_diffs/mappings.go delete mode 100644 plugins/example_maker_exporter diff --git a/.gitignore b/.gitignore index edac9c99..5f445b89 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,4 @@ postgraphile/build/ postgraphile/node_modules/ postgraphile/package-lock.json vulcanizedb.log +db/migrations/00*.sql diff --git a/cmd/composeAndExecute.go b/cmd/composeAndExecute.go index d543e6d7..d719ef7d 100644 --- a/cmd/composeAndExecute.go +++ b/cmd/composeAndExecute.go @@ -54,23 +54,35 @@ var composeAndExecuteCmd = &cobra.Command{ ipcPath = "http://kovan0.vulcanize.io:8545" [exporter] - name = "exporter" - [exporter.transformers] - transformer1 = "path/to/transformer1" - transformer2 = "path/to/transformer2" - transformer3 = "path/to/transformer3" - transformer4 = "path/to/transformer4" - [exporter.types] - transformer1 = "eth_event" - transformer2 = "eth_event" - transformer3 = "eth_event" - transformer4 = "eth_storage" - [exporter.repositories] - transformers = "github.com/account/repo" - transformer4 = "github.com/account2/repo2" - [exporter.migrations] - transformers = "db/migrations" - transformer4 = "to/db/migrations" + name = "exampleTransformerExporter" + save = false + transformerNames = [ + "transformer1", + "transformer2", + "transformer3", + "transformer4", + ] + [exporter.transformer1] + path = "path/to/transformer1" + type = "eth_event" + repository = "github.com/account/repo" + migrations = "db/migrations" + [exporter.transformer2] + path = "path/to/transformer2" + type = "eth_event" + repository = "github.com/account/repo" + migrations = "db/migrations" + [exporter.transformer3] + path = "path/to/transformer3" + type = "eth_storage" + repository = "github.com/account/repo" + migrations = "db/migrations" + [exporter.transformer4] + path = "path/to/transformer4" + type = "eth_event" + repository = "github.com/account2/repo2" + migrations = "to/db/migrations" + Note: If any of the imported transformer need additional config variables do not forget to include those as well @@ -81,7 +93,7 @@ This plugin is loaded and the set of transformer initializers is exported from it and loaded into and executed over by the appropriate watcher. The type of watcher that the transformer works with is specified using the -exporter.types config variable as shown above. Currently there are watchers +type variable for each transformer in the config. Currently there are watchers of event data from an eth node (eth_event) and storage data from an eth node (eth_storage). Soon there will be watchers for ipfs (ipfs_event and ipfs_storage). @@ -217,34 +229,32 @@ func prepConfig() { transformers := make(map[string]config.Transformer) for _, name := range names { transformer := viper.GetStringMapString("exporter." + name) - _, ok := transformer["path"] - if !ok { + p, ok := transformer["path"] + if !ok || p == "" { log.Fatal(fmt.Sprintf("%s transformer config is missing `path` value", name)) } - _, ok = transformer["repository"] - if !ok { + r, ok := transformer["repository"] + if !ok || r == "" { log.Fatal(fmt.Sprintf("%s transformer config is missing `repository` value", name)) } - _, ok = transformer["migrations"] - if !ok { + m, ok := transformer["migrations"] + if !ok || m == "" { log.Fatal(fmt.Sprintf("%s transformer config is missing `migrations` value", name)) } - ty, ok := transformer["type"] + t, ok := transformer["type"] if !ok { log.Fatal(fmt.Sprintf("%s transformer config is missing `type` value", name)) } - - transformerType := config.GetTransformerType(ty) + transformerType := config.GetTransformerType(t) if transformerType == config.UnknownTransformerType { - log.Fatal(errors.New(`unknown transformer type in exporter config -accepted types are "eth_event", "eth_storage"`)) + log.Fatal(errors.New(`unknown transformer type in exporter config accepted types are "eth_event", "eth_storage"`)) } transformers[name] = config.Transformer{ - Path: transformer["path"], + Path: p, Type: transformerType, - RepositoryPath: transformer["repository"], - MigrationPath: transformer["migrations"], + RepositoryPath: r, + MigrationPath: m, } } diff --git a/cmd/parseStorageDiffs.go b/cmd/parseStorageDiffs.go deleted file mode 100644 index d1aee398..00000000 --- a/cmd/parseStorageDiffs.go +++ /dev/null @@ -1,71 +0,0 @@ -// VulcanizeDB -// Copyright © 2018 Vulcanize - -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. - -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - -package cmd - -import ( - "github.com/spf13/cobra" - "github.com/vulcanize/vulcanizedb/libraries/shared" - "github.com/vulcanize/vulcanizedb/pkg/datastore/postgres" - "github.com/vulcanize/vulcanizedb/pkg/fs" - "github.com/vulcanize/vulcanizedb/pkg/transformers" - "github.com/vulcanize/vulcanizedb/pkg/transformers/shared/storage" - "log" -) - -// parseStorageDiffsCmd represents the parseStorageDiffs command -var parseStorageDiffsCmd = &cobra.Command{ - Use: "parseStorageDiffs", - Short: "Continuously ingest storage diffs from a CSV file", - Long: `Read storage diffs out of a CSV file that is constantly receiving -new rows from an Ethereum node. For example: - -./vulcanizedb parseStorageDiffs --config=environments/staging.toml - -Note that the path to your storage diffs must be configured in your toml -file under storageDiffsPath.`, - Run: func(cmd *cobra.Command, args []string) { - parseStorageDiffs() - }, -} - -func init() { - rootCmd.AddCommand(parseStorageDiffsCmd) -} - -func parseStorageDiffs() { - blockChain := getBlockChain() - db, err := postgres.NewDB(databaseConfig, blockChain.Node()) - if err != nil { - log.Fatal("Failed to initialize database: ", err) - } - - tailer := fs.FileTailer{Path: storageDiffsPath} - - // TODO: configure transformers - watcher := shared.NewStorageWatcher(tailer, db) - watcher.AddTransformers([]storage.TransformerInitializer{ - transformers.GetCatStorageTransformer().NewTransformer, - transformers.GetPitStorageTransformer().NewTransformer, - transformers.GetVatStorageTransformer().NewTransformer, - transformers.GetVowStorageTransformer().NewTransformer, - }) - - err = watcher.Execute() - if err != nil { - log.Fatal(err) - } -} diff --git a/db/schema.sql b/db/schema.sql index 8cae77dd..54ff8d73 100644 --- a/db/schema.sql +++ b/db/schema.sql @@ -15,13 +15,6 @@ SET check_function_bodies = false; SET client_min_messages = warning; SET row_security = off; --- --- Name: maker; Type: SCHEMA; Schema: -; Owner: - --- - -CREATE SCHEMA maker; - - -- -- Name: plpgsql; Type: EXTENSION; Schema: -; Owner: - -- @@ -36,2350 +29,10 @@ CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog; COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language'; --- --- Name: notify_pricefeed(); Type: FUNCTION; Schema: public; Owner: - --- - -CREATE FUNCTION public.notify_pricefeed() RETURNS trigger - LANGUAGE plpgsql - AS $$ -BEGIN - PERFORM pg_notify( - CAST('postgraphile:price_feed' AS text), - json_build_object('__node__', json_build_array('price_feeds', NEW.id))::text - ); - RETURN NEW; -END; -$$; - - SET default_tablespace = ''; SET default_with_oids = false; --- --- Name: bite; Type: TABLE; Schema: maker; Owner: - --- - -CREATE TABLE maker.bite ( - id integer NOT NULL, - header_id integer NOT NULL, - ilk integer NOT NULL, - urn text, - ink numeric, - art numeric, - iart numeric, - tab numeric, - nflip numeric, - tx_idx integer NOT NULL, - log_idx integer NOT NULL, - raw_log jsonb -); - - --- --- Name: bite_id_seq; Type: SEQUENCE; Schema: maker; Owner: - --- - -CREATE SEQUENCE maker.bite_id_seq - AS integer - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: bite_id_seq; Type: SEQUENCE OWNED BY; Schema: maker; Owner: - --- - -ALTER SEQUENCE maker.bite_id_seq OWNED BY maker.bite.id; - - --- --- Name: cat_file_chop_lump; Type: TABLE; Schema: maker; Owner: - --- - -CREATE TABLE maker.cat_file_chop_lump ( - id integer NOT NULL, - header_id integer NOT NULL, - ilk integer NOT NULL, - what text, - data numeric, - tx_idx integer NOT NULL, - log_idx integer NOT NULL, - raw_log jsonb -); - - --- --- Name: cat_file_chop_lump_id_seq; Type: SEQUENCE; Schema: maker; Owner: - --- - -CREATE SEQUENCE maker.cat_file_chop_lump_id_seq - AS integer - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: cat_file_chop_lump_id_seq; Type: SEQUENCE OWNED BY; Schema: maker; Owner: - --- - -ALTER SEQUENCE maker.cat_file_chop_lump_id_seq OWNED BY maker.cat_file_chop_lump.id; - - --- --- Name: cat_file_flip; Type: TABLE; Schema: maker; Owner: - --- - -CREATE TABLE maker.cat_file_flip ( - id integer NOT NULL, - header_id integer NOT NULL, - ilk text, - what text, - flip text, - tx_idx integer NOT NULL, - log_idx integer NOT NULL, - raw_log jsonb -); - - --- --- Name: cat_file_flip_id_seq; Type: SEQUENCE; Schema: maker; Owner: - --- - -CREATE SEQUENCE maker.cat_file_flip_id_seq - AS integer - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: cat_file_flip_id_seq; Type: SEQUENCE OWNED BY; Schema: maker; Owner: - --- - -ALTER SEQUENCE maker.cat_file_flip_id_seq OWNED BY maker.cat_file_flip.id; - - --- --- Name: cat_file_pit_vow; Type: TABLE; Schema: maker; Owner: - --- - -CREATE TABLE maker.cat_file_pit_vow ( - id integer NOT NULL, - header_id integer NOT NULL, - what text, - data text, - tx_idx integer NOT NULL, - log_idx integer NOT NULL, - raw_log jsonb -); - - --- --- Name: cat_file_pit_vow_id_seq; Type: SEQUENCE; Schema: maker; Owner: - --- - -CREATE SEQUENCE maker.cat_file_pit_vow_id_seq - AS integer - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: cat_file_pit_vow_id_seq; Type: SEQUENCE OWNED BY; Schema: maker; Owner: - --- - -ALTER SEQUENCE maker.cat_file_pit_vow_id_seq OWNED BY maker.cat_file_pit_vow.id; - - --- --- Name: cat_flip_ilk; Type: TABLE; Schema: maker; Owner: - --- - -CREATE TABLE maker.cat_flip_ilk ( - id integer NOT NULL, - block_number bigint, - block_hash text, - flip numeric NOT NULL, - ilk integer NOT NULL -); - - --- --- Name: cat_flip_ilk_id_seq; Type: SEQUENCE; Schema: maker; Owner: - --- - -CREATE SEQUENCE maker.cat_flip_ilk_id_seq - AS integer - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: cat_flip_ilk_id_seq; Type: SEQUENCE OWNED BY; Schema: maker; Owner: - --- - -ALTER SEQUENCE maker.cat_flip_ilk_id_seq OWNED BY maker.cat_flip_ilk.id; - - --- --- Name: cat_flip_ink; Type: TABLE; Schema: maker; Owner: - --- - -CREATE TABLE maker.cat_flip_ink ( - id integer NOT NULL, - block_number bigint, - block_hash text, - flip numeric NOT NULL, - ink numeric NOT NULL -); - - --- --- Name: cat_flip_ink_id_seq; Type: SEQUENCE; Schema: maker; Owner: - --- - -CREATE SEQUENCE maker.cat_flip_ink_id_seq - AS integer - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: cat_flip_ink_id_seq; Type: SEQUENCE OWNED BY; Schema: maker; Owner: - --- - -ALTER SEQUENCE maker.cat_flip_ink_id_seq OWNED BY maker.cat_flip_ink.id; - - --- --- Name: cat_flip_tab; Type: TABLE; Schema: maker; Owner: - --- - -CREATE TABLE maker.cat_flip_tab ( - id integer NOT NULL, - block_number bigint, - block_hash text, - flip numeric NOT NULL, - tab numeric NOT NULL -); - - --- --- Name: cat_flip_tab_id_seq; Type: SEQUENCE; Schema: maker; Owner: - --- - -CREATE SEQUENCE maker.cat_flip_tab_id_seq - AS integer - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: cat_flip_tab_id_seq; Type: SEQUENCE OWNED BY; Schema: maker; Owner: - --- - -ALTER SEQUENCE maker.cat_flip_tab_id_seq OWNED BY maker.cat_flip_tab.id; - - --- --- Name: cat_flip_urn; Type: TABLE; Schema: maker; Owner: - --- - -CREATE TABLE maker.cat_flip_urn ( - id integer NOT NULL, - block_number bigint, - block_hash text, - flip numeric NOT NULL, - urn text -); - - --- --- Name: cat_flip_urn_id_seq; Type: SEQUENCE; Schema: maker; Owner: - --- - -CREATE SEQUENCE maker.cat_flip_urn_id_seq - AS integer - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: cat_flip_urn_id_seq; Type: SEQUENCE OWNED BY; Schema: maker; Owner: - --- - -ALTER SEQUENCE maker.cat_flip_urn_id_seq OWNED BY maker.cat_flip_urn.id; - - --- --- Name: cat_ilk_chop; Type: TABLE; Schema: maker; Owner: - --- - -CREATE TABLE maker.cat_ilk_chop ( - id integer NOT NULL, - block_number bigint, - block_hash text, - ilk integer NOT NULL, - chop numeric NOT NULL -); - - --- --- Name: cat_ilk_chop_id_seq; Type: SEQUENCE; Schema: maker; Owner: - --- - -CREATE SEQUENCE maker.cat_ilk_chop_id_seq - AS integer - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: cat_ilk_chop_id_seq; Type: SEQUENCE OWNED BY; Schema: maker; Owner: - --- - -ALTER SEQUENCE maker.cat_ilk_chop_id_seq OWNED BY maker.cat_ilk_chop.id; - - --- --- Name: cat_ilk_flip; Type: TABLE; Schema: maker; Owner: - --- - -CREATE TABLE maker.cat_ilk_flip ( - id integer NOT NULL, - block_number bigint, - block_hash text, - ilk integer NOT NULL, - flip text -); - - --- --- Name: cat_ilk_flip_id_seq; Type: SEQUENCE; Schema: maker; Owner: - --- - -CREATE SEQUENCE maker.cat_ilk_flip_id_seq - AS integer - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: cat_ilk_flip_id_seq; Type: SEQUENCE OWNED BY; Schema: maker; Owner: - --- - -ALTER SEQUENCE maker.cat_ilk_flip_id_seq OWNED BY maker.cat_ilk_flip.id; - - --- --- Name: cat_ilk_lump; Type: TABLE; Schema: maker; Owner: - --- - -CREATE TABLE maker.cat_ilk_lump ( - id integer NOT NULL, - block_number bigint, - block_hash text, - ilk integer NOT NULL, - lump numeric NOT NULL -); - - --- --- Name: cat_ilk_lump_id_seq; Type: SEQUENCE; Schema: maker; Owner: - --- - -CREATE SEQUENCE maker.cat_ilk_lump_id_seq - AS integer - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: cat_ilk_lump_id_seq; Type: SEQUENCE OWNED BY; Schema: maker; Owner: - --- - -ALTER SEQUENCE maker.cat_ilk_lump_id_seq OWNED BY maker.cat_ilk_lump.id; - - --- --- Name: cat_live; Type: TABLE; Schema: maker; Owner: - --- - -CREATE TABLE maker.cat_live ( - id integer NOT NULL, - block_number bigint, - block_hash text, - live numeric NOT NULL -); - - --- --- Name: cat_live_id_seq; Type: SEQUENCE; Schema: maker; Owner: - --- - -CREATE SEQUENCE maker.cat_live_id_seq - AS integer - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: cat_live_id_seq; Type: SEQUENCE OWNED BY; Schema: maker; Owner: - --- - -ALTER SEQUENCE maker.cat_live_id_seq OWNED BY maker.cat_live.id; - - --- --- Name: cat_nflip; Type: TABLE; Schema: maker; Owner: - --- - -CREATE TABLE maker.cat_nflip ( - id integer NOT NULL, - block_number bigint, - block_hash text, - nflip numeric NOT NULL -); - - --- --- Name: cat_nflip_id_seq; Type: SEQUENCE; Schema: maker; Owner: - --- - -CREATE SEQUENCE maker.cat_nflip_id_seq - AS integer - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: cat_nflip_id_seq; Type: SEQUENCE OWNED BY; Schema: maker; Owner: - --- - -ALTER SEQUENCE maker.cat_nflip_id_seq OWNED BY maker.cat_nflip.id; - - --- --- Name: cat_pit; Type: TABLE; Schema: maker; Owner: - --- - -CREATE TABLE maker.cat_pit ( - id integer NOT NULL, - block_number bigint, - block_hash text, - pit text -); - - --- --- Name: cat_pit_id_seq; Type: SEQUENCE; Schema: maker; Owner: - --- - -CREATE SEQUENCE maker.cat_pit_id_seq - AS integer - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: cat_pit_id_seq; Type: SEQUENCE OWNED BY; Schema: maker; Owner: - --- - -ALTER SEQUENCE maker.cat_pit_id_seq OWNED BY maker.cat_pit.id; - - --- --- Name: cat_vat; Type: TABLE; Schema: maker; Owner: - --- - -CREATE TABLE maker.cat_vat ( - id integer NOT NULL, - block_number bigint, - block_hash text, - vat text -); - - --- --- Name: cat_vat_id_seq; Type: SEQUENCE; Schema: maker; Owner: - --- - -CREATE SEQUENCE maker.cat_vat_id_seq - AS integer - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: cat_vat_id_seq; Type: SEQUENCE OWNED BY; Schema: maker; Owner: - --- - -ALTER SEQUENCE maker.cat_vat_id_seq OWNED BY maker.cat_vat.id; - - --- --- Name: cat_vow; Type: TABLE; Schema: maker; Owner: - --- - -CREATE TABLE maker.cat_vow ( - id integer NOT NULL, - block_number bigint, - block_hash text, - vow text -); - - --- --- Name: cat_vow_id_seq; Type: SEQUENCE; Schema: maker; Owner: - --- - -CREATE SEQUENCE maker.cat_vow_id_seq - AS integer - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: cat_vow_id_seq; Type: SEQUENCE OWNED BY; Schema: maker; Owner: - --- - -ALTER SEQUENCE maker.cat_vow_id_seq OWNED BY maker.cat_vow.id; - - --- --- Name: deal; Type: TABLE; Schema: maker; Owner: - --- - -CREATE TABLE maker.deal ( - id integer NOT NULL, - header_id integer NOT NULL, - bid_id numeric NOT NULL, - contract_address character varying, - log_idx integer NOT NULL, - tx_idx integer NOT NULL, - raw_log jsonb -); - - --- --- Name: deal_id_seq; Type: SEQUENCE; Schema: maker; Owner: - --- - -CREATE SEQUENCE maker.deal_id_seq - AS integer - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: deal_id_seq; Type: SEQUENCE OWNED BY; Schema: maker; Owner: - --- - -ALTER SEQUENCE maker.deal_id_seq OWNED BY maker.deal.id; - - --- --- Name: dent; Type: TABLE; Schema: maker; Owner: - --- - -CREATE TABLE maker.dent ( - id integer NOT NULL, - header_id integer NOT NULL, - bid_id numeric NOT NULL, - lot numeric, - bid numeric, - guy bytea, - tic numeric, - log_idx integer NOT NULL, - tx_idx integer NOT NULL, - raw_log jsonb -); - - --- --- Name: dent_id_seq; Type: SEQUENCE; Schema: maker; Owner: - --- - -CREATE SEQUENCE maker.dent_id_seq - AS integer - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: dent_id_seq; Type: SEQUENCE OWNED BY; Schema: maker; Owner: - --- - -ALTER SEQUENCE maker.dent_id_seq OWNED BY maker.dent.id; - - --- --- Name: drip_drip; Type: TABLE; Schema: maker; Owner: - --- - -CREATE TABLE maker.drip_drip ( - id integer NOT NULL, - header_id integer NOT NULL, - ilk integer NOT NULL, - log_idx integer NOT NULL, - tx_idx integer NOT NULL, - raw_log jsonb -); - - --- --- Name: drip_drip_id_seq; Type: SEQUENCE; Schema: maker; Owner: - --- - -CREATE SEQUENCE maker.drip_drip_id_seq - AS integer - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: drip_drip_id_seq; Type: SEQUENCE OWNED BY; Schema: maker; Owner: - --- - -ALTER SEQUENCE maker.drip_drip_id_seq OWNED BY maker.drip_drip.id; - - --- --- Name: drip_file_ilk; Type: TABLE; Schema: maker; Owner: - --- - -CREATE TABLE maker.drip_file_ilk ( - id integer NOT NULL, - header_id integer NOT NULL, - ilk integer NOT NULL, - vow text, - tax numeric, - log_idx integer NOT NULL, - tx_idx integer NOT NULL, - raw_log jsonb -); - - --- --- Name: drip_file_ilk_id_seq; Type: SEQUENCE; Schema: maker; Owner: - --- - -CREATE SEQUENCE maker.drip_file_ilk_id_seq - AS integer - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: drip_file_ilk_id_seq; Type: SEQUENCE OWNED BY; Schema: maker; Owner: - --- - -ALTER SEQUENCE maker.drip_file_ilk_id_seq OWNED BY maker.drip_file_ilk.id; - - --- --- Name: drip_file_repo; Type: TABLE; Schema: maker; Owner: - --- - -CREATE TABLE maker.drip_file_repo ( - id integer NOT NULL, - header_id integer NOT NULL, - what text, - data numeric, - log_idx integer NOT NULL, - tx_idx integer NOT NULL, - raw_log jsonb -); - - --- --- Name: drip_file_repo_id_seq; Type: SEQUENCE; Schema: maker; Owner: - --- - -CREATE SEQUENCE maker.drip_file_repo_id_seq - AS integer - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: drip_file_repo_id_seq; Type: SEQUENCE OWNED BY; Schema: maker; Owner: - --- - -ALTER SEQUENCE maker.drip_file_repo_id_seq OWNED BY maker.drip_file_repo.id; - - --- --- Name: drip_file_vow; Type: TABLE; Schema: maker; Owner: - --- - -CREATE TABLE maker.drip_file_vow ( - id integer NOT NULL, - header_id integer NOT NULL, - what text, - data text, - log_idx integer NOT NULL, - tx_idx integer NOT NULL, - raw_log jsonb -); - - --- --- Name: drip_file_vow_id_seq; Type: SEQUENCE; Schema: maker; Owner: - --- - -CREATE SEQUENCE maker.drip_file_vow_id_seq - AS integer - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: drip_file_vow_id_seq; Type: SEQUENCE OWNED BY; Schema: maker; Owner: - --- - -ALTER SEQUENCE maker.drip_file_vow_id_seq OWNED BY maker.drip_file_vow.id; - - --- --- Name: flap_kick; Type: TABLE; Schema: maker; Owner: - --- - -CREATE TABLE maker.flap_kick ( - id integer NOT NULL, - header_id integer NOT NULL, - bid_id numeric NOT NULL, - lot numeric NOT NULL, - bid numeric NOT NULL, - gal text, - "end" timestamp with time zone, - tx_idx integer NOT NULL, - log_idx integer NOT NULL, - raw_log jsonb -); - - --- --- Name: flap_kick_id_seq; Type: SEQUENCE; Schema: maker; Owner: - --- - -CREATE SEQUENCE maker.flap_kick_id_seq - AS integer - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: flap_kick_id_seq; Type: SEQUENCE OWNED BY; Schema: maker; Owner: - --- - -ALTER SEQUENCE maker.flap_kick_id_seq OWNED BY maker.flap_kick.id; - - --- --- Name: flip_kick; Type: TABLE; Schema: maker; Owner: - --- - -CREATE TABLE maker.flip_kick ( - id integer NOT NULL, - header_id integer NOT NULL, - bid_id numeric NOT NULL, - lot numeric, - bid numeric, - gal text, - "end" timestamp with time zone, - urn text, - tab numeric, - tx_idx integer NOT NULL, - log_idx integer NOT NULL, - raw_log jsonb -); - - --- --- Name: flip_kick_id_seq; Type: SEQUENCE; Schema: maker; Owner: - --- - -CREATE SEQUENCE maker.flip_kick_id_seq - AS integer - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: flip_kick_id_seq; Type: SEQUENCE OWNED BY; Schema: maker; Owner: - --- - -ALTER SEQUENCE maker.flip_kick_id_seq OWNED BY maker.flip_kick.id; - - --- --- Name: flop_kick; Type: TABLE; Schema: maker; Owner: - --- - -CREATE TABLE maker.flop_kick ( - id integer NOT NULL, - header_id integer NOT NULL, - bid_id numeric NOT NULL, - lot numeric NOT NULL, - bid numeric NOT NULL, - gal text, - "end" timestamp with time zone, - tx_idx integer NOT NULL, - log_idx integer NOT NULL, - raw_log jsonb -); - - --- --- Name: flop_kick_id_seq; Type: SEQUENCE; Schema: maker; Owner: - --- - -CREATE SEQUENCE maker.flop_kick_id_seq - AS integer - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: flop_kick_id_seq; Type: SEQUENCE OWNED BY; Schema: maker; Owner: - --- - -ALTER SEQUENCE maker.flop_kick_id_seq OWNED BY maker.flop_kick.id; - - --- --- Name: frob; Type: TABLE; Schema: maker; Owner: - --- - -CREATE TABLE maker.frob ( - id integer NOT NULL, - header_id integer NOT NULL, - ilk integer NOT NULL, - urn text, - dink numeric, - dart numeric, - ink numeric, - art numeric, - iart numeric, - log_idx integer NOT NULL, - tx_idx integer NOT NULL, - raw_log jsonb -); - - --- --- Name: frob_id_seq; Type: SEQUENCE; Schema: maker; Owner: - --- - -CREATE SEQUENCE maker.frob_id_seq - AS integer - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: frob_id_seq; Type: SEQUENCE OWNED BY; Schema: maker; Owner: - --- - -ALTER SEQUENCE maker.frob_id_seq OWNED BY maker.frob.id; - - --- --- Name: ilks; Type: TABLE; Schema: maker; Owner: - --- - -CREATE TABLE maker.ilks ( - id integer NOT NULL, - ilk text -); - - --- --- Name: ilks_id_seq; Type: SEQUENCE; Schema: maker; Owner: - --- - -CREATE SEQUENCE maker.ilks_id_seq - AS integer - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: ilks_id_seq; Type: SEQUENCE OWNED BY; Schema: maker; Owner: - --- - -ALTER SEQUENCE maker.ilks_id_seq OWNED BY maker.ilks.id; - - --- --- Name: pit_drip; Type: TABLE; Schema: maker; Owner: - --- - -CREATE TABLE maker.pit_drip ( - id integer NOT NULL, - block_number bigint, - block_hash text, - drip text -); - - --- --- Name: pit_drip_id_seq; Type: SEQUENCE; Schema: maker; Owner: - --- - -CREATE SEQUENCE maker.pit_drip_id_seq - AS integer - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: pit_drip_id_seq; Type: SEQUENCE OWNED BY; Schema: maker; Owner: - --- - -ALTER SEQUENCE maker.pit_drip_id_seq OWNED BY maker.pit_drip.id; - - --- --- Name: pit_file_debt_ceiling; Type: TABLE; Schema: maker; Owner: - --- - -CREATE TABLE maker.pit_file_debt_ceiling ( - id integer NOT NULL, - header_id integer NOT NULL, - what text, - data numeric, - log_idx integer NOT NULL, - tx_idx integer NOT NULL, - raw_log jsonb -); - - --- --- Name: pit_file_debt_ceiling_id_seq; Type: SEQUENCE; Schema: maker; Owner: - --- - -CREATE SEQUENCE maker.pit_file_debt_ceiling_id_seq - AS integer - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: pit_file_debt_ceiling_id_seq; Type: SEQUENCE OWNED BY; Schema: maker; Owner: - --- - -ALTER SEQUENCE maker.pit_file_debt_ceiling_id_seq OWNED BY maker.pit_file_debt_ceiling.id; - - --- --- Name: pit_file_ilk; Type: TABLE; Schema: maker; Owner: - --- - -CREATE TABLE maker.pit_file_ilk ( - id integer NOT NULL, - header_id integer NOT NULL, - ilk integer NOT NULL, - what text, - data numeric, - log_idx integer NOT NULL, - tx_idx integer NOT NULL, - raw_log jsonb -); - - --- --- Name: pit_file_ilk_id_seq; Type: SEQUENCE; Schema: maker; Owner: - --- - -CREATE SEQUENCE maker.pit_file_ilk_id_seq - AS integer - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: pit_file_ilk_id_seq; Type: SEQUENCE OWNED BY; Schema: maker; Owner: - --- - -ALTER SEQUENCE maker.pit_file_ilk_id_seq OWNED BY maker.pit_file_ilk.id; - - --- --- Name: pit_ilk_line; Type: TABLE; Schema: maker; Owner: - --- - -CREATE TABLE maker.pit_ilk_line ( - id integer NOT NULL, - block_number bigint, - block_hash text, - ilk integer NOT NULL, - line numeric NOT NULL -); - - --- --- Name: pit_ilk_line_id_seq; Type: SEQUENCE; Schema: maker; Owner: - --- - -CREATE SEQUENCE maker.pit_ilk_line_id_seq - AS integer - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: pit_ilk_line_id_seq; Type: SEQUENCE OWNED BY; Schema: maker; Owner: - --- - -ALTER SEQUENCE maker.pit_ilk_line_id_seq OWNED BY maker.pit_ilk_line.id; - - --- --- Name: pit_ilk_spot; Type: TABLE; Schema: maker; Owner: - --- - -CREATE TABLE maker.pit_ilk_spot ( - id integer NOT NULL, - block_number bigint, - block_hash text, - ilk integer NOT NULL, - spot numeric NOT NULL -); - - --- --- Name: pit_ilk_spot_id_seq; Type: SEQUENCE; Schema: maker; Owner: - --- - -CREATE SEQUENCE maker.pit_ilk_spot_id_seq - AS integer - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: pit_ilk_spot_id_seq; Type: SEQUENCE OWNED BY; Schema: maker; Owner: - --- - -ALTER SEQUENCE maker.pit_ilk_spot_id_seq OWNED BY maker.pit_ilk_spot.id; - - --- --- Name: pit_line; Type: TABLE; Schema: maker; Owner: - --- - -CREATE TABLE maker.pit_line ( - id integer NOT NULL, - block_number bigint, - block_hash text, - line numeric NOT NULL -); - - --- --- Name: pit_line_id_seq; Type: SEQUENCE; Schema: maker; Owner: - --- - -CREATE SEQUENCE maker.pit_line_id_seq - AS integer - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: pit_line_id_seq; Type: SEQUENCE OWNED BY; Schema: maker; Owner: - --- - -ALTER SEQUENCE maker.pit_line_id_seq OWNED BY maker.pit_line.id; - - --- --- Name: pit_live; Type: TABLE; Schema: maker; Owner: - --- - -CREATE TABLE maker.pit_live ( - id integer NOT NULL, - block_number bigint, - block_hash text, - live numeric NOT NULL -); - - --- --- Name: pit_live_id_seq; Type: SEQUENCE; Schema: maker; Owner: - --- - -CREATE SEQUENCE maker.pit_live_id_seq - AS integer - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: pit_live_id_seq; Type: SEQUENCE OWNED BY; Schema: maker; Owner: - --- - -ALTER SEQUENCE maker.pit_live_id_seq OWNED BY maker.pit_live.id; - - --- --- Name: pit_vat; Type: TABLE; Schema: maker; Owner: - --- - -CREATE TABLE maker.pit_vat ( - id integer NOT NULL, - block_number bigint, - block_hash text, - vat text -); - - --- --- Name: pit_vat_id_seq; Type: SEQUENCE; Schema: maker; Owner: - --- - -CREATE SEQUENCE maker.pit_vat_id_seq - AS integer - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: pit_vat_id_seq; Type: SEQUENCE OWNED BY; Schema: maker; Owner: - --- - -ALTER SEQUENCE maker.pit_vat_id_seq OWNED BY maker.pit_vat.id; - - --- --- Name: price_feeds; Type: TABLE; Schema: maker; Owner: - --- - -CREATE TABLE maker.price_feeds ( - id integer NOT NULL, - block_number bigint NOT NULL, - header_id integer NOT NULL, - medianizer_address text, - usd_value numeric, - log_idx integer NOT NULL, - tx_idx integer NOT NULL, - raw_log jsonb -); - - --- --- Name: price_feeds_id_seq; Type: SEQUENCE; Schema: maker; Owner: - --- - -CREATE SEQUENCE maker.price_feeds_id_seq - AS integer - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: price_feeds_id_seq; Type: SEQUENCE OWNED BY; Schema: maker; Owner: - --- - -ALTER SEQUENCE maker.price_feeds_id_seq OWNED BY maker.price_feeds.id; - - --- --- Name: tend; Type: TABLE; Schema: maker; Owner: - --- - -CREATE TABLE maker.tend ( - id integer NOT NULL, - header_id integer NOT NULL, - bid_id numeric NOT NULL, - lot numeric, - bid numeric, - guy text, - tic numeric, - log_idx integer NOT NULL, - tx_idx integer NOT NULL, - raw_log jsonb -); - - --- --- Name: tend_id_seq; Type: SEQUENCE; Schema: maker; Owner: - --- - -CREATE SEQUENCE maker.tend_id_seq - AS integer - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: tend_id_seq; Type: SEQUENCE OWNED BY; Schema: maker; Owner: - --- - -ALTER SEQUENCE maker.tend_id_seq OWNED BY maker.tend.id; - - --- --- Name: vat_dai; Type: TABLE; Schema: maker; Owner: - --- - -CREATE TABLE maker.vat_dai ( - id integer NOT NULL, - block_number bigint, - block_hash text, - guy text, - dai numeric NOT NULL -); - - --- --- Name: vat_dai_id_seq; Type: SEQUENCE; Schema: maker; Owner: - --- - -CREATE SEQUENCE maker.vat_dai_id_seq - AS integer - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: vat_dai_id_seq; Type: SEQUENCE OWNED BY; Schema: maker; Owner: - --- - -ALTER SEQUENCE maker.vat_dai_id_seq OWNED BY maker.vat_dai.id; - - --- --- Name: vat_debt; Type: TABLE; Schema: maker; Owner: - --- - -CREATE TABLE maker.vat_debt ( - id integer NOT NULL, - block_number bigint, - block_hash text, - debt numeric NOT NULL -); - - --- --- Name: vat_debt_id_seq; Type: SEQUENCE; Schema: maker; Owner: - --- - -CREATE SEQUENCE maker.vat_debt_id_seq - AS integer - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: vat_debt_id_seq; Type: SEQUENCE OWNED BY; Schema: maker; Owner: - --- - -ALTER SEQUENCE maker.vat_debt_id_seq OWNED BY maker.vat_debt.id; - - --- --- Name: vat_flux; Type: TABLE; Schema: maker; Owner: - --- - -CREATE TABLE maker.vat_flux ( - id integer NOT NULL, - header_id integer NOT NULL, - ilk integer NOT NULL, - src text, - dst text, - rad numeric, - tx_idx integer NOT NULL, - log_idx integer NOT NULL, - raw_log jsonb -); - - --- --- Name: vat_flux_id_seq; Type: SEQUENCE; Schema: maker; Owner: - --- - -CREATE SEQUENCE maker.vat_flux_id_seq - AS integer - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: vat_flux_id_seq; Type: SEQUENCE OWNED BY; Schema: maker; Owner: - --- - -ALTER SEQUENCE maker.vat_flux_id_seq OWNED BY maker.vat_flux.id; - - --- --- Name: vat_fold; Type: TABLE; Schema: maker; Owner: - --- - -CREATE TABLE maker.vat_fold ( - id integer NOT NULL, - header_id integer NOT NULL, - ilk integer NOT NULL, - urn text, - rate numeric, - log_idx integer NOT NULL, - tx_idx integer NOT NULL, - raw_log jsonb -); - - --- --- Name: vat_fold_id_seq; Type: SEQUENCE; Schema: maker; Owner: - --- - -CREATE SEQUENCE maker.vat_fold_id_seq - AS integer - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: vat_fold_id_seq; Type: SEQUENCE OWNED BY; Schema: maker; Owner: - --- - -ALTER SEQUENCE maker.vat_fold_id_seq OWNED BY maker.vat_fold.id; - - --- --- Name: vat_gem; Type: TABLE; Schema: maker; Owner: - --- - -CREATE TABLE maker.vat_gem ( - id integer NOT NULL, - block_number bigint, - block_hash text, - ilk integer NOT NULL, - guy text, - gem numeric NOT NULL -); - - --- --- Name: vat_gem_id_seq; Type: SEQUENCE; Schema: maker; Owner: - --- - -CREATE SEQUENCE maker.vat_gem_id_seq - AS integer - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: vat_gem_id_seq; Type: SEQUENCE OWNED BY; Schema: maker; Owner: - --- - -ALTER SEQUENCE maker.vat_gem_id_seq OWNED BY maker.vat_gem.id; - - --- --- Name: vat_grab; Type: TABLE; Schema: maker; Owner: - --- - -CREATE TABLE maker.vat_grab ( - id integer NOT NULL, - header_id integer NOT NULL, - ilk integer NOT NULL, - urn text, - v text, - w text, - dink numeric, - dart numeric, - log_idx integer NOT NULL, - tx_idx integer NOT NULL, - raw_log jsonb -); - - --- --- Name: vat_grab_id_seq; Type: SEQUENCE; Schema: maker; Owner: - --- - -CREATE SEQUENCE maker.vat_grab_id_seq - AS integer - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: vat_grab_id_seq; Type: SEQUENCE OWNED BY; Schema: maker; Owner: - --- - -ALTER SEQUENCE maker.vat_grab_id_seq OWNED BY maker.vat_grab.id; - - --- --- Name: vat_heal; Type: TABLE; Schema: maker; Owner: - --- - -CREATE TABLE maker.vat_heal ( - id integer NOT NULL, - header_id integer NOT NULL, - urn text, - v text, - rad numeric, - log_idx integer NOT NULL, - tx_idx integer NOT NULL, - raw_log jsonb -); - - --- --- Name: vat_heal_id_seq; Type: SEQUENCE; Schema: maker; Owner: - --- - -CREATE SEQUENCE maker.vat_heal_id_seq - AS integer - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: vat_heal_id_seq; Type: SEQUENCE OWNED BY; Schema: maker; Owner: - --- - -ALTER SEQUENCE maker.vat_heal_id_seq OWNED BY maker.vat_heal.id; - - --- --- Name: vat_ilk_art; Type: TABLE; Schema: maker; Owner: - --- - -CREATE TABLE maker.vat_ilk_art ( - id integer NOT NULL, - block_number bigint, - block_hash text, - ilk integer NOT NULL, - art numeric NOT NULL -); - - --- --- Name: vat_ilk_art_id_seq; Type: SEQUENCE; Schema: maker; Owner: - --- - -CREATE SEQUENCE maker.vat_ilk_art_id_seq - AS integer - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: vat_ilk_art_id_seq; Type: SEQUENCE OWNED BY; Schema: maker; Owner: - --- - -ALTER SEQUENCE maker.vat_ilk_art_id_seq OWNED BY maker.vat_ilk_art.id; - - --- --- Name: vat_ilk_ink; Type: TABLE; Schema: maker; Owner: - --- - -CREATE TABLE maker.vat_ilk_ink ( - id integer NOT NULL, - block_number bigint, - block_hash text, - ilk integer NOT NULL, - ink numeric NOT NULL -); - - --- --- Name: vat_ilk_ink_id_seq; Type: SEQUENCE; Schema: maker; Owner: - --- - -CREATE SEQUENCE maker.vat_ilk_ink_id_seq - AS integer - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: vat_ilk_ink_id_seq; Type: SEQUENCE OWNED BY; Schema: maker; Owner: - --- - -ALTER SEQUENCE maker.vat_ilk_ink_id_seq OWNED BY maker.vat_ilk_ink.id; - - --- --- Name: vat_ilk_rate; Type: TABLE; Schema: maker; Owner: - --- - -CREATE TABLE maker.vat_ilk_rate ( - id integer NOT NULL, - block_number bigint, - block_hash text, - ilk integer NOT NULL, - rate numeric NOT NULL -); - - --- --- Name: vat_ilk_rate_id_seq; Type: SEQUENCE; Schema: maker; Owner: - --- - -CREATE SEQUENCE maker.vat_ilk_rate_id_seq - AS integer - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: vat_ilk_rate_id_seq; Type: SEQUENCE OWNED BY; Schema: maker; Owner: - --- - -ALTER SEQUENCE maker.vat_ilk_rate_id_seq OWNED BY maker.vat_ilk_rate.id; - - --- --- Name: vat_ilk_take; Type: TABLE; Schema: maker; Owner: - --- - -CREATE TABLE maker.vat_ilk_take ( - id integer NOT NULL, - block_number bigint, - block_hash text, - ilk integer NOT NULL, - take numeric NOT NULL -); - - --- --- Name: vat_ilk_take_id_seq; Type: SEQUENCE; Schema: maker; Owner: - --- - -CREATE SEQUENCE maker.vat_ilk_take_id_seq - AS integer - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: vat_ilk_take_id_seq; Type: SEQUENCE OWNED BY; Schema: maker; Owner: - --- - -ALTER SEQUENCE maker.vat_ilk_take_id_seq OWNED BY maker.vat_ilk_take.id; - - --- --- Name: vat_init; Type: TABLE; Schema: maker; Owner: - --- - -CREATE TABLE maker.vat_init ( - id integer NOT NULL, - header_id integer NOT NULL, - ilk integer NOT NULL, - log_idx integer NOT NULL, - tx_idx integer NOT NULL, - raw_log jsonb -); - - --- --- Name: vat_init_id_seq; Type: SEQUENCE; Schema: maker; Owner: - --- - -CREATE SEQUENCE maker.vat_init_id_seq - AS integer - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: vat_init_id_seq; Type: SEQUENCE OWNED BY; Schema: maker; Owner: - --- - -ALTER SEQUENCE maker.vat_init_id_seq OWNED BY maker.vat_init.id; - - --- --- Name: vat_move; Type: TABLE; Schema: maker; Owner: - --- - -CREATE TABLE maker.vat_move ( - id integer NOT NULL, - header_id integer NOT NULL, - src text NOT NULL, - dst text NOT NULL, - rad numeric NOT NULL, - log_idx integer NOT NULL, - tx_idx integer NOT NULL, - raw_log jsonb -); - - --- --- Name: vat_move_id_seq; Type: SEQUENCE; Schema: maker; Owner: - --- - -CREATE SEQUENCE maker.vat_move_id_seq - AS integer - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: vat_move_id_seq; Type: SEQUENCE OWNED BY; Schema: maker; Owner: - --- - -ALTER SEQUENCE maker.vat_move_id_seq OWNED BY maker.vat_move.id; - - --- --- Name: vat_sin; Type: TABLE; Schema: maker; Owner: - --- - -CREATE TABLE maker.vat_sin ( - id integer NOT NULL, - block_number bigint, - block_hash text, - guy text, - sin numeric NOT NULL -); - - --- --- Name: vat_sin_id_seq; Type: SEQUENCE; Schema: maker; Owner: - --- - -CREATE SEQUENCE maker.vat_sin_id_seq - AS integer - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: vat_sin_id_seq; Type: SEQUENCE OWNED BY; Schema: maker; Owner: - --- - -ALTER SEQUENCE maker.vat_sin_id_seq OWNED BY maker.vat_sin.id; - - --- --- Name: vat_slip; Type: TABLE; Schema: maker; Owner: - --- - -CREATE TABLE maker.vat_slip ( - id integer NOT NULL, - header_id integer NOT NULL, - ilk integer NOT NULL, - guy text, - rad numeric, - tx_idx integer NOT NULL, - log_idx integer NOT NULL, - raw_log jsonb -); - - --- --- Name: vat_slip_id_seq; Type: SEQUENCE; Schema: maker; Owner: - --- - -CREATE SEQUENCE maker.vat_slip_id_seq - AS integer - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: vat_slip_id_seq; Type: SEQUENCE OWNED BY; Schema: maker; Owner: - --- - -ALTER SEQUENCE maker.vat_slip_id_seq OWNED BY maker.vat_slip.id; - - --- --- Name: vat_toll; Type: TABLE; Schema: maker; Owner: - --- - -CREATE TABLE maker.vat_toll ( - id integer NOT NULL, - header_id integer NOT NULL, - ilk integer NOT NULL, - urn text, - take numeric, - tx_idx integer NOT NULL, - log_idx integer NOT NULL, - raw_log jsonb -); - - --- --- Name: vat_toll_id_seq; Type: SEQUENCE; Schema: maker; Owner: - --- - -CREATE SEQUENCE maker.vat_toll_id_seq - AS integer - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: vat_toll_id_seq; Type: SEQUENCE OWNED BY; Schema: maker; Owner: - --- - -ALTER SEQUENCE maker.vat_toll_id_seq OWNED BY maker.vat_toll.id; - - --- --- Name: vat_tune; Type: TABLE; Schema: maker; Owner: - --- - -CREATE TABLE maker.vat_tune ( - id integer NOT NULL, - header_id integer NOT NULL, - ilk integer NOT NULL, - urn text, - v text, - w text, - dink numeric, - dart numeric, - tx_idx integer NOT NULL, - log_idx integer NOT NULL, - raw_log jsonb -); - - --- --- Name: vat_tune_id_seq; Type: SEQUENCE; Schema: maker; Owner: - --- - -CREATE SEQUENCE maker.vat_tune_id_seq - AS integer - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: vat_tune_id_seq; Type: SEQUENCE OWNED BY; Schema: maker; Owner: - --- - -ALTER SEQUENCE maker.vat_tune_id_seq OWNED BY maker.vat_tune.id; - - --- --- Name: vat_urn_art; Type: TABLE; Schema: maker; Owner: - --- - -CREATE TABLE maker.vat_urn_art ( - id integer NOT NULL, - block_number bigint, - block_hash text, - ilk integer NOT NULL, - urn text, - art text -); - - --- --- Name: vat_urn_art_id_seq; Type: SEQUENCE; Schema: maker; Owner: - --- - -CREATE SEQUENCE maker.vat_urn_art_id_seq - AS integer - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: vat_urn_art_id_seq; Type: SEQUENCE OWNED BY; Schema: maker; Owner: - --- - -ALTER SEQUENCE maker.vat_urn_art_id_seq OWNED BY maker.vat_urn_art.id; - - --- --- Name: vat_urn_ink; Type: TABLE; Schema: maker; Owner: - --- - -CREATE TABLE maker.vat_urn_ink ( - id integer NOT NULL, - block_number bigint, - block_hash text, - ilk integer NOT NULL, - urn text, - ink numeric NOT NULL -); - - --- --- Name: vat_urn_ink_id_seq; Type: SEQUENCE; Schema: maker; Owner: - --- - -CREATE SEQUENCE maker.vat_urn_ink_id_seq - AS integer - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: vat_urn_ink_id_seq; Type: SEQUENCE OWNED BY; Schema: maker; Owner: - --- - -ALTER SEQUENCE maker.vat_urn_ink_id_seq OWNED BY maker.vat_urn_ink.id; - - --- --- Name: vat_vice; Type: TABLE; Schema: maker; Owner: - --- - -CREATE TABLE maker.vat_vice ( - id integer NOT NULL, - block_number bigint, - block_hash text, - vice numeric NOT NULL -); - - --- --- Name: vat_vice_id_seq; Type: SEQUENCE; Schema: maker; Owner: - --- - -CREATE SEQUENCE maker.vat_vice_id_seq - AS integer - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: vat_vice_id_seq; Type: SEQUENCE OWNED BY; Schema: maker; Owner: - --- - -ALTER SEQUENCE maker.vat_vice_id_seq OWNED BY maker.vat_vice.id; - - --- --- Name: vow_ash; Type: TABLE; Schema: maker; Owner: - --- - -CREATE TABLE maker.vow_ash ( - id integer NOT NULL, - block_number bigint, - block_hash text, - ash numeric -); - - --- --- Name: vow_ash_id_seq; Type: SEQUENCE; Schema: maker; Owner: - --- - -CREATE SEQUENCE maker.vow_ash_id_seq - AS integer - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: vow_ash_id_seq; Type: SEQUENCE OWNED BY; Schema: maker; Owner: - --- - -ALTER SEQUENCE maker.vow_ash_id_seq OWNED BY maker.vow_ash.id; - - --- --- Name: vow_bump; Type: TABLE; Schema: maker; Owner: - --- - -CREATE TABLE maker.vow_bump ( - id integer NOT NULL, - block_number bigint, - block_hash text, - bump numeric -); - - --- --- Name: vow_bump_id_seq; Type: SEQUENCE; Schema: maker; Owner: - --- - -CREATE SEQUENCE maker.vow_bump_id_seq - AS integer - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: vow_bump_id_seq; Type: SEQUENCE OWNED BY; Schema: maker; Owner: - --- - -ALTER SEQUENCE maker.vow_bump_id_seq OWNED BY maker.vow_bump.id; - - --- --- Name: vow_cow; Type: TABLE; Schema: maker; Owner: - --- - -CREATE TABLE maker.vow_cow ( - id integer NOT NULL, - block_number bigint, - block_hash text, - cow text -); - - --- --- Name: vow_cow_id_seq; Type: SEQUENCE; Schema: maker; Owner: - --- - -CREATE SEQUENCE maker.vow_cow_id_seq - AS integer - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: vow_cow_id_seq; Type: SEQUENCE OWNED BY; Schema: maker; Owner: - --- - -ALTER SEQUENCE maker.vow_cow_id_seq OWNED BY maker.vow_cow.id; - - --- --- Name: vow_flog; Type: TABLE; Schema: maker; Owner: - --- - -CREATE TABLE maker.vow_flog ( - id integer NOT NULL, - header_id integer NOT NULL, - era integer NOT NULL, - log_idx integer NOT NULL, - tx_idx integer NOT NULL, - raw_log jsonb -); - - --- --- Name: vow_flog_id_seq; Type: SEQUENCE; Schema: maker; Owner: - --- - -CREATE SEQUENCE maker.vow_flog_id_seq - AS integer - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: vow_flog_id_seq; Type: SEQUENCE OWNED BY; Schema: maker; Owner: - --- - -ALTER SEQUENCE maker.vow_flog_id_seq OWNED BY maker.vow_flog.id; - - --- --- Name: vow_hump; Type: TABLE; Schema: maker; Owner: - --- - -CREATE TABLE maker.vow_hump ( - id integer NOT NULL, - block_number bigint, - block_hash text, - hump numeric -); - - --- --- Name: vow_hump_id_seq; Type: SEQUENCE; Schema: maker; Owner: - --- - -CREATE SEQUENCE maker.vow_hump_id_seq - AS integer - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: vow_hump_id_seq; Type: SEQUENCE OWNED BY; Schema: maker; Owner: - --- - -ALTER SEQUENCE maker.vow_hump_id_seq OWNED BY maker.vow_hump.id; - - --- --- Name: vow_row; Type: TABLE; Schema: maker; Owner: - --- - -CREATE TABLE maker.vow_row ( - id integer NOT NULL, - block_number bigint, - block_hash text, - "row" text -); - - --- --- Name: vow_row_id_seq; Type: SEQUENCE; Schema: maker; Owner: - --- - -CREATE SEQUENCE maker.vow_row_id_seq - AS integer - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: vow_row_id_seq; Type: SEQUENCE OWNED BY; Schema: maker; Owner: - --- - -ALTER SEQUENCE maker.vow_row_id_seq OWNED BY maker.vow_row.id; - - --- --- Name: vow_sin; Type: TABLE; Schema: maker; Owner: - --- - -CREATE TABLE maker.vow_sin ( - id integer NOT NULL, - block_number bigint, - block_hash text, - sin numeric -); - - --- --- Name: vow_sin_id_seq; Type: SEQUENCE; Schema: maker; Owner: - --- - -CREATE SEQUENCE maker.vow_sin_id_seq - AS integer - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: vow_sin_id_seq; Type: SEQUENCE OWNED BY; Schema: maker; Owner: - --- - -ALTER SEQUENCE maker.vow_sin_id_seq OWNED BY maker.vow_sin.id; - - --- --- Name: vow_sump; Type: TABLE; Schema: maker; Owner: - --- - -CREATE TABLE maker.vow_sump ( - id integer NOT NULL, - block_number bigint, - block_hash text, - sump numeric -); - - --- --- Name: vow_sump_id_seq; Type: SEQUENCE; Schema: maker; Owner: - --- - -CREATE SEQUENCE maker.vow_sump_id_seq - AS integer - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: vow_sump_id_seq; Type: SEQUENCE OWNED BY; Schema: maker; Owner: - --- - -ALTER SEQUENCE maker.vow_sump_id_seq OWNED BY maker.vow_sump.id; - - --- --- Name: vow_vat; Type: TABLE; Schema: maker; Owner: - --- - -CREATE TABLE maker.vow_vat ( - id integer NOT NULL, - block_number bigint, - block_hash text, - vat text -); - - --- --- Name: vow_vat_id_seq; Type: SEQUENCE; Schema: maker; Owner: - --- - -CREATE SEQUENCE maker.vow_vat_id_seq - AS integer - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: vow_vat_id_seq; Type: SEQUENCE OWNED BY; Schema: maker; Owner: - --- - -ALTER SEQUENCE maker.vow_vat_id_seq OWNED BY maker.vow_vat.id; - - --- --- Name: vow_wait; Type: TABLE; Schema: maker; Owner: - --- - -CREATE TABLE maker.vow_wait ( - id integer NOT NULL, - block_number bigint, - block_hash text, - wait numeric -); - - --- --- Name: vow_wait_id_seq; Type: SEQUENCE; Schema: maker; Owner: - --- - -CREATE SEQUENCE maker.vow_wait_id_seq - AS integer - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: vow_wait_id_seq; Type: SEQUENCE OWNED BY; Schema: maker; Owner: - --- - -ALTER SEQUENCE maker.vow_wait_id_seq OWNED BY maker.vow_wait.id; - - --- --- Name: vow_woe; Type: TABLE; Schema: maker; Owner: - --- - -CREATE TABLE maker.vow_woe ( - id integer NOT NULL, - block_number bigint, - block_hash text, - woe numeric -); - - --- --- Name: vow_woe_id_seq; Type: SEQUENCE; Schema: maker; Owner: - --- - -CREATE SEQUENCE maker.vow_woe_id_seq - AS integer - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: vow_woe_id_seq; Type: SEQUENCE OWNED BY; Schema: maker; Owner: - --- - -ALTER SEQUENCE maker.vow_woe_id_seq OWNED BY maker.vow_woe.id; - - -- -- Name: logs; Type: TABLE; Schema: public; Owner: - -- @@ -2462,34 +115,7 @@ ALTER SEQUENCE public.blocks_id_seq OWNED BY public.blocks.id; CREATE TABLE public.checked_headers ( id integer NOT NULL, header_id integer NOT NULL, - price_feeds_checked integer DEFAULT 0 NOT NULL, - flip_kick_checked integer DEFAULT 0 NOT NULL, - frob_checked integer DEFAULT 0 NOT NULL, - tend_checked integer DEFAULT 0 NOT NULL, - bite_checked integer DEFAULT 0 NOT NULL, - dent_checked integer DEFAULT 0 NOT NULL, - pit_file_debt_ceiling_checked integer DEFAULT 0 NOT NULL, - pit_file_ilk_checked integer DEFAULT 0 NOT NULL, - vat_init_checked integer DEFAULT 0 NOT NULL, - drip_file_ilk_checked integer DEFAULT 0 NOT NULL, - drip_file_repo_checked integer DEFAULT 0 NOT NULL, - drip_file_vow_checked integer DEFAULT 0 NOT NULL, - deal_checked integer DEFAULT 0 NOT NULL, - drip_drip_checked integer DEFAULT 0 NOT NULL, - cat_file_chop_lump_checked integer DEFAULT 0 NOT NULL, - cat_file_flip_checked integer DEFAULT 0 NOT NULL, - cat_file_pit_vow_checked integer DEFAULT 0 NOT NULL, - flop_kick_checked integer DEFAULT 0 NOT NULL, - vat_move_checked integer DEFAULT 0 NOT NULL, - vat_fold_checked integer DEFAULT 0 NOT NULL, - vat_heal_checked integer DEFAULT 0 NOT NULL, - vat_toll_checked integer DEFAULT 0 NOT NULL, - vat_tune_checked integer DEFAULT 0 NOT NULL, - vat_grab_checked integer DEFAULT 0 NOT NULL, - vat_flux_checked integer DEFAULT 0 NOT NULL, - vat_slip_checked integer DEFAULT 0 NOT NULL, - vow_flog_checked integer DEFAULT 0 NOT NULL, - flap_kick_checked integer DEFAULT 0 NOT NULL + price_feeds_checked integer DEFAULT 0 NOT NULL ); @@ -2673,40 +299,6 @@ CREATE SEQUENCE public.nodes_id_seq ALTER SEQUENCE public.nodes_id_seq OWNED BY public.eth_nodes.id; --- --- Name: queued_storage; Type: TABLE; Schema: public; Owner: - --- - -CREATE TABLE public.queued_storage ( - id integer NOT NULL, - block_height bigint, - block_hash bytea, - contract bytea, - storage_key bytea, - storage_value bytea -); - - --- --- Name: queued_storage_id_seq; Type: SEQUENCE; Schema: public; Owner: - --- - -CREATE SEQUENCE public.queued_storage_id_seq - AS integer - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: queued_storage_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - --- - -ALTER SEQUENCE public.queued_storage_id_seq OWNED BY public.queued_storage.id; - - -- -- Name: receipts; Type: TABLE; Schema: public; Owner: - -- @@ -2743,38 +335,6 @@ CREATE SEQUENCE public.receipts_id_seq ALTER SEQUENCE public.receipts_id_seq OWNED BY public.receipts.id; --- --- Name: token_supply; Type: TABLE; Schema: public; Owner: - --- - -CREATE TABLE public.token_supply ( - id integer NOT NULL, - block_id integer NOT NULL, - supply numeric NOT NULL, - token_address character varying(66) NOT NULL -); - - --- --- Name: token_supply_id_seq; Type: SEQUENCE; Schema: public; Owner: - --- - -CREATE SEQUENCE public.token_supply_id_seq - AS integer - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: token_supply_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - --- - -ALTER SEQUENCE public.token_supply_id_seq OWNED BY public.token_supply.id; - - -- -- Name: transactions; Type: TABLE; Schema: public; Owner: - -- @@ -2867,482 +427,6 @@ CREATE VIEW public.watched_event_logs AS WHERE ((((log_filters.topic0)::text = (logs.topic0)::text) OR (log_filters.topic0 IS NULL)) AND (((log_filters.topic1)::text = (logs.topic1)::text) OR (log_filters.topic1 IS NULL)) AND (((log_filters.topic2)::text = (logs.topic2)::text) OR (log_filters.topic2 IS NULL)) AND (((log_filters.topic3)::text = (logs.topic3)::text) OR (log_filters.topic3 IS NULL))); --- --- Name: bite id; Type: DEFAULT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.bite ALTER COLUMN id SET DEFAULT nextval('maker.bite_id_seq'::regclass); - - --- --- Name: cat_file_chop_lump id; Type: DEFAULT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.cat_file_chop_lump ALTER COLUMN id SET DEFAULT nextval('maker.cat_file_chop_lump_id_seq'::regclass); - - --- --- Name: cat_file_flip id; Type: DEFAULT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.cat_file_flip ALTER COLUMN id SET DEFAULT nextval('maker.cat_file_flip_id_seq'::regclass); - - --- --- Name: cat_file_pit_vow id; Type: DEFAULT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.cat_file_pit_vow ALTER COLUMN id SET DEFAULT nextval('maker.cat_file_pit_vow_id_seq'::regclass); - - --- --- Name: cat_flip_ilk id; Type: DEFAULT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.cat_flip_ilk ALTER COLUMN id SET DEFAULT nextval('maker.cat_flip_ilk_id_seq'::regclass); - - --- --- Name: cat_flip_ink id; Type: DEFAULT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.cat_flip_ink ALTER COLUMN id SET DEFAULT nextval('maker.cat_flip_ink_id_seq'::regclass); - - --- --- Name: cat_flip_tab id; Type: DEFAULT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.cat_flip_tab ALTER COLUMN id SET DEFAULT nextval('maker.cat_flip_tab_id_seq'::regclass); - - --- --- Name: cat_flip_urn id; Type: DEFAULT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.cat_flip_urn ALTER COLUMN id SET DEFAULT nextval('maker.cat_flip_urn_id_seq'::regclass); - - --- --- Name: cat_ilk_chop id; Type: DEFAULT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.cat_ilk_chop ALTER COLUMN id SET DEFAULT nextval('maker.cat_ilk_chop_id_seq'::regclass); - - --- --- Name: cat_ilk_flip id; Type: DEFAULT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.cat_ilk_flip ALTER COLUMN id SET DEFAULT nextval('maker.cat_ilk_flip_id_seq'::regclass); - - --- --- Name: cat_ilk_lump id; Type: DEFAULT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.cat_ilk_lump ALTER COLUMN id SET DEFAULT nextval('maker.cat_ilk_lump_id_seq'::regclass); - - --- --- Name: cat_live id; Type: DEFAULT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.cat_live ALTER COLUMN id SET DEFAULT nextval('maker.cat_live_id_seq'::regclass); - - --- --- Name: cat_nflip id; Type: DEFAULT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.cat_nflip ALTER COLUMN id SET DEFAULT nextval('maker.cat_nflip_id_seq'::regclass); - - --- --- Name: cat_pit id; Type: DEFAULT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.cat_pit ALTER COLUMN id SET DEFAULT nextval('maker.cat_pit_id_seq'::regclass); - - --- --- Name: cat_vat id; Type: DEFAULT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.cat_vat ALTER COLUMN id SET DEFAULT nextval('maker.cat_vat_id_seq'::regclass); - - --- --- Name: cat_vow id; Type: DEFAULT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.cat_vow ALTER COLUMN id SET DEFAULT nextval('maker.cat_vow_id_seq'::regclass); - - --- --- Name: deal id; Type: DEFAULT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.deal ALTER COLUMN id SET DEFAULT nextval('maker.deal_id_seq'::regclass); - - --- --- Name: dent id; Type: DEFAULT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.dent ALTER COLUMN id SET DEFAULT nextval('maker.dent_id_seq'::regclass); - - --- --- Name: drip_drip id; Type: DEFAULT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.drip_drip ALTER COLUMN id SET DEFAULT nextval('maker.drip_drip_id_seq'::regclass); - - --- --- Name: drip_file_ilk id; Type: DEFAULT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.drip_file_ilk ALTER COLUMN id SET DEFAULT nextval('maker.drip_file_ilk_id_seq'::regclass); - - --- --- Name: drip_file_repo id; Type: DEFAULT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.drip_file_repo ALTER COLUMN id SET DEFAULT nextval('maker.drip_file_repo_id_seq'::regclass); - - --- --- Name: drip_file_vow id; Type: DEFAULT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.drip_file_vow ALTER COLUMN id SET DEFAULT nextval('maker.drip_file_vow_id_seq'::regclass); - - --- --- Name: flap_kick id; Type: DEFAULT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.flap_kick ALTER COLUMN id SET DEFAULT nextval('maker.flap_kick_id_seq'::regclass); - - --- --- Name: flip_kick id; Type: DEFAULT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.flip_kick ALTER COLUMN id SET DEFAULT nextval('maker.flip_kick_id_seq'::regclass); - - --- --- Name: flop_kick id; Type: DEFAULT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.flop_kick ALTER COLUMN id SET DEFAULT nextval('maker.flop_kick_id_seq'::regclass); - - --- --- Name: frob id; Type: DEFAULT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.frob ALTER COLUMN id SET DEFAULT nextval('maker.frob_id_seq'::regclass); - - --- --- Name: ilks id; Type: DEFAULT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.ilks ALTER COLUMN id SET DEFAULT nextval('maker.ilks_id_seq'::regclass); - - --- --- Name: pit_drip id; Type: DEFAULT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.pit_drip ALTER COLUMN id SET DEFAULT nextval('maker.pit_drip_id_seq'::regclass); - - --- --- Name: pit_file_debt_ceiling id; Type: DEFAULT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.pit_file_debt_ceiling ALTER COLUMN id SET DEFAULT nextval('maker.pit_file_debt_ceiling_id_seq'::regclass); - - --- --- Name: pit_file_ilk id; Type: DEFAULT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.pit_file_ilk ALTER COLUMN id SET DEFAULT nextval('maker.pit_file_ilk_id_seq'::regclass); - - --- --- Name: pit_ilk_line id; Type: DEFAULT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.pit_ilk_line ALTER COLUMN id SET DEFAULT nextval('maker.pit_ilk_line_id_seq'::regclass); - - --- --- Name: pit_ilk_spot id; Type: DEFAULT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.pit_ilk_spot ALTER COLUMN id SET DEFAULT nextval('maker.pit_ilk_spot_id_seq'::regclass); - - --- --- Name: pit_line id; Type: DEFAULT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.pit_line ALTER COLUMN id SET DEFAULT nextval('maker.pit_line_id_seq'::regclass); - - --- --- Name: pit_live id; Type: DEFAULT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.pit_live ALTER COLUMN id SET DEFAULT nextval('maker.pit_live_id_seq'::regclass); - - --- --- Name: pit_vat id; Type: DEFAULT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.pit_vat ALTER COLUMN id SET DEFAULT nextval('maker.pit_vat_id_seq'::regclass); - - --- --- Name: price_feeds id; Type: DEFAULT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.price_feeds ALTER COLUMN id SET DEFAULT nextval('maker.price_feeds_id_seq'::regclass); - - --- --- Name: tend id; Type: DEFAULT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.tend ALTER COLUMN id SET DEFAULT nextval('maker.tend_id_seq'::regclass); - - --- --- Name: vat_dai id; Type: DEFAULT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.vat_dai ALTER COLUMN id SET DEFAULT nextval('maker.vat_dai_id_seq'::regclass); - - --- --- Name: vat_debt id; Type: DEFAULT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.vat_debt ALTER COLUMN id SET DEFAULT nextval('maker.vat_debt_id_seq'::regclass); - - --- --- Name: vat_flux id; Type: DEFAULT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.vat_flux ALTER COLUMN id SET DEFAULT nextval('maker.vat_flux_id_seq'::regclass); - - --- --- Name: vat_fold id; Type: DEFAULT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.vat_fold ALTER COLUMN id SET DEFAULT nextval('maker.vat_fold_id_seq'::regclass); - - --- --- Name: vat_gem id; Type: DEFAULT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.vat_gem ALTER COLUMN id SET DEFAULT nextval('maker.vat_gem_id_seq'::regclass); - - --- --- Name: vat_grab id; Type: DEFAULT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.vat_grab ALTER COLUMN id SET DEFAULT nextval('maker.vat_grab_id_seq'::regclass); - - --- --- Name: vat_heal id; Type: DEFAULT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.vat_heal ALTER COLUMN id SET DEFAULT nextval('maker.vat_heal_id_seq'::regclass); - - --- --- Name: vat_ilk_art id; Type: DEFAULT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.vat_ilk_art ALTER COLUMN id SET DEFAULT nextval('maker.vat_ilk_art_id_seq'::regclass); - - --- --- Name: vat_ilk_ink id; Type: DEFAULT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.vat_ilk_ink ALTER COLUMN id SET DEFAULT nextval('maker.vat_ilk_ink_id_seq'::regclass); - - --- --- Name: vat_ilk_rate id; Type: DEFAULT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.vat_ilk_rate ALTER COLUMN id SET DEFAULT nextval('maker.vat_ilk_rate_id_seq'::regclass); - - --- --- Name: vat_ilk_take id; Type: DEFAULT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.vat_ilk_take ALTER COLUMN id SET DEFAULT nextval('maker.vat_ilk_take_id_seq'::regclass); - - --- --- Name: vat_init id; Type: DEFAULT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.vat_init ALTER COLUMN id SET DEFAULT nextval('maker.vat_init_id_seq'::regclass); - - --- --- Name: vat_move id; Type: DEFAULT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.vat_move ALTER COLUMN id SET DEFAULT nextval('maker.vat_move_id_seq'::regclass); - - --- --- Name: vat_sin id; Type: DEFAULT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.vat_sin ALTER COLUMN id SET DEFAULT nextval('maker.vat_sin_id_seq'::regclass); - - --- --- Name: vat_slip id; Type: DEFAULT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.vat_slip ALTER COLUMN id SET DEFAULT nextval('maker.vat_slip_id_seq'::regclass); - - --- --- Name: vat_toll id; Type: DEFAULT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.vat_toll ALTER COLUMN id SET DEFAULT nextval('maker.vat_toll_id_seq'::regclass); - - --- --- Name: vat_tune id; Type: DEFAULT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.vat_tune ALTER COLUMN id SET DEFAULT nextval('maker.vat_tune_id_seq'::regclass); - - --- --- Name: vat_urn_art id; Type: DEFAULT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.vat_urn_art ALTER COLUMN id SET DEFAULT nextval('maker.vat_urn_art_id_seq'::regclass); - - --- --- Name: vat_urn_ink id; Type: DEFAULT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.vat_urn_ink ALTER COLUMN id SET DEFAULT nextval('maker.vat_urn_ink_id_seq'::regclass); - - --- --- Name: vat_vice id; Type: DEFAULT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.vat_vice ALTER COLUMN id SET DEFAULT nextval('maker.vat_vice_id_seq'::regclass); - - --- --- Name: vow_ash id; Type: DEFAULT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.vow_ash ALTER COLUMN id SET DEFAULT nextval('maker.vow_ash_id_seq'::regclass); - - --- --- Name: vow_bump id; Type: DEFAULT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.vow_bump ALTER COLUMN id SET DEFAULT nextval('maker.vow_bump_id_seq'::regclass); - - --- --- Name: vow_cow id; Type: DEFAULT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.vow_cow ALTER COLUMN id SET DEFAULT nextval('maker.vow_cow_id_seq'::regclass); - - --- --- Name: vow_flog id; Type: DEFAULT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.vow_flog ALTER COLUMN id SET DEFAULT nextval('maker.vow_flog_id_seq'::regclass); - - --- --- Name: vow_hump id; Type: DEFAULT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.vow_hump ALTER COLUMN id SET DEFAULT nextval('maker.vow_hump_id_seq'::regclass); - - --- --- Name: vow_row id; Type: DEFAULT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.vow_row ALTER COLUMN id SET DEFAULT nextval('maker.vow_row_id_seq'::regclass); - - --- --- Name: vow_sin id; Type: DEFAULT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.vow_sin ALTER COLUMN id SET DEFAULT nextval('maker.vow_sin_id_seq'::regclass); - - --- --- Name: vow_sump id; Type: DEFAULT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.vow_sump ALTER COLUMN id SET DEFAULT nextval('maker.vow_sump_id_seq'::regclass); - - --- --- Name: vow_vat id; Type: DEFAULT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.vow_vat ALTER COLUMN id SET DEFAULT nextval('maker.vow_vat_id_seq'::regclass); - - --- --- Name: vow_wait id; Type: DEFAULT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.vow_wait ALTER COLUMN id SET DEFAULT nextval('maker.vow_wait_id_seq'::regclass); - - --- --- Name: vow_woe id; Type: DEFAULT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.vow_woe ALTER COLUMN id SET DEFAULT nextval('maker.vow_woe_id_seq'::regclass); - - -- -- Name: blocks id; Type: DEFAULT; Schema: public; Owner: - -- @@ -3392,13 +476,6 @@ ALTER TABLE ONLY public.log_filters ALTER COLUMN id SET DEFAULT nextval('public. ALTER TABLE ONLY public.logs ALTER COLUMN id SET DEFAULT nextval('public.logs_id_seq'::regclass); --- --- Name: queued_storage id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.queued_storage ALTER COLUMN id SET DEFAULT nextval('public.queued_storage_id_seq'::regclass); - - -- -- Name: receipts id; Type: DEFAULT; Schema: public; Owner: - -- @@ -3406,13 +483,6 @@ ALTER TABLE ONLY public.queued_storage ALTER COLUMN id SET DEFAULT nextval('publ ALTER TABLE ONLY public.receipts ALTER COLUMN id SET DEFAULT nextval('public.receipts_id_seq'::regclass); --- --- Name: token_supply id; Type: DEFAULT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.token_supply ALTER COLUMN id SET DEFAULT nextval('public.token_supply_id_seq'::regclass); - - -- -- Name: transactions id; Type: DEFAULT; Schema: public; Owner: - -- @@ -3427,726 +497,6 @@ ALTER TABLE ONLY public.transactions ALTER COLUMN id SET DEFAULT nextval('public ALTER TABLE ONLY public.watched_contracts ALTER COLUMN contract_id SET DEFAULT nextval('public.watched_contracts_contract_id_seq'::regclass); --- --- Name: bite bite_header_id_tx_idx_log_idx_key; Type: CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.bite - ADD CONSTRAINT bite_header_id_tx_idx_log_idx_key UNIQUE (header_id, tx_idx, log_idx); - - --- --- Name: bite bite_pkey; Type: CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.bite - ADD CONSTRAINT bite_pkey PRIMARY KEY (id); - - --- --- Name: cat_file_chop_lump cat_file_chop_lump_header_id_tx_idx_log_idx_key; Type: CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.cat_file_chop_lump - ADD CONSTRAINT cat_file_chop_lump_header_id_tx_idx_log_idx_key UNIQUE (header_id, tx_idx, log_idx); - - --- --- Name: cat_file_chop_lump cat_file_chop_lump_pkey; Type: CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.cat_file_chop_lump - ADD CONSTRAINT cat_file_chop_lump_pkey PRIMARY KEY (id); - - --- --- Name: cat_file_flip cat_file_flip_header_id_tx_idx_log_idx_key; Type: CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.cat_file_flip - ADD CONSTRAINT cat_file_flip_header_id_tx_idx_log_idx_key UNIQUE (header_id, tx_idx, log_idx); - - --- --- Name: cat_file_flip cat_file_flip_pkey; Type: CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.cat_file_flip - ADD CONSTRAINT cat_file_flip_pkey PRIMARY KEY (id); - - --- --- Name: cat_file_pit_vow cat_file_pit_vow_header_id_tx_idx_log_idx_key; Type: CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.cat_file_pit_vow - ADD CONSTRAINT cat_file_pit_vow_header_id_tx_idx_log_idx_key UNIQUE (header_id, tx_idx, log_idx); - - --- --- Name: cat_file_pit_vow cat_file_pit_vow_pkey; Type: CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.cat_file_pit_vow - ADD CONSTRAINT cat_file_pit_vow_pkey PRIMARY KEY (id); - - --- --- Name: cat_flip_ilk cat_flip_ilk_pkey; Type: CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.cat_flip_ilk - ADD CONSTRAINT cat_flip_ilk_pkey PRIMARY KEY (id); - - --- --- Name: cat_flip_ink cat_flip_ink_pkey; Type: CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.cat_flip_ink - ADD CONSTRAINT cat_flip_ink_pkey PRIMARY KEY (id); - - --- --- Name: cat_flip_tab cat_flip_tab_pkey; Type: CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.cat_flip_tab - ADD CONSTRAINT cat_flip_tab_pkey PRIMARY KEY (id); - - --- --- Name: cat_flip_urn cat_flip_urn_pkey; Type: CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.cat_flip_urn - ADD CONSTRAINT cat_flip_urn_pkey PRIMARY KEY (id); - - --- --- Name: cat_ilk_chop cat_ilk_chop_pkey; Type: CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.cat_ilk_chop - ADD CONSTRAINT cat_ilk_chop_pkey PRIMARY KEY (id); - - --- --- Name: cat_ilk_flip cat_ilk_flip_pkey; Type: CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.cat_ilk_flip - ADD CONSTRAINT cat_ilk_flip_pkey PRIMARY KEY (id); - - --- --- Name: cat_ilk_lump cat_ilk_lump_pkey; Type: CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.cat_ilk_lump - ADD CONSTRAINT cat_ilk_lump_pkey PRIMARY KEY (id); - - --- --- Name: cat_live cat_live_pkey; Type: CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.cat_live - ADD CONSTRAINT cat_live_pkey PRIMARY KEY (id); - - --- --- Name: cat_nflip cat_nflip_pkey; Type: CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.cat_nflip - ADD CONSTRAINT cat_nflip_pkey PRIMARY KEY (id); - - --- --- Name: cat_pit cat_pit_pkey; Type: CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.cat_pit - ADD CONSTRAINT cat_pit_pkey PRIMARY KEY (id); - - --- --- Name: cat_vat cat_vat_pkey; Type: CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.cat_vat - ADD CONSTRAINT cat_vat_pkey PRIMARY KEY (id); - - --- --- Name: cat_vow cat_vow_pkey; Type: CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.cat_vow - ADD CONSTRAINT cat_vow_pkey PRIMARY KEY (id); - - --- --- Name: deal deal_header_id_tx_idx_log_idx_key; Type: CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.deal - ADD CONSTRAINT deal_header_id_tx_idx_log_idx_key UNIQUE (header_id, tx_idx, log_idx); - - --- --- Name: deal deal_pkey; Type: CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.deal - ADD CONSTRAINT deal_pkey PRIMARY KEY (id); - - --- --- Name: dent dent_header_id_tx_idx_log_idx_key; Type: CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.dent - ADD CONSTRAINT dent_header_id_tx_idx_log_idx_key UNIQUE (header_id, tx_idx, log_idx); - - --- --- Name: dent dent_pkey; Type: CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.dent - ADD CONSTRAINT dent_pkey PRIMARY KEY (id); - - --- --- Name: drip_drip drip_drip_header_id_tx_idx_log_idx_key; Type: CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.drip_drip - ADD CONSTRAINT drip_drip_header_id_tx_idx_log_idx_key UNIQUE (header_id, tx_idx, log_idx); - - --- --- Name: drip_drip drip_drip_pkey; Type: CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.drip_drip - ADD CONSTRAINT drip_drip_pkey PRIMARY KEY (id); - - --- --- Name: drip_file_ilk drip_file_ilk_header_id_tx_idx_log_idx_key; Type: CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.drip_file_ilk - ADD CONSTRAINT drip_file_ilk_header_id_tx_idx_log_idx_key UNIQUE (header_id, tx_idx, log_idx); - - --- --- Name: drip_file_ilk drip_file_ilk_pkey; Type: CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.drip_file_ilk - ADD CONSTRAINT drip_file_ilk_pkey PRIMARY KEY (id); - - --- --- Name: drip_file_repo drip_file_repo_header_id_tx_idx_log_idx_key; Type: CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.drip_file_repo - ADD CONSTRAINT drip_file_repo_header_id_tx_idx_log_idx_key UNIQUE (header_id, tx_idx, log_idx); - - --- --- Name: drip_file_repo drip_file_repo_pkey; Type: CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.drip_file_repo - ADD CONSTRAINT drip_file_repo_pkey PRIMARY KEY (id); - - --- --- Name: drip_file_vow drip_file_vow_header_id_tx_idx_log_idx_key; Type: CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.drip_file_vow - ADD CONSTRAINT drip_file_vow_header_id_tx_idx_log_idx_key UNIQUE (header_id, tx_idx, log_idx); - - --- --- Name: drip_file_vow drip_file_vow_pkey; Type: CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.drip_file_vow - ADD CONSTRAINT drip_file_vow_pkey PRIMARY KEY (id); - - --- --- Name: flap_kick flap_kick_header_id_tx_idx_log_idx_key; Type: CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.flap_kick - ADD CONSTRAINT flap_kick_header_id_tx_idx_log_idx_key UNIQUE (header_id, tx_idx, log_idx); - - --- --- Name: flap_kick flap_kick_pkey; Type: CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.flap_kick - ADD CONSTRAINT flap_kick_pkey PRIMARY KEY (id); - - --- --- Name: flip_kick flip_kick_header_id_tx_idx_log_idx_key; Type: CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.flip_kick - ADD CONSTRAINT flip_kick_header_id_tx_idx_log_idx_key UNIQUE (header_id, tx_idx, log_idx); - - --- --- Name: flip_kick flip_kick_pkey; Type: CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.flip_kick - ADD CONSTRAINT flip_kick_pkey PRIMARY KEY (id); - - --- --- Name: flop_kick flop_kick_header_id_tx_idx_log_idx_key; Type: CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.flop_kick - ADD CONSTRAINT flop_kick_header_id_tx_idx_log_idx_key UNIQUE (header_id, tx_idx, log_idx); - - --- --- Name: flop_kick flop_kick_pkey; Type: CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.flop_kick - ADD CONSTRAINT flop_kick_pkey PRIMARY KEY (id); - - --- --- Name: frob frob_header_id_tx_idx_log_idx_key; Type: CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.frob - ADD CONSTRAINT frob_header_id_tx_idx_log_idx_key UNIQUE (header_id, tx_idx, log_idx); - - --- --- Name: frob frob_pkey; Type: CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.frob - ADD CONSTRAINT frob_pkey PRIMARY KEY (id); - - --- --- Name: ilks ilks_ilk_key; Type: CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.ilks - ADD CONSTRAINT ilks_ilk_key UNIQUE (ilk); - - --- --- Name: ilks ilks_pkey; Type: CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.ilks - ADD CONSTRAINT ilks_pkey PRIMARY KEY (id); - - --- --- Name: pit_drip pit_drip_pkey; Type: CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.pit_drip - ADD CONSTRAINT pit_drip_pkey PRIMARY KEY (id); - - --- --- Name: pit_file_debt_ceiling pit_file_debt_ceiling_header_id_tx_idx_log_idx_key; Type: CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.pit_file_debt_ceiling - ADD CONSTRAINT pit_file_debt_ceiling_header_id_tx_idx_log_idx_key UNIQUE (header_id, tx_idx, log_idx); - - --- --- Name: pit_file_debt_ceiling pit_file_debt_ceiling_pkey; Type: CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.pit_file_debt_ceiling - ADD CONSTRAINT pit_file_debt_ceiling_pkey PRIMARY KEY (id); - - --- --- Name: pit_file_ilk pit_file_ilk_header_id_tx_idx_log_idx_key; Type: CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.pit_file_ilk - ADD CONSTRAINT pit_file_ilk_header_id_tx_idx_log_idx_key UNIQUE (header_id, tx_idx, log_idx); - - --- --- Name: pit_file_ilk pit_file_ilk_pkey; Type: CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.pit_file_ilk - ADD CONSTRAINT pit_file_ilk_pkey PRIMARY KEY (id); - - --- --- Name: pit_ilk_line pit_ilk_line_pkey; Type: CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.pit_ilk_line - ADD CONSTRAINT pit_ilk_line_pkey PRIMARY KEY (id); - - --- --- Name: pit_ilk_spot pit_ilk_spot_pkey; Type: CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.pit_ilk_spot - ADD CONSTRAINT pit_ilk_spot_pkey PRIMARY KEY (id); - - --- --- Name: pit_line pit_line_pkey; Type: CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.pit_line - ADD CONSTRAINT pit_line_pkey PRIMARY KEY (id); - - --- --- Name: pit_live pit_live_pkey; Type: CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.pit_live - ADD CONSTRAINT pit_live_pkey PRIMARY KEY (id); - - --- --- Name: pit_vat pit_vat_pkey; Type: CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.pit_vat - ADD CONSTRAINT pit_vat_pkey PRIMARY KEY (id); - - --- --- Name: price_feeds price_feeds_header_id_medianizer_address_tx_idx_log_idx_key; Type: CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.price_feeds - ADD CONSTRAINT price_feeds_header_id_medianizer_address_tx_idx_log_idx_key UNIQUE (header_id, medianizer_address, tx_idx, log_idx); - - --- --- Name: price_feeds price_feeds_pkey; Type: CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.price_feeds - ADD CONSTRAINT price_feeds_pkey PRIMARY KEY (id); - - --- --- Name: tend tend_header_id_tx_idx_log_idx_key; Type: CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.tend - ADD CONSTRAINT tend_header_id_tx_idx_log_idx_key UNIQUE (header_id, tx_idx, log_idx); - - --- --- Name: tend tend_pkey; Type: CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.tend - ADD CONSTRAINT tend_pkey PRIMARY KEY (id); - - --- --- Name: vat_dai vat_dai_pkey; Type: CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.vat_dai - ADD CONSTRAINT vat_dai_pkey PRIMARY KEY (id); - - --- --- Name: vat_debt vat_debt_pkey; Type: CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.vat_debt - ADD CONSTRAINT vat_debt_pkey PRIMARY KEY (id); - - --- --- Name: vat_flux vat_flux_header_id_tx_idx_log_idx_key; Type: CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.vat_flux - ADD CONSTRAINT vat_flux_header_id_tx_idx_log_idx_key UNIQUE (header_id, tx_idx, log_idx); - - --- --- Name: vat_flux vat_flux_pkey; Type: CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.vat_flux - ADD CONSTRAINT vat_flux_pkey PRIMARY KEY (id); - - --- --- Name: vat_fold vat_fold_header_id_tx_idx_log_idx_key; Type: CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.vat_fold - ADD CONSTRAINT vat_fold_header_id_tx_idx_log_idx_key UNIQUE (header_id, tx_idx, log_idx); - - --- --- Name: vat_fold vat_fold_pkey; Type: CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.vat_fold - ADD CONSTRAINT vat_fold_pkey PRIMARY KEY (id); - - --- --- Name: vat_gem vat_gem_pkey; Type: CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.vat_gem - ADD CONSTRAINT vat_gem_pkey PRIMARY KEY (id); - - --- --- Name: vat_grab vat_grab_header_id_tx_idx_log_idx_key; Type: CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.vat_grab - ADD CONSTRAINT vat_grab_header_id_tx_idx_log_idx_key UNIQUE (header_id, tx_idx, log_idx); - - --- --- Name: vat_grab vat_grab_pkey; Type: CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.vat_grab - ADD CONSTRAINT vat_grab_pkey PRIMARY KEY (id); - - --- --- Name: vat_heal vat_heal_header_id_tx_idx_log_idx_key; Type: CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.vat_heal - ADD CONSTRAINT vat_heal_header_id_tx_idx_log_idx_key UNIQUE (header_id, tx_idx, log_idx); - - --- --- Name: vat_heal vat_heal_pkey; Type: CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.vat_heal - ADD CONSTRAINT vat_heal_pkey PRIMARY KEY (id); - - --- --- Name: vat_ilk_art vat_ilk_art_pkey; Type: CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.vat_ilk_art - ADD CONSTRAINT vat_ilk_art_pkey PRIMARY KEY (id); - - --- --- Name: vat_ilk_ink vat_ilk_ink_pkey; Type: CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.vat_ilk_ink - ADD CONSTRAINT vat_ilk_ink_pkey PRIMARY KEY (id); - - --- --- Name: vat_ilk_rate vat_ilk_rate_pkey; Type: CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.vat_ilk_rate - ADD CONSTRAINT vat_ilk_rate_pkey PRIMARY KEY (id); - - --- --- Name: vat_ilk_take vat_ilk_take_pkey; Type: CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.vat_ilk_take - ADD CONSTRAINT vat_ilk_take_pkey PRIMARY KEY (id); - - --- --- Name: vat_init vat_init_header_id_tx_idx_log_idx_key; Type: CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.vat_init - ADD CONSTRAINT vat_init_header_id_tx_idx_log_idx_key UNIQUE (header_id, tx_idx, log_idx); - - --- --- Name: vat_init vat_init_pkey; Type: CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.vat_init - ADD CONSTRAINT vat_init_pkey PRIMARY KEY (id); - - --- --- Name: vat_move vat_move_header_id_tx_idx_log_idx_key; Type: CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.vat_move - ADD CONSTRAINT vat_move_header_id_tx_idx_log_idx_key UNIQUE (header_id, tx_idx, log_idx); - - --- --- Name: vat_move vat_move_pkey; Type: CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.vat_move - ADD CONSTRAINT vat_move_pkey PRIMARY KEY (id); - - --- --- Name: vat_sin vat_sin_pkey; Type: CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.vat_sin - ADD CONSTRAINT vat_sin_pkey PRIMARY KEY (id); - - --- --- Name: vat_slip vat_slip_header_id_tx_idx_log_idx_key; Type: CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.vat_slip - ADD CONSTRAINT vat_slip_header_id_tx_idx_log_idx_key UNIQUE (header_id, tx_idx, log_idx); - - --- --- Name: vat_slip vat_slip_pkey; Type: CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.vat_slip - ADD CONSTRAINT vat_slip_pkey PRIMARY KEY (id); - - --- --- Name: vat_toll vat_toll_header_id_tx_idx_log_idx_key; Type: CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.vat_toll - ADD CONSTRAINT vat_toll_header_id_tx_idx_log_idx_key UNIQUE (header_id, tx_idx, log_idx); - - --- --- Name: vat_toll vat_toll_pkey; Type: CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.vat_toll - ADD CONSTRAINT vat_toll_pkey PRIMARY KEY (id); - - --- --- Name: vat_tune vat_tune_header_id_tx_idx_log_idx_key; Type: CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.vat_tune - ADD CONSTRAINT vat_tune_header_id_tx_idx_log_idx_key UNIQUE (header_id, tx_idx, log_idx); - - --- --- Name: vat_tune vat_tune_pkey; Type: CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.vat_tune - ADD CONSTRAINT vat_tune_pkey PRIMARY KEY (id); - - --- --- Name: vat_urn_art vat_urn_art_pkey; Type: CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.vat_urn_art - ADD CONSTRAINT vat_urn_art_pkey PRIMARY KEY (id); - - --- --- Name: vat_urn_ink vat_urn_ink_pkey; Type: CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.vat_urn_ink - ADD CONSTRAINT vat_urn_ink_pkey PRIMARY KEY (id); - - --- --- Name: vat_vice vat_vice_pkey; Type: CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.vat_vice - ADD CONSTRAINT vat_vice_pkey PRIMARY KEY (id); - - --- --- Name: vow_ash vow_ash_pkey; Type: CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.vow_ash - ADD CONSTRAINT vow_ash_pkey PRIMARY KEY (id); - - --- --- Name: vow_bump vow_bump_pkey; Type: CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.vow_bump - ADD CONSTRAINT vow_bump_pkey PRIMARY KEY (id); - - --- --- Name: vow_cow vow_cow_pkey; Type: CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.vow_cow - ADD CONSTRAINT vow_cow_pkey PRIMARY KEY (id); - - --- --- Name: vow_flog vow_flog_header_id_tx_idx_log_idx_key; Type: CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.vow_flog - ADD CONSTRAINT vow_flog_header_id_tx_idx_log_idx_key UNIQUE (header_id, tx_idx, log_idx); - - --- --- Name: vow_flog vow_flog_pkey; Type: CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.vow_flog - ADD CONSTRAINT vow_flog_pkey PRIMARY KEY (id); - - -- -- Name: vow_hump vow_hump_pkey; Type: CONSTRAINT; Schema: maker; Owner: - -- @@ -4358,445 +708,6 @@ CREATE INDEX tx_from_index ON public.transactions USING btree (tx_from); CREATE INDEX tx_to_index ON public.transactions USING btree (tx_to); --- --- Name: price_feeds notify_pricefeeds; Type: TRIGGER; Schema: maker; Owner: - --- - -CREATE TRIGGER notify_pricefeeds AFTER INSERT ON maker.price_feeds FOR EACH ROW EXECUTE PROCEDURE public.notify_pricefeed(); - - --- --- Name: bite bite_header_id_fkey; Type: FK CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.bite - ADD CONSTRAINT bite_header_id_fkey FOREIGN KEY (header_id) REFERENCES public.headers(id) ON DELETE CASCADE; - - --- --- Name: bite bite_ilk_fkey; Type: FK CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.bite - ADD CONSTRAINT bite_ilk_fkey FOREIGN KEY (ilk) REFERENCES maker.ilks(id); - - --- --- Name: cat_file_chop_lump cat_file_chop_lump_header_id_fkey; Type: FK CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.cat_file_chop_lump - ADD CONSTRAINT cat_file_chop_lump_header_id_fkey FOREIGN KEY (header_id) REFERENCES public.headers(id) ON DELETE CASCADE; - - --- --- Name: cat_file_chop_lump cat_file_chop_lump_ilk_fkey; Type: FK CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.cat_file_chop_lump - ADD CONSTRAINT cat_file_chop_lump_ilk_fkey FOREIGN KEY (ilk) REFERENCES maker.ilks(id); - - --- --- Name: cat_file_flip cat_file_flip_header_id_fkey; Type: FK CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.cat_file_flip - ADD CONSTRAINT cat_file_flip_header_id_fkey FOREIGN KEY (header_id) REFERENCES public.headers(id) ON DELETE CASCADE; - - --- --- Name: cat_file_pit_vow cat_file_pit_vow_header_id_fkey; Type: FK CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.cat_file_pit_vow - ADD CONSTRAINT cat_file_pit_vow_header_id_fkey FOREIGN KEY (header_id) REFERENCES public.headers(id) ON DELETE CASCADE; - - --- --- Name: cat_flip_ilk cat_flip_ilk_ilk_fkey; Type: FK CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.cat_flip_ilk - ADD CONSTRAINT cat_flip_ilk_ilk_fkey FOREIGN KEY (ilk) REFERENCES maker.ilks(id); - - --- --- Name: cat_ilk_chop cat_ilk_chop_ilk_fkey; Type: FK CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.cat_ilk_chop - ADD CONSTRAINT cat_ilk_chop_ilk_fkey FOREIGN KEY (ilk) REFERENCES maker.ilks(id); - - --- --- Name: cat_ilk_flip cat_ilk_flip_ilk_fkey; Type: FK CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.cat_ilk_flip - ADD CONSTRAINT cat_ilk_flip_ilk_fkey FOREIGN KEY (ilk) REFERENCES maker.ilks(id); - - --- --- Name: cat_ilk_lump cat_ilk_lump_ilk_fkey; Type: FK CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.cat_ilk_lump - ADD CONSTRAINT cat_ilk_lump_ilk_fkey FOREIGN KEY (ilk) REFERENCES maker.ilks(id); - - --- --- Name: deal deal_header_id_fkey; Type: FK CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.deal - ADD CONSTRAINT deal_header_id_fkey FOREIGN KEY (header_id) REFERENCES public.headers(id) ON DELETE CASCADE; - - --- --- Name: dent dent_header_id_fkey; Type: FK CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.dent - ADD CONSTRAINT dent_header_id_fkey FOREIGN KEY (header_id) REFERENCES public.headers(id) ON DELETE CASCADE; - - --- --- Name: drip_drip drip_drip_header_id_fkey; Type: FK CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.drip_drip - ADD CONSTRAINT drip_drip_header_id_fkey FOREIGN KEY (header_id) REFERENCES public.headers(id) ON DELETE CASCADE; - - --- --- Name: drip_drip drip_drip_ilk_fkey; Type: FK CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.drip_drip - ADD CONSTRAINT drip_drip_ilk_fkey FOREIGN KEY (ilk) REFERENCES maker.ilks(id); - - --- --- Name: drip_file_ilk drip_file_ilk_header_id_fkey; Type: FK CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.drip_file_ilk - ADD CONSTRAINT drip_file_ilk_header_id_fkey FOREIGN KEY (header_id) REFERENCES public.headers(id) ON DELETE CASCADE; - - --- --- Name: drip_file_ilk drip_file_ilk_ilk_fkey; Type: FK CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.drip_file_ilk - ADD CONSTRAINT drip_file_ilk_ilk_fkey FOREIGN KEY (ilk) REFERENCES maker.ilks(id); - - --- --- Name: drip_file_repo drip_file_repo_header_id_fkey; Type: FK CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.drip_file_repo - ADD CONSTRAINT drip_file_repo_header_id_fkey FOREIGN KEY (header_id) REFERENCES public.headers(id) ON DELETE CASCADE; - - --- --- Name: drip_file_vow drip_file_vow_header_id_fkey; Type: FK CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.drip_file_vow - ADD CONSTRAINT drip_file_vow_header_id_fkey FOREIGN KEY (header_id) REFERENCES public.headers(id) ON DELETE CASCADE; - - --- --- Name: flap_kick flap_kick_header_id_fkey; Type: FK CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.flap_kick - ADD CONSTRAINT flap_kick_header_id_fkey FOREIGN KEY (header_id) REFERENCES public.headers(id) ON DELETE CASCADE; - - --- --- Name: flip_kick flip_kick_header_id_fkey; Type: FK CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.flip_kick - ADD CONSTRAINT flip_kick_header_id_fkey FOREIGN KEY (header_id) REFERENCES public.headers(id) ON DELETE CASCADE; - - --- --- Name: flop_kick flop_kick_header_id_fkey; Type: FK CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.flop_kick - ADD CONSTRAINT flop_kick_header_id_fkey FOREIGN KEY (header_id) REFERENCES public.headers(id) ON DELETE CASCADE; - - --- --- Name: frob frob_header_id_fkey; Type: FK CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.frob - ADD CONSTRAINT frob_header_id_fkey FOREIGN KEY (header_id) REFERENCES public.headers(id) ON DELETE CASCADE; - - --- --- Name: frob frob_ilk_fkey; Type: FK CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.frob - ADD CONSTRAINT frob_ilk_fkey FOREIGN KEY (ilk) REFERENCES maker.ilks(id); - - --- --- Name: pit_file_debt_ceiling pit_file_debt_ceiling_header_id_fkey; Type: FK CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.pit_file_debt_ceiling - ADD CONSTRAINT pit_file_debt_ceiling_header_id_fkey FOREIGN KEY (header_id) REFERENCES public.headers(id) ON DELETE CASCADE; - - --- --- Name: pit_file_ilk pit_file_ilk_header_id_fkey; Type: FK CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.pit_file_ilk - ADD CONSTRAINT pit_file_ilk_header_id_fkey FOREIGN KEY (header_id) REFERENCES public.headers(id) ON DELETE CASCADE; - - --- --- Name: pit_file_ilk pit_file_ilk_ilk_fkey; Type: FK CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.pit_file_ilk - ADD CONSTRAINT pit_file_ilk_ilk_fkey FOREIGN KEY (ilk) REFERENCES maker.ilks(id); - - --- --- Name: pit_ilk_line pit_ilk_line_ilk_fkey; Type: FK CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.pit_ilk_line - ADD CONSTRAINT pit_ilk_line_ilk_fkey FOREIGN KEY (ilk) REFERENCES maker.ilks(id); - - --- --- Name: pit_ilk_spot pit_ilk_spot_ilk_fkey; Type: FK CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.pit_ilk_spot - ADD CONSTRAINT pit_ilk_spot_ilk_fkey FOREIGN KEY (ilk) REFERENCES maker.ilks(id); - - --- --- Name: price_feeds price_feeds_header_id_fkey; Type: FK CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.price_feeds - ADD CONSTRAINT price_feeds_header_id_fkey FOREIGN KEY (header_id) REFERENCES public.headers(id) ON DELETE CASCADE; - - --- --- Name: tend tend_header_id_fkey; Type: FK CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.tend - ADD CONSTRAINT tend_header_id_fkey FOREIGN KEY (header_id) REFERENCES public.headers(id) ON DELETE CASCADE; - - --- --- Name: vat_flux vat_flux_header_id_fkey; Type: FK CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.vat_flux - ADD CONSTRAINT vat_flux_header_id_fkey FOREIGN KEY (header_id) REFERENCES public.headers(id) ON DELETE CASCADE; - - --- --- Name: vat_flux vat_flux_ilk_fkey; Type: FK CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.vat_flux - ADD CONSTRAINT vat_flux_ilk_fkey FOREIGN KEY (ilk) REFERENCES maker.ilks(id); - - --- --- Name: vat_fold vat_fold_header_id_fkey; Type: FK CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.vat_fold - ADD CONSTRAINT vat_fold_header_id_fkey FOREIGN KEY (header_id) REFERENCES public.headers(id) ON DELETE CASCADE; - - --- --- Name: vat_fold vat_fold_ilk_fkey; Type: FK CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.vat_fold - ADD CONSTRAINT vat_fold_ilk_fkey FOREIGN KEY (ilk) REFERENCES maker.ilks(id); - - --- --- Name: vat_gem vat_gem_ilk_fkey; Type: FK CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.vat_gem - ADD CONSTRAINT vat_gem_ilk_fkey FOREIGN KEY (ilk) REFERENCES maker.ilks(id); - - --- --- Name: vat_grab vat_grab_header_id_fkey; Type: FK CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.vat_grab - ADD CONSTRAINT vat_grab_header_id_fkey FOREIGN KEY (header_id) REFERENCES public.headers(id) ON DELETE CASCADE; - - --- --- Name: vat_grab vat_grab_ilk_fkey; Type: FK CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.vat_grab - ADD CONSTRAINT vat_grab_ilk_fkey FOREIGN KEY (ilk) REFERENCES maker.ilks(id); - - --- --- Name: vat_heal vat_heal_header_id_fkey; Type: FK CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.vat_heal - ADD CONSTRAINT vat_heal_header_id_fkey FOREIGN KEY (header_id) REFERENCES public.headers(id) ON DELETE CASCADE; - - --- --- Name: vat_ilk_art vat_ilk_art_ilk_fkey; Type: FK CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.vat_ilk_art - ADD CONSTRAINT vat_ilk_art_ilk_fkey FOREIGN KEY (ilk) REFERENCES maker.ilks(id); - - --- --- Name: vat_ilk_ink vat_ilk_ink_ilk_fkey; Type: FK CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.vat_ilk_ink - ADD CONSTRAINT vat_ilk_ink_ilk_fkey FOREIGN KEY (ilk) REFERENCES maker.ilks(id); - - --- --- Name: vat_ilk_rate vat_ilk_rate_ilk_fkey; Type: FK CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.vat_ilk_rate - ADD CONSTRAINT vat_ilk_rate_ilk_fkey FOREIGN KEY (ilk) REFERENCES maker.ilks(id); - - --- --- Name: vat_ilk_take vat_ilk_take_ilk_fkey; Type: FK CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.vat_ilk_take - ADD CONSTRAINT vat_ilk_take_ilk_fkey FOREIGN KEY (ilk) REFERENCES maker.ilks(id); - - --- --- Name: vat_init vat_init_header_id_fkey; Type: FK CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.vat_init - ADD CONSTRAINT vat_init_header_id_fkey FOREIGN KEY (header_id) REFERENCES public.headers(id) ON DELETE CASCADE; - - --- --- Name: vat_init vat_init_ilk_fkey; Type: FK CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.vat_init - ADD CONSTRAINT vat_init_ilk_fkey FOREIGN KEY (ilk) REFERENCES maker.ilks(id); - - --- --- Name: vat_move vat_move_header_id_fkey; Type: FK CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.vat_move - ADD CONSTRAINT vat_move_header_id_fkey FOREIGN KEY (header_id) REFERENCES public.headers(id) ON DELETE CASCADE; - - --- --- Name: vat_slip vat_slip_header_id_fkey; Type: FK CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.vat_slip - ADD CONSTRAINT vat_slip_header_id_fkey FOREIGN KEY (header_id) REFERENCES public.headers(id) ON DELETE CASCADE; - - --- --- Name: vat_slip vat_slip_ilk_fkey; Type: FK CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.vat_slip - ADD CONSTRAINT vat_slip_ilk_fkey FOREIGN KEY (ilk) REFERENCES maker.ilks(id); - - --- --- Name: vat_toll vat_toll_header_id_fkey; Type: FK CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.vat_toll - ADD CONSTRAINT vat_toll_header_id_fkey FOREIGN KEY (header_id) REFERENCES public.headers(id) ON DELETE CASCADE; - - --- --- Name: vat_toll vat_toll_ilk_fkey; Type: FK CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.vat_toll - ADD CONSTRAINT vat_toll_ilk_fkey FOREIGN KEY (ilk) REFERENCES maker.ilks(id); - - --- --- Name: vat_tune vat_tune_header_id_fkey; Type: FK CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.vat_tune - ADD CONSTRAINT vat_tune_header_id_fkey FOREIGN KEY (header_id) REFERENCES public.headers(id) ON DELETE CASCADE; - - --- --- Name: vat_tune vat_tune_ilk_fkey; Type: FK CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.vat_tune - ADD CONSTRAINT vat_tune_ilk_fkey FOREIGN KEY (ilk) REFERENCES maker.ilks(id); - - --- --- Name: vat_urn_art vat_urn_art_ilk_fkey; Type: FK CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.vat_urn_art - ADD CONSTRAINT vat_urn_art_ilk_fkey FOREIGN KEY (ilk) REFERENCES maker.ilks(id); - - --- --- Name: vat_urn_ink vat_urn_ink_ilk_fkey; Type: FK CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.vat_urn_ink - ADD CONSTRAINT vat_urn_ink_ilk_fkey FOREIGN KEY (ilk) REFERENCES maker.ilks(id); - - --- --- Name: vow_flog vow_flog_header_id_fkey; Type: FK CONSTRAINT; Schema: maker; Owner: - --- - -ALTER TABLE ONLY maker.vow_flog - ADD CONSTRAINT vow_flog_header_id_fkey FOREIGN KEY (header_id) REFERENCES public.headers(id) ON DELETE CASCADE; - - -- -- Name: transactions blocks_fk; Type: FK CONSTRAINT; Schema: public; Owner: - -- @@ -4813,14 +724,6 @@ ALTER TABLE ONLY public.receipts ADD CONSTRAINT blocks_fk FOREIGN KEY (block_id) REFERENCES public.blocks(id) ON DELETE CASCADE; --- --- Name: token_supply blocks_fk; Type: FK CONSTRAINT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.token_supply - ADD CONSTRAINT blocks_fk FOREIGN KEY (block_id) REFERENCES public.blocks(id) ON DELETE CASCADE; - - -- -- Name: checked_headers checked_headers_header_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - -- diff --git a/environments/compose.toml b/environments/compose.toml index 48221933..b0c158c9 100644 --- a/environments/compose.toml +++ b/environments/compose.toml @@ -1,5 +1,5 @@ [database] - name = "vulcanize_public" + name = "vulcanize_infura" hostname = "localhost" user = "vulcanize" password = "vulcanize" @@ -28,7 +28,6 @@ "flap_kick", "flip_kick", "flop_kick", - "frob_kick", "frob", "pit_file_debt_ceiling", "pit_file_ilk", @@ -85,7 +84,7 @@ type = "eth_event" repository = "github.com/vulcanize/mcd_transformers" migrations = "db/migrations" - [exporter.drip_file_repo] + [exporter.drop_file_repo] path = "transformers/drip_file/repo/initializer" type = "eth_event" repository = "github.com/vulcanize/mcd_transformers" diff --git a/environments/composeStorage.toml b/environments/composeStorage.toml new file mode 100644 index 00000000..8db85977 --- /dev/null +++ b/environments/composeStorage.toml @@ -0,0 +1,45 @@ +[database] + name = "vulcanize_public" + hostname = "localhost" + user = "vulcanize" + password = "vulcanize" + port = 5432 + +[client] + ipcPath = "http://kovan0.vulcanize.io:8545" + +[datadog] + name = "maker_vdb_staging" + +[exporter] + name = "storageTransformerExporter" + save = false + transformerNames = [ + "pit", + "vat", + "vow" + ] + [exporter.pit] + path = "transformers/storage_diffs/maker/pit/initializer" + type = "eth_storage" + repository = "github.com/vulcanize/mcd_transformers" + migrations = "db/migrations" + [exporter.vat] + path = "transformers/storage_diffs/maker/vat/initializer" + type = "eth_storage" + repository = "github.com/vulcanize/mcd_transformers" + migrations = "db/migrations" + [exporter.vow] + path = "transformers/storage_diffs/maker/vow/initializer" + type = "eth_storage" + repository = "github.com/vulcanize/mcd_transformers" + migrations = "db/migrations" + +[filesystem] + storageDiffsPath = "INSERT-PATH-TO-STORAGE-DIFFS" + +[contract] + [contract.address] + pit = "0xe7cf3198787c9a4daac73371a38f29aaeeced87e" + vat = "0xcd726790550afcd77e9a7a47e86a3f9010af126b" + vow = "0x3728e9777B2a0a611ee0F89e00E01044ce4736d1" diff --git a/libraries/shared/storage/mappings.go b/libraries/shared/storage/mappings.go index fb52edd9..986469d5 100644 --- a/libraries/shared/storage/mappings.go +++ b/libraries/shared/storage/mappings.go @@ -22,8 +22,8 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/crypto" - "github.com/vulcanize/vulcanizedb/libraries/shared/storage/utils" "github.com/vulcanize/vulcanizedb/pkg/datastore/postgres" + "github.com/vulcanize/vulcanizedb/libraries/shared/storage/utils" ) type Mappings interface { @@ -32,14 +32,18 @@ type Mappings interface { } const ( - IndexZero = "0000000000000000000000000000000000000000000000000000000000000000" - IndexOne = "0000000000000000000000000000000000000000000000000000000000000001" - IndexTwo = "0000000000000000000000000000000000000000000000000000000000000002" - IndexThree = "0000000000000000000000000000000000000000000000000000000000000003" - IndexFour = "0000000000000000000000000000000000000000000000000000000000000004" - IndexFive = "0000000000000000000000000000000000000000000000000000000000000005" - IndexSix = "0000000000000000000000000000000000000000000000000000000000000006" - IndexSeven = "0000000000000000000000000000000000000000000000000000000000000007" + IndexZero = "0000000000000000000000000000000000000000000000000000000000000000" + IndexOne = "0000000000000000000000000000000000000000000000000000000000000001" + IndexTwo = "0000000000000000000000000000000000000000000000000000000000000002" + IndexThree = "0000000000000000000000000000000000000000000000000000000000000003" + IndexFour = "0000000000000000000000000000000000000000000000000000000000000004" + IndexFive = "0000000000000000000000000000000000000000000000000000000000000005" + IndexSix = "0000000000000000000000000000000000000000000000000000000000000006" + IndexSeven = "0000000000000000000000000000000000000000000000000000000000000007" + IndexEight = "0000000000000000000000000000000000000000000000000000000000000008" + IndexNine = "0000000000000000000000000000000000000000000000000000000000000009" + IndexTen = "0000000000000000000000000000000000000000000000000000000000000010" + IndexEleven = "0000000000000000000000000000000000000000000000000000000000000011 " ) func GetMapping(indexOnContract, key string) common.Hash { @@ -58,4 +62,4 @@ func GetIncrementedKey(original common.Hash, incrementBy int64) common.Hash { originalMappingAsInt := original.Big() incremented := big.NewInt(0).Add(originalMappingAsInt, big.NewInt(incrementBy)) return common.BytesToHash(incremented.Bytes()) -} +} \ No newline at end of file diff --git a/pkg/config/plugin.go b/pkg/config/plugin.go index 1b44be61..a530748e 100644 --- a/pkg/config/plugin.go +++ b/pkg/config/plugin.go @@ -87,6 +87,7 @@ const ( func (pt TransformerType) String() string { names := [...]string{ + "Unknown", "eth_event", "eth_storage", } @@ -105,7 +106,7 @@ func GetTransformerType(str string) TransformerType { } for _, ty := range types { - if ty.String() == str && ty.String() != "Unknown" { + if ty.String() == str { return ty } } diff --git a/pkg/plugin/generator_test.go b/pkg/plugin/generator_test.go index 7bb7e74b..5dc11306 100644 --- a/pkg/plugin/generator_test.go +++ b/pkg/plugin/generator_test.go @@ -78,18 +78,6 @@ var storageConfig = config.Plugin{ var combinedConfig = config.Plugin{ Transformers: map[string]config.Transformer{ - "pit": { - Path: "transformers/storage_diffs/maker/pit/initializer", - Type: config.EthStorage, - MigrationPath: "db/migrations", - RepositoryPath: "github.com/vulcanize/mcd_transformers", - }, - "vat": { - Path: "transformers/storage_diffs/maker/vat/initializer", - Type: config.EthStorage, - MigrationPath: "db/migrations", - RepositoryPath: "github.com/vulcanize/mcd_transformers", - }, "bite": { Path: "transformers/bite/initializer", Type: config.EthEvent, @@ -102,6 +90,18 @@ var combinedConfig = config.Plugin{ MigrationPath: "db/migrations", RepositoryPath: "github.com/vulcanize/mcd_transformers", }, + "pit": { + Path: "transformers/storage_diffs/maker/pit/initializer", + Type: config.EthStorage, + MigrationPath: "db/migrations", + RepositoryPath: "github.com/vulcanize/mcd_transformers", + }, + "vat": { + Path: "transformers/storage_diffs/maker/vat/initializer", + Type: config.EthStorage, + MigrationPath: "db/migrations", + RepositoryPath: "github.com/vulcanize/mcd_transformers", + }, }, FileName: "testComboTransformerSet", FilePath: "$GOPATH/src/github.com/vulcanize/vulcanizedb/pkg/plugin/test_helpers/test", @@ -128,6 +128,9 @@ var _ = Describe("Generator test", func() { var headerID int64 viper.SetConfigName("compose") viper.AddConfigPath("$GOPATH/src/github.com/vulcanize/vulcanizedb/environments/") + AfterSuite(func() { + test_helpers.DropTestSchema(db) + }) Describe("Event Transformers only", func() { BeforeEach(func() { @@ -226,6 +229,7 @@ var _ = Describe("Generator test", func() { Expect(err).ToNot(HaveOccurred()) }) Describe("GenerateTransformerPlugin", func() { + It("It bundles the specified StorageTransformerInitializers into a Exporter object and creates .so", func() { plug, err := plugin.Open(soPath) Expect(err).ToNot(HaveOccurred()) @@ -275,6 +279,7 @@ var _ = Describe("Generator test", func() { Expect(err).ToNot(HaveOccurred()) }) Describe("GenerateTransformerPlugin", func() { + It("It bundles the specified TransformerInitializers and StorageTransformerInitializers into a Exporter object and creates .so", func() { plug, err := plugin.Open(soPath) Expect(err).ToNot(HaveOccurred()) diff --git a/pkg/plugin/manager/manager.go b/pkg/plugin/manager/manager.go index ad9cfdf5..217faf83 100644 --- a/pkg/plugin/manager/manager.go +++ b/pkg/plugin/manager/manager.go @@ -66,9 +66,16 @@ func (m *manager) RunMigrations() error { if err != nil { return err } + // Fix the migrations + cmd := exec.Command("goose", "fix") + cmd.Dir = m.tmpMigDir + err = cmd.Run() + if err != nil { + return errors.New(fmt.Sprintf("version fixing for plugin migrations failed: %s", err.Error())) + } // Run the copied migrations with goose pgStr := fmt.Sprintf("postgres://%s:%d/%s?sslmode=disable", m.DBConfig.Hostname, m.DBConfig.Port, m.DBConfig.Name) - cmd := exec.Command("goose", "postgres", pgStr, "up") + cmd = exec.Command("goose", "postgres", pgStr, "up") cmd.Dir = m.tmpMigDir err = cmd.Run() if err != nil { diff --git a/pkg/plugin/test_helpers/database.go b/pkg/plugin/test_helpers/database.go index 0ec05f8e..c4cf9653 100644 --- a/pkg/plugin/test_helpers/database.go +++ b/pkg/plugin/test_helpers/database.go @@ -73,9 +73,11 @@ func TearDown(db *postgres.DB) { _, err = tx.Exec(`DELETE FROM checked_headers`) Expect(err).NotTo(HaveOccurred()) - _, err = tx.Exec(`DELETE FROM maker.bite`) - Expect(err).NotTo(HaveOccurred()) - err = tx.Commit() Expect(err).NotTo(HaveOccurred()) } + +func DropTestSchema(db *postgres.DB) { + _, err := db.Exec(`DROP SCHEMA IF EXISTS maker CASCADE`) + Expect(err).NotTo(HaveOccurred()) +} diff --git a/pkg/transformers/factories/storage/EXAMPLE.md b/pkg/transformers/factories/storage/EXAMPLE.md deleted file mode 100644 index 288b61f4..00000000 --- a/pkg/transformers/factories/storage/EXAMPLE.md +++ /dev/null @@ -1,167 +0,0 @@ -# Storage Transformer Example - -In the Storage Transformer README, we went over code that needs to be written to add a new storage transformer to VulcanizeDB. -In this document, we'll go over an example contract and discuss how one would go about watching its storage. - -## Example Contract - -For the purposes of this document, we'll be assuming that we're interested in watching the following contract: - -```solidity -pragma solidity ^0.5.1; - -contract Contract { - uint256 public num_addresses; - mapping(address => uint) public addresses; - - event AddressAdded( - address addr, - uint256 num_addrs - ); - - constructor() public { - addresses[msg.sender] = 1; - num_addresses = 1; - } - - function add_address(address addr) public { - bool exists = addresses[addr] > 0; - addresses[addr] = addresses[addr] + 1; - if (!exists) { - emit AddressAdded(addr, ++num_addresses); - } - } -} -``` - -Disclaimer: this contract has not been audited and is not intended to be modeled or used in production. :) - -This contract persists two values in it's storage: - -1. `num_addresses`: the total number of unique addresses known to the contract. -2. `addresses`: a mapping that records the number of times an address has been added to the contract. - -It also emits an event each time a new address is added into the contract's storage. - -## Custom Code - -In order to monitor the state of this smart contract, we'd need to implement: an event transformer, a mappings namespace, and a repository. -We will go through each of these in turn. - -### Event Transformer - -Given that the contract's storage includes a mapping, `addresses`, we will need to be able to identify the keys to that mapping that exist in the system so that we can recognize contract storage keys that correspond to non-zero values in that mapping. - -The simplest way to be aware of keys used in a contract's mapping is to listen for contract events that emit the keys that are used in its mapping(s). -Since this contract includes an event, `AddressAdded`, that is emitted each time a new address is added to the `addresses` mapping, we will want to listen for those events and cache the adddresses that map to non-zero values. - -Please see the event transformer README for detailed instructions about developing this code. -In short, it should be feasible to recognize `AddressAdded` events on the blockchain and parse them to keep a record of addresses that have been added to the system. - -### Mappings - -If we point an ethereum node at a blockchain hosting this contract and our node is equipped to write out storage changes happening on this contract, we will expect such changes to appear each time `add_address` (which modifies the `addresses` mapping) is called. - -In order for those changes - which include raw hex versions of storage keys and storage values, to be useful for us - we need to know how to recognize and parse them. -Our mappings file should assist us with both of these tasks: the `Lookup` function should recognize raw storage keys and return known metadata about the storage value. - -In order to perform this lookup, the mappings file should maintain its own mapping of known storage keys to the corresponding storage value metadata. -This internal mapping should contain the storage key for `num_addresses` as well as a storage key for each `addresses` key known to be associated with a non-zero value. - -#### num_addresses - -`num_addresses` is the first variable declared on the contract, and it is a simple (non-array, non-mapping) type. -Therefore, we know that its storage key is `0000000000000000000000000000000000000000000000000000000000000000`. -The storage key for non-array and non-mapping variables is (usually*) the index of the variable on the contract's storage. -If we see a storage diff being emitted from this contract with this storage key, we know that the `num_addresses` variable has been modified. - -In this case, we would expect that the call `mappings.Lookup("0000000000000000000000000000000000000000000000000000000000000000")` would return metadata corresponding to the `num_addresses` variable. -This metadata would probably look something like: - -```golang -shared.StorageValueMetadata{ - Name: "num_addresses", - Keys: nil, - Type: shared.Uint256, -} -``` - -* Occasionally, multiple variables may be packed into one storage slot, which complicates a direct translation of the index of the variable on the contract to its storage key. - -#### addresses - -`addresses` is the second variable declared on the contract, but it is a mapping. -Since it is a mapping, the storage key is more complex than `0000000000000000000000000000000000000000000000000000000000000001` (which would be the key for the variable if it were not an array or mapping). -Having a single storage slot for an entire mapping would not work, since there can be an arbitrary number of entries in a mapping, and a single storage value slot is constrained to 32 bytes. - -The way that smart contract mappings are maintained in storage (in Solidity) is by creating a new storage key/value pair for each entry in the mapping, where the storage key is a hash of the occupied slot's key concatenated with the mapping's index on the contract. -Given an occupied slot's key, `k`, and a mapping's index on the contract, `i`, we can generate the storage key with the following code: - -```golang -func GetMappingStorageKey(k, i string) string { - return common.BytesToHash(crypto.Keccak256(common.FromHex(k + i))).Hex() -} -``` - -If we were to call the contract's `add_address` function with `0xde0B295669a9FD93d5F28D9Ec85E40f4cb697BAe`, we would expect to see an `AddressAdded` event emitted, with `0xde0B295669a9FD93d5F28D9Ec85E40f4cb697BAe` in its payload. -From that event, we would know that there exists in the contract's storage a storage key of: - -```golang -GetMappingStorageKey("0xde0B295669a9FD93d5F28D9Ec85E40f4cb697BAe", "0000000000000000000000000000000000000000000000000000000000000001") -``` - -Executing the above code results in: `0x0f96a1133cfd5b94c329aa0526b5962bd791dbbfc481ca82f7d4a439e1e9bc40`. - -Therefore, the first time `add_address` was called for this address, we would also expect to see a storage diff with a key of `0x0f96a1133cfd5b94c329aa0526b5962bd791dbbfc481ca82f7d4a439e1e9bc40` and a value of `0000000000000000000000000000000000000000000000000000000000000001`. -This would be the indication that in contract storage, the address `0xde0B295669a9FD93d5F28D9Ec85E40f4cb697BAe` maps to the value 1. - -Given that we knew this address was a key in the mapping from our event transformer, we would expect a call to `mappings.Lookup("0x0f96a1133cfd5b94c329aa0526b5962bd791dbbfc481ca82f7d4a439e1e9bc40")` to return metadata corresponding to _this slot_ in the addresses mapping: - -```golang -shared.StorageValueMetadata{ - Name: "addresses, - Keys: map[Key]string{Address: "0xde0B295669a9FD93d5F28D9Ec85E40f4cb697BAe"}, - Type: shared.Uint256, -} -``` - -### Repository - -Once we have recognized a storage diff, we can decode the storage value to the data's known type. -Since the metadata tells us that the above values are `uint256`, we can decode a value like `0000000000000000000000000000000000000000000000000000000000000001` to `1`. - -The purpose of the contract-specific repository is to write that value to the database in a way that makes it useful for future queries. -Typically, the involves writing the block hash, block number, decoded value, and any keys in the metadata to a table. - -The current repository interface has a generalized `Create` function that can accept any arbitrary storage row along with it's metadata. -This is deliberate, to facilitate shared use of the common storage transformer. -An implication of this decision is that the `Create` function typically includes a `switch` statement that selects which table to write to, as well as what data to include, based on the name of the variable as defined in the metadata. - -An example implementation of `Create` for our example contract above might look like: - -```golang -func (repository AddressStorageRepository) Create(blockNumber int, blockHash string, metadata shared.StorageValueMetadata, value interface{}) error { - switch metadata.Name { - case "num_addresses": - _, err := repository.db.Exec(`INSERT INTO storage.num_addresses (block_hash, block_number, n) VALUES ($1, $2, $3)`, - blockHash, blockNumber, value) - return err - case "addresses": - _, err := repository.db.Exec(`INSERT INTO storage.addresses (block_hash, block_number, address, n) VALUES ($1, $2, $3, $4)`, - blockHash, blockNumber, metadata.Keys[Address], value) - return err - default: - panic(fmt.Sprintf("unrecognized contract storage name: %s", metadata.Name)) - } -} -``` - -## Summary - -With our very simple address storing contract, we would be able to read it's storage diffs by implementing an event transformer, a mappings, and a repository. - -The mappings would be able to lookup storage keys reflecting `num_addresses` or any slot in `addresses`, using addresses derived from watching the `AddressAdded` event for the latter. - -The repository would be able to persist the value or `num_addresses` or any slot in `addresses`, using metadata returned from the mappings. - -The mappings and repository could be plugged into the common storage transformer, enabling us to know the contract's state as it is changing. \ No newline at end of file diff --git a/pkg/transformers/factories/storage/README.md b/pkg/transformers/factories/storage/README.md deleted file mode 100644 index 1196001b..00000000 --- a/pkg/transformers/factories/storage/README.md +++ /dev/null @@ -1,124 +0,0 @@ -# Watching Contract Storage - -One approach VulcanizeDB takes to caching and indexing smart contracts is to ingest raw contract storage values. -Assuming that you are running an ethereum node that is writing contract storage changes to a CSV file, VulcanizeDB can parse them and persist the results to postgres. - -## Assumptions - -The current approach for caching smart contract storage diffs assumes that you are running a node that is writing contract storage diffs to a CSV file. -The CSV file is expected to have 5 columns: contract address, block hash, block number, storage key, storage value. - -We have [a branch on vulcanize/parity-ethereum](https://github.com/vulcanize/parity-ethereum/tree/watch-storage-diffs) that enables running a node that writes storage diffs this way. -We also have [sample data](https://github.com/8thlight/maker-vulcanizedb/pull/132/files) that comes from running that node against Kovan through block 9796184. - -Looking forward, we would like to isolate this assumption as much as possible. -We may end up needing to read CSV data that is formatted differently, or reading data from a non-CSV source, and we do not want resulting changes to cascade throughout the codebase. - -## Shared Code - -VulcanizeDB has shared code for continuously reading from the CSV file written by the ethereum node and writing a parsed version of each row to postgres. - -### Storage Watcher - -The storage watcher is responsible for continuously delegating CSV rows to the appropriate transformer as they are being written by the ethereum node. -It maintains a mapping of contract addresses to transformers, and will ignore storage diff rows for contract addresses that do not have a corresponding transformer. - -The storage watcher is currently initialized from the `parseStorageDiffs` command, which also adds transformers that the watcher should know about in its mapping of addresses to transformers. - -### Storage Transformer - -The storage transformer is responsible for converting raw contract storage hex values into useful data and writing them to postgres. -The storage transformer depends on contract-specific implementations of code capable of recognizing storage keys and writing the matching (decoded) storage value to disk. - -```golang -func (transformer Transformer) Execute(row shared.StorageDiffRow) error { - metadata, lookupErr := transformer.Mappings.Lookup(row.StorageKey) - if lookupErr != nil { - return lookupErr - } - value, decodeErr := shared.Decode(row, metadata) - if decodeErr != nil { - return decodeErr - } - return transformer.Repository.Create(row.BlockHeight, row.BlockHash.Hex(), metadata, value) -} -``` - -## Custom Code - -In order to watch an additional smart contract, a developer must create three things: - -1. Mappings - specify how to identify keys in the contract's storage trie. -1. Repository - specify how to persist a parsed version of the storage value matching the recognized storage key. -1. Instance - create an instance of the storage transformer that uses your mappings and repository. - -### Mappings - -```golang -type Mappings interface { - Lookup(key common.Hash) (shared.StorageValueMetadata, error) - SetDB(db *postgres.DB) -} -``` - -A contract-specific implementation of the mappings interface enables the storage transformer to fetch metadata associated with a storage key. - -Storage metadata contains: the name of the variable matching the storage key, a raw version of any keys associated with the variable (if the variable is a mapping), and the variable's type. - -```golang -type StorageValueMetadata struct { - Name string - Keys map[Key]string - Type ValueType -} -``` - -Keys are only relevant if the variable is a mapping. For example, in the following Solidity code: - -```solidity -pragma solidity ^0.4.0; - -contract Contract { - uint x; - mapping(address => uint) y; -} -``` - -The metadata for variable `x` would not have any associated keys, but the metadata for a storage key associated with `y` would include the address used to specify that key's index in the mapping. - -The `SetDB` function is required for the mappings to connect to the database. -A database connection may be desired when keys in a mapping variable need to be read from log events (e.g. to lookup what addresses may exist in `y`, above). - -### Repository - -```golang -type Repository interface { - Create(blockNumber int, blockHash string, metadata shared.StorageValueMetadata, value interface{}) error - SetDB(db *postgres.DB) -} -``` - -A contract-specific implementation of the repository interface enables the transformer to write the decoded storage value to the appropriate table in postgres. - -The `Create` function is expected to recognize and persist a given storage value by the variable's name, as indicated on the row's metadata. - -The `SetDB` function is required for the repository to connect to the database. - -### Instance - -```golang -type Transformer struct { - Address common.Address - Mappings storage_diffs.Mappings - Repository storage_diffs.Repository -} -``` - -A new instance of the storage transformer is initialized with the contract-specific mappings and repository, as well as the contract's address. -The contract's address is included so that the watcher can query that value from the transformer in order to build up its mapping of addresses to transformers. - -## Summary - -To begin watching an additional smart contract, create a new mappings file for looking up storage keys on that contract, a repository for writing storage values from the contract, and initialize a new storage transformer instance with the mappings, repository, and contract address. - -The new instance, wrapped in an initializer that calls `SetDB` on the mappings and repository, should be passed to the `AddTransformers` function on the storage watcher. \ No newline at end of file diff --git a/pkg/transformers/flop_kick/flop_kick_suite_test.go b/pkg/transformers/flop_kick/flop_kick_suite_test.go deleted file mode 100644 index e54ed14b..00000000 --- a/pkg/transformers/flop_kick/flop_kick_suite_test.go +++ /dev/null @@ -1,19 +0,0 @@ -package flop_kick_test - -import ( - "github.com/sirupsen/logrus" - "io/ioutil" - "testing" - - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" -) - -func TestFlopKick(t *testing.T) { - RegisterFailHandler(Fail) - RunSpecs(t, "FlopKick Suite") -} - -var _ = BeforeSuite(func() { - logrus.SetOutput(ioutil.Discard) -}) diff --git a/pkg/transformers/shared/shared_suite_test.go b/pkg/transformers/shared/shared_suite_test.go deleted file mode 100644 index ff768f49..00000000 --- a/pkg/transformers/shared/shared_suite_test.go +++ /dev/null @@ -1,19 +0,0 @@ -package shared_test - -import ( - "github.com/sirupsen/logrus" - "io/ioutil" - "testing" - - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" -) - -func TestShared(t *testing.T) { - RegisterFailHandler(Fail) - RunSpecs(t, "Shared Suite") -} - -var _ = BeforeSuite(func() { - logrus.SetOutput(ioutil.Discard) -}) diff --git a/pkg/transformers/storage_diffs/maker/maker_suite_test.go b/pkg/transformers/storage_diffs/maker/maker_suite_test.go deleted file mode 100644 index e0a3151c..00000000 --- a/pkg/transformers/storage_diffs/maker/maker_suite_test.go +++ /dev/null @@ -1,35 +0,0 @@ -// VulcanizeDB -// Copyright © 2018 Vulcanize - -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. - -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - -package maker_test - -import ( - "github.com/sirupsen/logrus" - "io/ioutil" - "testing" - - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" -) - -func TestMaker(t *testing.T) { - RegisterFailHandler(Fail) - RunSpecs(t, "Maker Suite") -} - -var _ = BeforeSuite(func() { - logrus.SetOutput(ioutil.Discard) -}) diff --git a/pkg/transformers/storage_diffs/maker/pit/pit_suite_test.go b/pkg/transformers/storage_diffs/maker/pit/pit_suite_test.go deleted file mode 100644 index 7a8fc165..00000000 --- a/pkg/transformers/storage_diffs/maker/pit/pit_suite_test.go +++ /dev/null @@ -1,19 +0,0 @@ -package pit_test - -import ( - "github.com/sirupsen/logrus" - "io/ioutil" - "testing" - - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" -) - -func TestPit(t *testing.T) { - RegisterFailHandler(Fail) - RunSpecs(t, "Pit Suite") -} - -var _ = BeforeSuite(func() { - logrus.SetOutput(ioutil.Discard) -}) diff --git a/pkg/transformers/storage_diffs/maker/vat/vat_suite_test.go b/pkg/transformers/storage_diffs/maker/vat/vat_suite_test.go deleted file mode 100644 index d385774e..00000000 --- a/pkg/transformers/storage_diffs/maker/vat/vat_suite_test.go +++ /dev/null @@ -1,19 +0,0 @@ -package vat_test - -import ( - "github.com/sirupsen/logrus" - "io/ioutil" - "testing" - - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" -) - -func TestVat(t *testing.T) { - RegisterFailHandler(Fail) - RunSpecs(t, "Vat Suite") -} - -var _ = BeforeSuite(func() { - logrus.SetOutput(ioutil.Discard) -}) diff --git a/pkg/transformers/storage_diffs/maker/vow/mappings.go b/pkg/transformers/storage_diffs/maker/vow/mappings.go deleted file mode 100644 index 8f9a7d26..00000000 --- a/pkg/transformers/storage_diffs/maker/vow/mappings.go +++ /dev/null @@ -1,152 +0,0 @@ -/* - * Copyright 2018 Vulcanize - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package vow - -import ( - "github.com/ethereum/go-ethereum/common" - "github.com/vulcanize/vulcanizedb/pkg/datastore/postgres" - "github.com/vulcanize/vulcanizedb/pkg/transformers/storage_diffs" - "github.com/vulcanize/vulcanizedb/pkg/transformers/storage_diffs/maker" - "github.com/vulcanize/vulcanizedb/pkg/transformers/storage_diffs/shared" -) - -const ( - VowVat = "vat" - VowCow = "cow" - VowRow = "row" - VowSin = "Sin" - VowWoe = "Woe" - VowAsh = "Ash" - VowWait = "wait" - VowSump = "sump" - VowBump = "bump" - VowHump = "hump" -) - -var ( - VatKey = common.HexToHash(storage_diffs.IndexOne) - VatMetadata = shared.StorageValueMetadata{ - Name: VowVat, - Keys: nil, - Type: shared.Address, - } - - CowKey = common.HexToHash(storage_diffs.IndexTwo) - CowMetadata = shared.StorageValueMetadata{ - Name: VowCow, - Keys: nil, - Type: shared.Address, - } - - RowKey = common.HexToHash(storage_diffs.IndexThree) - RowMetadata = shared.StorageValueMetadata{ - Name: VowRow, - Keys: nil, - Type: shared.Address, - } - - SinKey = common.HexToHash(storage_diffs.IndexFive) - SinMetadata = shared.StorageValueMetadata{ - Name: VowSin, - Keys: nil, - Type: shared.Uint256, - } - - WoeKey = common.HexToHash(storage_diffs.IndexSix) - WoeMetadata = shared.StorageValueMetadata{ - Name: VowWoe, - Keys: nil, - Type: shared.Uint256, - } - - AshKey = common.HexToHash(storage_diffs.IndexSeven) - AshMetadata = shared.StorageValueMetadata{ - Name: VowAsh, - Keys: nil, - Type: shared.Uint256, - } - - WaitKey = common.HexToHash(storage_diffs.IndexEight) - WaitMetadata = shared.StorageValueMetadata{ - Name: VowWait, - Keys: nil, - Type: shared.Uint256, - } - - SumpKey = common.HexToHash(storage_diffs.IndexNine) - SumpMetadata = shared.StorageValueMetadata{ - Name: VowSump, - Keys: nil, - Type: shared.Uint256, - } - - BumpKey = common.HexToHash(storage_diffs.IndexTen) - BumpMetadata = shared.StorageValueMetadata{ - Name: VowBump, - Keys: nil, - Type: shared.Uint256, - } - - HumpKey = common.HexToHash(storage_diffs.IndexEleven) - HumpMetadata = shared.StorageValueMetadata{ - Name: VowHump, - Keys: nil, - Type: shared.Uint256, - } -) - -type VowMappings struct { - StorageRepository maker.IMakerStorageRepository - mappings map[common.Hash]shared.StorageValueMetadata -} - -func (mappings *VowMappings) Lookup(key common.Hash) (shared.StorageValueMetadata, error) { - metadata, ok := mappings.mappings[key] - if !ok { - err := mappings.loadMappings() - if err != nil { - return metadata, err - } - metadata, ok = mappings.mappings[key] - if !ok { - return metadata, shared.ErrStorageKeyNotFound{Key: key.Hex()} - } - } - return metadata, nil -} - -func (mappings *VowMappings) loadMappings() error { - staticMappings := make(map[common.Hash]shared.StorageValueMetadata) - staticMappings[VatKey] = VatMetadata - staticMappings[CowKey] = CowMetadata - staticMappings[RowKey] = RowMetadata - staticMappings[SinKey] = SinMetadata - staticMappings[WoeKey] = WoeMetadata - staticMappings[AshKey] = AshMetadata - staticMappings[WaitKey] = WaitMetadata - staticMappings[SumpKey] = SumpMetadata - staticMappings[BumpKey] = BumpMetadata - staticMappings[HumpKey] = HumpMetadata - - mappings.mappings = staticMappings - - return nil -} - -func (mappings *VowMappings) SetDB(db *postgres.DB) { - mappings.StorageRepository.SetDB(db) -} diff --git a/pkg/transformers/storage_diffs/maker/vow/mappings_test.go b/pkg/transformers/storage_diffs/maker/vow/mappings_test.go deleted file mode 100644 index 44c7970f..00000000 --- a/pkg/transformers/storage_diffs/maker/vow/mappings_test.go +++ /dev/null @@ -1,42 +0,0 @@ -package vow_test - -import ( - "github.com/ethereum/go-ethereum/common" - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - "github.com/vulcanize/vulcanizedb/pkg/fakes" - "github.com/vulcanize/vulcanizedb/pkg/transformers/storage_diffs/maker/test_helpers" - "github.com/vulcanize/vulcanizedb/pkg/transformers/storage_diffs/maker/vow" - "github.com/vulcanize/vulcanizedb/pkg/transformers/storage_diffs/shared" -) - -var _ = Describe("Vow storage mappings", func() { - Describe("looking up static keys", func() { - It("returns value metadata if key exists", func() { - storageRepository := &test_helpers.MockMakerStorageRepository{} - - mappings := vow.VowMappings{StorageRepository: storageRepository} - - Expect(mappings.Lookup(vow.VatKey)).To(Equal(vow.VatMetadata)) - Expect(mappings.Lookup(vow.CowKey)).To(Equal(vow.CowMetadata)) - Expect(mappings.Lookup(vow.RowKey)).To(Equal(vow.RowMetadata)) - Expect(mappings.Lookup(vow.SinKey)).To(Equal(vow.SinMetadata)) - Expect(mappings.Lookup(vow.WoeKey)).To(Equal(vow.WoeMetadata)) - Expect(mappings.Lookup(vow.AshKey)).To(Equal(vow.AshMetadata)) - Expect(mappings.Lookup(vow.WaitKey)).To(Equal(vow.WaitMetadata)) - Expect(mappings.Lookup(vow.SumpKey)).To(Equal(vow.SumpMetadata)) - Expect(mappings.Lookup(vow.BumpKey)).To(Equal(vow.BumpMetadata)) - Expect(mappings.Lookup(vow.HumpKey)).To(Equal(vow.HumpMetadata)) - }) - - It("returns error if key does not exist", func() { - storageRepository := &test_helpers.MockMakerStorageRepository{} - - mappings := vow.VowMappings{StorageRepository: storageRepository} - _, err := mappings.Lookup(common.HexToHash(fakes.FakeHash.Hex())) - - Expect(err).To(HaveOccurred()) - Expect(err).To(MatchError(shared.ErrStorageKeyNotFound{Key: fakes.FakeHash.Hex()})) - }) - }) -}) diff --git a/pkg/transformers/storage_diffs/maker/vow/repository.go b/pkg/transformers/storage_diffs/maker/vow/repository.go deleted file mode 100644 index 0a655d9a..00000000 --- a/pkg/transformers/storage_diffs/maker/vow/repository.go +++ /dev/null @@ -1,117 +0,0 @@ -/* - * Copyright 2018 Vulcanize - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package vow - -import ( - "github.com/vulcanize/vulcanizedb/pkg/datastore/postgres" - "github.com/vulcanize/vulcanizedb/pkg/transformers/storage_diffs/shared" -) - -type VowStorageRepository struct { - db *postgres.DB -} - -func (repository *VowStorageRepository) SetDB(db *postgres.DB) { - repository.db = db -} - -func (repository VowStorageRepository) Create(blockNumber int, blockHash string, metadata shared.StorageValueMetadata, value interface{}) error { - switch metadata.Name { - case VowVat: - return repository.insertVowVat(blockNumber, blockHash, value.(string)) - case VowCow: - return repository.insertVowCow(blockNumber, blockHash, value.(string)) - case VowRow: - return repository.insertVowRow(blockNumber, blockHash, value.(string)) - case VowSin: - return repository.insertVowSin(blockNumber, blockHash, value.(string)) - case VowWoe: - return repository.insertVowWoe(blockNumber, blockHash, value.(string)) - case VowAsh: - return repository.insertVowAsh(blockNumber, blockHash, value.(string)) - case VowWait: - return repository.insertVowWait(blockNumber, blockHash, value.(string)) - case VowSump: - return repository.insertVowSump(blockNumber, blockHash, value.(string)) - case VowBump: - return repository.insertVowBump(blockNumber, blockHash, value.(string)) - case VowHump: - return repository.insertVowHump(blockNumber, blockHash, value.(string)) - default: - panic("unrecognized storage metadata name") - } -} - -func (repository VowStorageRepository) insertVowVat(blockNumber int, blockHash string, vat string) error { - _, err := repository.db.Exec(`INSERT INTO maker.vow_vat (block_number, block_hash, vat) VALUES ($1, $2, $3)`, blockNumber, blockHash, vat) - - return err -} - -func (repository VowStorageRepository) insertVowCow(blockNumber int, blockHash string, cow string) error { - _, err := repository.db.Exec(`INSERT INTO maker.vow_cow (block_number, block_hash, cow) VALUES ($1, $2, $3)`, blockNumber, blockHash, cow) - - return err -} - -func (repository VowStorageRepository) insertVowRow(blockNumber int, blockHash string, row string) error { - _, err := repository.db.Exec(`INSERT INTO maker.vow_row (block_number, block_hash, row) VALUES ($1, $2, $3)`, blockNumber, blockHash, row) - - return err -} - -func (repository VowStorageRepository) insertVowSin(blockNumber int, blockHash string, sin string) error { - _, err := repository.db.Exec(`INSERT INTO maker.vow_sin (block_number, block_hash, sin) VALUES ($1, $2, $3)`, blockNumber, blockHash, sin) - - return err -} - -func (repository VowStorageRepository) insertVowWoe(blockNumber int, blockHash string, woe string) error { - _, err := repository.db.Exec(`INSERT INTO maker.vow_woe (block_number, block_hash, woe) VALUES ($1, $2, $3)`, blockNumber, blockHash, woe) - - return err -} - -func (repository VowStorageRepository) insertVowAsh(blockNumber int, blockHash string, ash string) error { - _, err := repository.db.Exec(`INSERT INTO maker.vow_ash (block_number, block_hash, ash) VALUES ($1, $2, $3)`, blockNumber, blockHash, ash) - - return err -} - -func (repository VowStorageRepository) insertVowWait(blockNumber int, blockHash string, wait string) error { - _, err := repository.db.Exec(`INSERT INTO maker.vow_wait (block_number, block_hash, wait) VALUES ($1, $2, $3)`, blockNumber, blockHash, wait) - - return err -} - -func (repository VowStorageRepository) insertVowSump(blockNumber int, blockHash string, sump string) error { - _, err := repository.db.Exec(`INSERT INTO maker.vow_sump (block_number, block_hash, sump) VALUES ($1, $2, $3)`, blockNumber, blockHash, sump) - - return err -} - -func (repository VowStorageRepository) insertVowBump(blockNumber int, blockHash string, bump string) error { - _, err := repository.db.Exec(`INSERT INTO maker.vow_bump (block_number, block_hash, bump) VALUES ($1, $2, $3)`, blockNumber, blockHash, bump) - - return err -} - -func (repository VowStorageRepository) insertVowHump(blockNumber int, blockHash string, hump string) error { - _, err := repository.db.Exec(`INSERT INTO maker.vow_hump (block_number, block_hash, hump) VALUES ($1, $2, $3)`, blockNumber, blockHash, hump) - - return err -} diff --git a/pkg/transformers/storage_diffs/maker/vow/vow_suite_test.go b/pkg/transformers/storage_diffs/maker/vow/vow_suite_test.go deleted file mode 100644 index d5f42d1e..00000000 --- a/pkg/transformers/storage_diffs/maker/vow/vow_suite_test.go +++ /dev/null @@ -1,13 +0,0 @@ -package vow_test - -import ( - "testing" - - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" -) - -func TestVow(t *testing.T) { - RegisterFailHandler(Fail) - RunSpecs(t, "Storage Diff Vow Suite") -} diff --git a/pkg/transformers/storage_diffs/mappings.go b/pkg/transformers/storage_diffs/mappings.go deleted file mode 100644 index c3df7555..00000000 --- a/pkg/transformers/storage_diffs/mappings.go +++ /dev/null @@ -1,63 +0,0 @@ -// VulcanizeDB -// Copyright © 2018 Vulcanize - -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. - -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - -package storage_diffs - -import ( - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/crypto" - "github.com/vulcanize/vulcanizedb/pkg/datastore/postgres" - "github.com/vulcanize/vulcanizedb/pkg/transformers/storage_diffs/shared" - "math/big" -) - -type Mappings interface { - Lookup(key common.Hash) (shared.StorageValueMetadata, error) - SetDB(db *postgres.DB) -} - -const ( - IndexZero = "0000000000000000000000000000000000000000000000000000000000000000" - IndexOne = "0000000000000000000000000000000000000000000000000000000000000001" - IndexTwo = "0000000000000000000000000000000000000000000000000000000000000002" - IndexThree = "0000000000000000000000000000000000000000000000000000000000000003" - IndexFour = "0000000000000000000000000000000000000000000000000000000000000004" - IndexFive = "0000000000000000000000000000000000000000000000000000000000000005" - IndexSix = "0000000000000000000000000000000000000000000000000000000000000006" - IndexSeven = "0000000000000000000000000000000000000000000000000000000000000007" - IndexEight = "0000000000000000000000000000000000000000000000000000000000000008" - IndexNine = "0000000000000000000000000000000000000000000000000000000000000009" - IndexTen = "0000000000000000000000000000000000000000000000000000000000000010" - IndexEleven = "0000000000000000000000000000000000000000000000000000000000000011 " -) - -func GetMapping(indexOnContract, key string) common.Hash { - keyBytes := common.FromHex("0x" + key + indexOnContract) - encoded := crypto.Keccak256(keyBytes) - return common.BytesToHash(encoded) -} - -func GetNestedMapping(indexOnContract, primaryKey, secondaryKey string) common.Hash { - primaryMappingIndex := crypto.Keccak256(common.FromHex(primaryKey + indexOnContract)) - secondaryMappingIndex := crypto.Keccak256(common.FromHex(secondaryKey), primaryMappingIndex) - return common.BytesToHash(secondaryMappingIndex) -} - -func GetIncrementedKey(original common.Hash, incrementBy int64) common.Hash { - originalMappingAsInt := original.Big() - incremented := big.NewInt(0).Add(originalMappingAsInt, big.NewInt(incrementBy)) - return common.BytesToHash(incremented.Bytes()) -} diff --git a/plugins/example_maker_exporter b/plugins/example_maker_exporter deleted file mode 100644 index b2702cfd..00000000 --- a/plugins/example_maker_exporter +++ /dev/null @@ -1,43 +0,0 @@ -// This should be the output from running composeAndExecute with compose.toml - -package main - -import ( - cat_chop_lump "github.com/vulcanize/mcd_transformers/transformers/cat_file/chop_lump" - bite "github.com/vulcanize/mcd_transformers/transformers/bite" - cat_flip "github.com/vulcanize/mcd_transformers/transformers/cat_file/flip" - cat_pit_vow "github.com/vulcanize/mcd_transformers/transformers/cat_file/pit_vow" - deal "github.com/vulcanize/mcd_transformers/transformers/deal" - dent "github.com/vulcanize/mcd_transformers/transformers/dent" - drip_drip "github.com/vulcanize/mcd_transformers/transformers/drip_drip" - drip_file_ilk "github.com/vulcanize/mcd_transformers/transformers/drip_file/ilk" - drip_file_repo "github.com/vulcanize/mcd_transformers/transformers/drip_file/repo" - drip_file_vow "github.com/vulcanize/mcd_transformers/transformers/drip_file/vow" - flap_kick "github.com/vulcanize/mcd_transformers/transformers/flap_kick" - flip_kick "github.com/vulcanize/mcd_transformers/transformers/flip_kick" - flop_kick "github.com/vulcanize/mcd_transformers/transformers/flop_kick" - frob "github.com/vulcanize/mcd_transformers/transformers/frob" - pit_file_debt_ceiling "github.com/vulcanize/mcd_transformers/transformers/pit_file/debt_ceiling" - pit_file_ilk "github.com/vulcanize/mcd_transformers/transformers/pit_file/ilk" - price_feeds "github.com/vulcanize/mcd_transformers/transformers/price_feeds" - tend "github.com/vulcanize/mcd_transformers/transformers/tend" - vat_flux "github.com/vulcanize/mcd_transformers/transformers/vat_flux" - vat_fold "github.com/vulcanize/mcd_transformers/transformers/vat_fold" - vat_grab "github.com/vulcanize/mcd_transformers/transformers/vat_grab" - vat_heal "github.com/vulcanize/mcd_transformers/transformers/vat_heal" - vat_init "github.com/vulcanize/mcd_transformers/transformers/vat_init" - vat_move "github.com/vulcanize/mcd_transformers/transformers/vat_move" - vat_slip "github.com/vulcanize/mcd_transformers/transformers/vat_slip" - vat_toll "github.com/vulcanize/mcd_transformers/transformers/vat_toll" - vat_tune "github.com/vulcanize/mcd_transformers/transformers/vat_tune" - vow_flog "github.com/vulcanize/mcd_transformers/transformers/vow_flog" - "github.com/vulcanize/vulcanizedb/libraries/shared/transformer" -) - -type exporter string - -var Exporter exporter - -func (e exporter) Export() []transformer.TransformerInitializer { - return []transformer.TransformerInitializer{deal.TransformerInitializer, cat_chop_lump.TransformerInitializer, vat_slip.TransformerInitializer, bite.TransformerInitializer, vat_heal.TransformerInitializer, vat_toll.TransformerInitializer, price_feeds.TransformerInitializer, vat_init.TransformerInitializer, cat_pit_vow.TransformerInitializer, drip_drip.TransformerInitializer, vat_grab.TransformerInitializer, tend.TransformerInitializer, pit_file_ilk.TransformerInitializer, vat_fold.TransformerInitializer, vat_tune.TransformerInitializer, dent.TransformerInitializer, vow_flog.TransformerInitializer, flip_kick.TransformerInitializer, vat_flux.TransformerInitializer, frob.TransformerInitializer, flap_kick.TransformerInitializer, drip_file_repo.TransformerInitializer, flop_kick.TransformerInitializer, vat_move.TransformerInitializer, cat_flip.TransformerInitializer, drip_file_ilk.TransformerInitializer, drip_file_vow.TransformerInitializer, pit_file_debt_ceiling.TransformerInitializer} -} diff --git a/test_config/test_config.go b/test_config/test_config.go index ac954100..f3961456 100644 --- a/test_config/test_config.go +++ b/test_config/test_config.go @@ -99,51 +99,6 @@ func CleanTestDB(db *postgres.DB) { db.MustExec("DELETE FROM checked_headers") db.MustExec("DELETE FROM log_filters") db.MustExec("DELETE FROM logs") - db.MustExec("DELETE FROM maker.bite") - db.MustExec("DELETE FROM maker.cat_file_chop_lump") - db.MustExec("DELETE FROM maker.cat_file_flip") - db.MustExec("DELETE FROM maker.cat_file_pit_vow") - db.MustExec("DELETE FROM maker.deal") - db.MustExec("DELETE FROM maker.dent") - db.MustExec("DELETE FROM maker.drip_drip") - db.MustExec("DELETE FROM maker.drip_file_ilk") - db.MustExec("DELETE FROM maker.drip_file_repo") - db.MustExec("DELETE FROM maker.drip_file_vow") - db.MustExec("DELETE FROM maker.flap_kick") - db.MustExec("DELETE FROM maker.flip_kick") - db.MustExec("DELETE FROM maker.flop_kick") - db.MustExec("DELETE FROM maker.frob") - db.MustExec("DELETE FROM maker.pit_drip") - db.MustExec("DELETE FROM maker.pit_file_debt_ceiling") - db.MustExec("DELETE FROM maker.pit_file_ilk") - db.MustExec("DELETE FROM maker.pit_ilk_line") - db.MustExec("DELETE FROM maker.pit_ilk_spot") - db.MustExec("DELETE FROM maker.pit_line") - db.MustExec("DELETE FROM maker.pit_live") - db.MustExec("DELETE FROM maker.pit_vat") - db.MustExec("DELETE FROM maker.price_feeds") - db.MustExec("DELETE FROM maker.tend") - db.MustExec("DELETE FROM maker.vat_dai") - db.MustExec("DELETE FROM maker.vat_debt") - db.MustExec("DELETE FROM maker.vat_flux") - db.MustExec("DELETE FROM maker.vat_fold") - db.MustExec("DELETE FROM maker.vat_gem") - db.MustExec("DELETE FROM maker.vat_grab") - db.MustExec("DELETE FROM maker.vat_heal") - db.MustExec("DELETE FROM maker.vat_ilk_art") - db.MustExec("DELETE FROM maker.vat_ilk_ink") - db.MustExec("DELETE FROM maker.vat_ilk_rate") - db.MustExec("DELETE FROM maker.vat_ilk_take") - db.MustExec("DELETE FROM maker.vat_init") - db.MustExec("DELETE FROM maker.vat_move") - db.MustExec("DELETE FROM maker.vat_sin") - db.MustExec("DELETE FROM maker.vat_slip") - db.MustExec("DELETE FROM maker.vat_toll") - db.MustExec("DELETE FROM maker.vat_tune") - db.MustExec("DELETE FROM maker.vat_urn_art") - db.MustExec("DELETE FROM maker.vat_urn_ink") - db.MustExec("DELETE FROM maker.vat_vice") - db.MustExec("DELETE FROM maker.vow_flog") db.MustExec("DELETE FROM receipts") db.MustExec("DELETE FROM transactions") db.MustExec("DELETE FROM watched_contracts")