Merge pull request #2 from vulcanize/compose_and_execute
Compose and execute transformers
This commit is contained in:
commit
06fab13c54
2
.gitignore
vendored
2
.gitignore
vendored
@ -12,3 +12,5 @@ postgraphile/build/
|
||||
postgraphile/node_modules/
|
||||
postgraphile/package-lock.json
|
||||
vulcanizedb.log
|
||||
db/migrations/20*.sql
|
||||
plugins/*.so
|
||||
|
@ -13,6 +13,7 @@ go_import_path: github.com/vulcanize/vulcanizedb
|
||||
|
||||
before_install:
|
||||
# ginkgo golint dep goose
|
||||
- echo -e "Host github.com\n\tHostName github.com\n\tUser git\n\tIdentityFile ~/.ssh/id_rsa\n" >> ~/.ssh/config
|
||||
- make installtools
|
||||
- bash ./scripts/install-postgres-10.sh
|
||||
- npm install -g ganache-cli
|
||||
@ -23,9 +24,8 @@ before_install:
|
||||
before_script:
|
||||
- go get -u github.com/pressly/sup/cmd/sup
|
||||
- sudo -u postgres createdb vulcanize_private
|
||||
- make version_migrations
|
||||
- make migrate NAME=vulcanize_private
|
||||
- bash ./pkg/transformers/start_test_chain.sh
|
||||
- bash ./scripts/start_test_chain.sh
|
||||
- cd postgraphile && yarn
|
||||
|
||||
script:
|
||||
@ -38,5 +38,5 @@ notifications:
|
||||
email: false
|
||||
|
||||
after_script:
|
||||
- bash ./pkg/transformers/stop_test_chain.sh
|
||||
- bash ./scripts/stop_test_chain.sh
|
||||
- bash ./bin/deploy.sh
|
||||
|
11
Gopkg.lock
generated
11
Gopkg.lock
generated
@ -28,6 +28,14 @@
|
||||
pruneopts = ""
|
||||
revision = "cff30e1d23fc9e800b2b5b4b41ef1817dda07e9f"
|
||||
|
||||
[[projects]]
|
||||
digest = "1:5d47691333460db6ac83ced03c79b4bdb9aff3e322be24affb7855bed8affc6c"
|
||||
name = "github.com/dave/jennifer"
|
||||
packages = ["jen"]
|
||||
pruneopts = ""
|
||||
revision = "14e399b6b5e8456c66c45c955fc27b568bacb5c9"
|
||||
version = "v1.3.0"
|
||||
|
||||
[[projects]]
|
||||
digest = "1:aaeffbff5bd24654cb4c190ed75d6c7b57b4f5d6741914c1a7a6bb7447e756c5"
|
||||
name = "github.com/deckarep/golang-set"
|
||||
@ -549,6 +557,7 @@
|
||||
analyzer-name = "dep"
|
||||
analyzer-version = 1
|
||||
input-imports = [
|
||||
"github.com/dave/jennifer/jen",
|
||||
"github.com/ethereum/go-ethereum",
|
||||
"github.com/ethereum/go-ethereum/accounts/abi",
|
||||
"github.com/ethereum/go-ethereum/accounts/abi/bind",
|
||||
@ -564,6 +573,7 @@
|
||||
"github.com/ethereum/go-ethereum/params",
|
||||
"github.com/ethereum/go-ethereum/rpc",
|
||||
"github.com/hashicorp/golang-lru",
|
||||
"github.com/hpcloud/tail",
|
||||
"github.com/jmoiron/sqlx",
|
||||
"github.com/lib/pq",
|
||||
"github.com/mitchellh/go-homedir",
|
||||
@ -576,6 +586,7 @@
|
||||
"golang.org/x/net/context",
|
||||
"golang.org/x/sync/errgroup",
|
||||
"gopkg.in/DataDog/dd-trace-go.v1/ddtrace/tracer",
|
||||
"gopkg.in/tomb.v1",
|
||||
]
|
||||
solver-name = "gps-cdcl"
|
||||
solver-version = 1
|
||||
|
4
Makefile
4
Makefile
@ -48,7 +48,6 @@ lint:
|
||||
|
||||
.PHONY: test
|
||||
test: | $(GINKGO) $(LINT)
|
||||
go get -t ./...
|
||||
go vet ./...
|
||||
go fmt ./...
|
||||
$(GINKGO) -r --skipPackage=integration_tests,integration
|
||||
@ -57,13 +56,14 @@ test: | $(GINKGO) $(LINT)
|
||||
integrationtest: | $(GINKGO) $(LINT)
|
||||
go vet ./...
|
||||
go fmt ./...
|
||||
$(GINKGO) -r pkg/transformers/integration_tests/ integration_test/
|
||||
$(GINKGO) -r integration_test/
|
||||
|
||||
.PHONY: dep
|
||||
dep: | $(DEP)
|
||||
$(DEP) ensure
|
||||
|
||||
build: dep
|
||||
git checkout vendor/github.com/ethereum/go-ethereum/accounts/abi
|
||||
go fmt ./...
|
||||
go build
|
||||
|
||||
|
239
README.md
239
README.md
@ -10,7 +10,7 @@ Vulcanize DB is a set of tools that make it easier for developers to write appli
|
||||
|
||||
## Dependencies
|
||||
- Go 1.11+
|
||||
- Postgres 10
|
||||
- Postgres 10.6
|
||||
- Ethereum Node
|
||||
- [Go Ethereum](https://ethereum.github.io/go-ethereum/downloads/) (1.8.21+)
|
||||
- [Parity 1.8.11+](https://github.com/paritytech/parity/releases)
|
||||
@ -26,7 +26,7 @@ Using Vulcanize for the first time requires several steps be done in order to al
|
||||
5. Configuring synced Ethereum node integration
|
||||
6. Data syncing
|
||||
|
||||
## Installation
|
||||
### Installation
|
||||
|
||||
In order to fetch the project codebase for local use or modification, install it to your `GOPATH` via:
|
||||
|
||||
@ -41,9 +41,11 @@ In order to install packages with `dep`, ensure you are in the project directory
|
||||
|
||||
After `dep` finishes, dependencies should be installed within your `GOPATH` at the versions specified in `Gopkg.toml`.
|
||||
|
||||
Because we are working with a modified version of the go-ethereum accounts/abi package, after running `dep ensure` you will need to run `git checkout vendor/github/ethereum/go-ethereum/accounts/abi` to checkout the modified dependency
|
||||
|
||||
Lastly, ensure that `GOPATH` is defined in your shell. If necessary, `GOPATH` can be set in `~/.bashrc` or `~/.bash_profile`, depending upon your system. It can be additionally helpful to add `$GOPATH/bin` to your shell's `$PATH`.
|
||||
|
||||
## Setting up the Database
|
||||
### Setting up the Database
|
||||
1. Install Postgres
|
||||
1. Create a superuser for yourself and make sure `psql --list` works without prompting for a password.
|
||||
1. `createdb vulcanize_public`
|
||||
@ -55,13 +57,13 @@ Lastly, ensure that `GOPATH` is defined in your shell. If necessary, `GOPATH` ca
|
||||
|
||||
* See below for configuring additional environments
|
||||
|
||||
## Create a migration file
|
||||
### Create a migration file
|
||||
1. `make new_migration NAME=add_columnA_to_table1`
|
||||
- This will create a new timestamped migration file in `db/migrations`
|
||||
1. Write the migration code in the created file, under the respective `goose` pragma
|
||||
- Goose automatically runs each migration in a transaction; don't add `BEGIN` and `COMMIT` statements.
|
||||
|
||||
## Configuration
|
||||
### Configuration
|
||||
- To use a local Ethereum node, copy `environments/public.toml.example` to
|
||||
`environments/public.toml` and update the `ipcPath` and `levelDbPath`.
|
||||
- `ipcPath` should match the local node's IPC filepath:
|
||||
@ -88,14 +90,14 @@ Lastly, ensure that `GOPATH` is defined in your shell. If necessary, `GOPATH` ca
|
||||
- See `environments/infura.toml` to configure commands to run against infura, if a local node is unavailable.
|
||||
- Copy `environments/local.toml.example` to `environments/local.toml` to configure commands to run against a local node such as [Ganache](https://truffleframework.com/ganache) or [ganache-cli](https://github.com/trufflesuite/ganache-clihttps://github.com/trufflesuite/ganache-cli).
|
||||
|
||||
## Start syncing with postgres
|
||||
### Start syncing with postgres
|
||||
Syncs VulcanizeDB with the configured Ethereum node, populating blocks, transactions, receipts, and logs.
|
||||
This command is useful when you want to maintain a broad cache of what's happening on the blockchain.
|
||||
1. Start Ethereum node (**if fast syncing your Ethereum node, wait for initial sync to finish**)
|
||||
1. In a separate terminal start VulcanizeDB:
|
||||
- `./vulcanizedb sync --config <config.toml> --starting-block-number <block-number>`
|
||||
|
||||
## Alternatively, sync from Geth's underlying LevelDB
|
||||
### Alternatively, sync from Geth's underlying LevelDB
|
||||
Sync VulcanizeDB from the LevelDB underlying a Geth node.
|
||||
1. Assure node is not running, and that it has synced to the desired block height.
|
||||
1. Start vulcanize_db
|
||||
@ -105,36 +107,12 @@ Sync VulcanizeDB from the LevelDB underlying a Geth node.
|
||||
- `--ending-block-number <block number>`/`-e <block number>`: block number to sync to
|
||||
- `--all`/`-a`: sync all missing blocks
|
||||
|
||||
## Alternatively, sync in "light" mode
|
||||
### Alternatively, sync in "light" mode
|
||||
Syncs VulcanizeDB with the configured Ethereum node, populating only block headers.
|
||||
This command is useful when you want a minimal baseline from which to track targeted data on the blockchain (e.g. individual smart contract storage values).
|
||||
1. Start Ethereum node
|
||||
1. In a separate terminal start VulcanizeDB:
|
||||
- `./vulcanizedb lightSync --config <config.toml> --starting-block-number <block-number>`
|
||||
|
||||
## Continuously sync Maker event logs from light sync
|
||||
Continuously syncs Maker event logs from the configured Ethereum node based on the populated block headers.
|
||||
This includes logs related to auctions, multi-collateral dai, and price feeds.
|
||||
This command requires that the `lightSync` process is also being run so as to be able to sync in real time.
|
||||
|
||||
1. Start Ethereum node (or plan to configure the commands to point to a remote IPC path).
|
||||
1. In a separate terminal run the lightSync command (see above).
|
||||
1. In another terminal window run the continuousLogSync command:
|
||||
- `./vulcanizedb continuousLogSync --config <config.toml>`
|
||||
- An option `--transformers` flag may be passed to the command to specific which transformers to execute, this will default to all transformers if the flag is not passed.
|
||||
- `./vulcanizedb continuousLogSync --config environments/private.toml --transformers="priceFeed"`
|
||||
- see the `buildTransformerInitializerMap` method in `cmd/continuousLogSync.go` for available transformers
|
||||
|
||||
## Backfill Maker event logs from light sync
|
||||
Backfills Maker event logs from the configured Ethereum node based on the populated block headers.
|
||||
This includes logs related to auctions, multi-collateral dai, and price feeds.
|
||||
This command requires that a light sync (see command above) has previously been run.
|
||||
|
||||
_Since auction/mcd contracts have not yet been deployed, this command will need to be run a local blockchain at the moment. As such, a new environment file will need to be added. See `environments/local.toml.example`._
|
||||
|
||||
1. Start Ethereum node
|
||||
1. In a separate terminal run the backfill command:
|
||||
- `./vulcanizedb backfillMakerLogs --config <config.toml>`
|
||||
- `./vulcanizedb lightSync --config <config.toml> --starting-block-number <block-number>`
|
||||
|
||||
## Start full environment in docker by single command
|
||||
|
||||
@ -160,17 +138,27 @@ false
|
||||
If you have full rinkeby chaindata you can move it to `rinkeby_vulcanizedb_geth_data` docker volume to skip long wait of sync.
|
||||
|
||||
## Running the Tests
|
||||
- `createdb vulcanize_private` will create the test db
|
||||
- `make migrate NAME=vulcanize_private` will run the db migrations
|
||||
- `make test` will run the unit tests and skip the integration tests
|
||||
- `make integrationtest` will run the just the integration tests
|
||||
- Note: requires Ganache chain setup and seeded with `flip-kick.js` and `frob.js` (in that order)
|
||||
|
||||
## Deploying
|
||||
1. you will need to make sure you have ssh agent running and your ssh key added to it. instructions [here](https://developer.github.com/v3/guides/using-ssh-agent-forwarding/#your-key-must-be-available-to-ssh-agent)
|
||||
1. `go get -u github.com/pressly/sup/cmd/sup`
|
||||
1. `sup staging deploy`
|
||||
|
||||
## omniWatcher
|
||||
These commands require a pre-synced (full or light) vulcanizeDB (see above sections)
|
||||
## Contract Watchers
|
||||
Contract watchers work with a light or full sync vDB to fetch raw ethereum data and execute a set of transformations over them, persisting the output.
|
||||
|
||||
A watcher is composed of at least a fetcher and a transformer or set of transformers, where a fetcher is an interface for retrieving raw Ethereum data from some source (e.g. eth_jsonrpc, IPFS)
|
||||
and a transformer is an interface for filtering through that raw Ethereum data to extract, process, and persist data for specific contracts or accounts.
|
||||
|
||||
### omniWatcher
|
||||
The `omniWatcher` command is a built-in generic contract watcher. It can watch any and all events for a given contract provided the contract's ABI is available.
|
||||
It also provides some state variable coverage by automating polling of public methods, with some restrictions.
|
||||
|
||||
This command requires a pre-synced (full or light) vulcanizeDB (see above sections) and currently requires the contract ABI be available on etherscan or provided by the user.
|
||||
|
||||
To watch all events of a contract using a light synced vDB:
|
||||
- Execute `./vulcanizedb omniWatcher --config <path to config.toml> --contract-address <contract address>`
|
||||
@ -202,3 +190,182 @@ To watch all types of events of the contract but only persist the ones that emit
|
||||
To watch all events of the contract but only poll the specified method with specified argument values (if they are emitted from the watched events):
|
||||
- Execute `./vulcanizedb omniWatcher --config <path to config.toml> --contract-address <contract address> --methods <methodName> --method-args <arg1> --method-args <arg2>`
|
||||
|
||||
#### omniWatcher output
|
||||
|
||||
Transformed events and polled method results are committed to Postgres in schemas and tables generated according to the contract abi.
|
||||
|
||||
Schemas are created for each contract using the naming convention `<sync-type>_<lowercase contract-address>`
|
||||
Under this schema, tables are generated for watched events as `<lowercase event name>_event` and for polled methods as `<lowercase method name>_method`
|
||||
The 'method' and 'event' identifiers are tacked onto the end of the table names to prevent collisions between methods and events of the same lowercase name
|
||||
|
||||
Example:
|
||||
|
||||
Running `./vulcanizedb omniWatcher --config <path to config> --starting-block-number=5197514 --contract-address=0x8dd5fbce2f6a956c3022ba3663759011dd51e73e --events=Transfer --events=Mint --methods=balanceOf`
|
||||
watches Transfer and Mint events of the TrueUSD contract and polls its balanceOf method using the addresses we find emitted from those events
|
||||
|
||||
It produces and populates a schema with three tables:
|
||||
|
||||
`light_0x8dd5fbce2f6a956c3022ba3663759011dd51e73e.transfer_event`
|
||||
`light_0x8dd5fbce2f6a956c3022ba3663759011dd51e73e.mint_event`
|
||||
`light_0x8dd5fbce2f6a956c3022ba3663759011dd51e73e.balanceof_method`
|
||||
|
||||
Column ids and types for these tables are generated based on the event and method argument names and types and method return types, resulting in tables such as:
|
||||
|
||||
Table "light_0x8dd5fbce2f6a956c3022ba3663759011dd51e73e.transfer_event"
|
||||
|
||||
| Column | Type | Collation | Nullable | Default | Storage | Stats target | Description
|
||||
|:----------:|:---------------------:|:---------:|:--------:|:-------------------------------------------------------------------------------------------:|:--------:|:------------:|:-----------:|
|
||||
| id | integer | | not null | nextval('light_0x8dd5fbce2f6a956c3022ba3663759011dd51e73e.transfer_event_id_seq'::regclass) | plain | | |
|
||||
| header_id | integer | | not null | | plain | | |
|
||||
| token_name | character varying(66) | | not null | | extended | | |
|
||||
| raw_log | jsonb | | | | extended | | |
|
||||
| log_idx | integer | | not null | | plain | | |
|
||||
| tx_idx | integer | | not null | | plain | | |
|
||||
| from_ | character varying(66) | | not null | | extended | | |
|
||||
| to_ | character varying(66) | | not null | | extended | | |
|
||||
| value_ | numeric | | not null | | main | | |
|
||||
|
||||
|
||||
Table "light_0x8dd5fbce2f6a956c3022ba3663759011dd51e73e.balanceof_method"
|
||||
|
||||
| Column | Type | Collation | Nullable | Default | Storage | Stats target | Description |
|
||||
|:----------:|:---------------------:|:---------:|:--------:|:-------------------------------------------------------------------------------------------:|:--------:|:------------:|:-----------:|
|
||||
| id | integer | | not null | nextval('light_0x8dd5fbce2f6a956c3022ba3663759011dd51e73e.balanceof_method_id_seq'::regclass) | plain | | |
|
||||
| token_name | character varying(66) | | not null | | extended | | |
|
||||
| block | integer | | not null | | plain | | |
|
||||
| who_ | character varying(66) | | not null | | extended | | |
|
||||
| returned | numeric | | not null | | main | | |
|
||||
|
||||
The addition of '_' after table names is to prevent collisions with reserved Postgres words
|
||||
|
||||
### composeAndExecute
|
||||
The `composeAndExecute` command is used to compose and execute over an arbitrary set of custom transformers.
|
||||
This is accomplished by generating a Go pluggin which allows our `vulcanizedb` binary to link to external transformers, so
|
||||
long as they abide by our standard [interfaces](https://github.com/vulcanize/maker-vulcanizedb/tree/compose_and_execute/libraries/shared/transformer).
|
||||
|
||||
This command requires Go 1.11+ and [Go plugins](https://golang.org/pkg/plugin/) only work on Unix based systems.
|
||||
|
||||
#### Writing custom transformers
|
||||
Storage Transformers
|
||||
* [Guide](https://github.com/vulcanize/maker-vulcanizedb/blob/compose_and_execute/libraries/shared/factories/storage/README.md)
|
||||
* [Example](https://github.com/vulcanize/maker-vulcanizedb/blob/compose_and_execute/libraries/shared/factories/storage/EXAMPLE.md)
|
||||
|
||||
Event Transformers
|
||||
* Guide
|
||||
* Example
|
||||
|
||||
#### composeAndExecute configuration
|
||||
A .toml config file is specified when executing the command:
|
||||
`./vulcanizedb composeAndExecute --config=./environments/config_name.toml`
|
||||
|
||||
The config provides information for composing a set of transformers:
|
||||
|
||||
```toml
|
||||
[database]
|
||||
name = "vulcanize_public"
|
||||
hostname = "localhost"
|
||||
user = "vulcanize"
|
||||
password = "vulcanize"
|
||||
port = 5432
|
||||
|
||||
[client]
|
||||
ipcPath = "http://kovan0.vulcanize.io:8545"
|
||||
|
||||
[exporter]
|
||||
home = "github.com/vulcanize/vulcanizedb"
|
||||
clone = false
|
||||
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_event"
|
||||
repository = "github.com/account/repo"
|
||||
migrations = "db/migrations"
|
||||
[exporter.transformer4]
|
||||
path = "path/to/transformer4"
|
||||
type = "eth_storage"
|
||||
repository = "github.com/account2/repo2"
|
||||
migrations = "to/db/migrations"
|
||||
```
|
||||
- `home` is the name of the package you are building the plugin for, in most cases this is github.com/vulcanize/vulcanizedb
|
||||
- `clone` this signifies whether or not to retrieve plugin transformer packages by `git clone`ing them; by default we attempt to work with transformer packages located in
|
||||
our `$GOPATH` but setting this to `true` overrides that. This needs to be set to `true` for the configs used in tests in order for them to work with Travis.
|
||||
- `name` is the name used for the plugin files (.so and .go)
|
||||
- `save` indicates whether or not the user wants to save the .go file instead of removing it after .so compilation. Sometimes useful for debugging/trouble-shooting purposes.
|
||||
- `transformerNames` is the list of the names of the transformers we are composing together, so we know how to access their submaps in the exporter map
|
||||
- `exporter.<transformerName>`s are the sub-mappings containing config info for the transformers
|
||||
- `repository` is the path for the repository which contains the transformer and its `TransformerInitializer`
|
||||
- `path` is the relative path from `repository` to the transformer's `TransformerInitializer` directory (initializer package)
|
||||
- `type` is the type of the transformer; indicating which type of watcher it works with (for now, there are only two options: `eth_event` and `eth_storage`)
|
||||
- `eth_storage` indicates the transformer works with the [storage watcher](https://github.com/vulcanize/maker-vulcanizedb/blob/compose_and_execute/libraries/shared/watcher/storage_watcher.go)
|
||||
that fetches state and storage diffs from an ETH node (instead of, for example, from IPFS)
|
||||
- `eth_event` indicates the transformer works with the [event watcher](https://github.com/vulcanize/maker-vulcanizedb/blob/compose_and_execute/libraries/shared/watcher/event_watcher.go)
|
||||
that fetches event logs from an ETH node
|
||||
- `migrations` is the relative path from `repository` to the db migrations directory for the transformer
|
||||
- Note: If any of the imported transformers need additional config variables those need to be included as well
|
||||
|
||||
This information is used to write and build a Go plugin which exports the configured transformers.
|
||||
These transformers are loaded onto their specified watchers and executed.
|
||||
|
||||
Transformers of different types can be run together in the same command using a single config file or in separate instances using different config files
|
||||
|
||||
The general structure of a plugin .go file, and what we would see built with the above config is shown below
|
||||
|
||||
```go
|
||||
package main
|
||||
|
||||
import (
|
||||
interface1 "github.com/vulcanize/vulcanizedb/libraries/shared/transformer"
|
||||
transformer1 "github.com/account/repo/path/to/transformer1"
|
||||
transformer2 "github.com/account/repo/path/to/transformer2"
|
||||
transformer3 "github.com/account/repo/path/to/transformer3"
|
||||
transformer4 "github.com/account2/repo2/path/to/transformer4"
|
||||
)
|
||||
|
||||
type exporter string
|
||||
|
||||
var Exporter exporter
|
||||
|
||||
func (e exporter) Export() []interface1.TransformerInitializer, []interface1.StorageTransformerInitializer {
|
||||
return []interface1.TransformerInitializer{
|
||||
transformer1.TransformerInitializer,
|
||||
transformer2.TransformerInitializer,
|
||||
transformer3.TransformerInitializer,
|
||||
}, []interface1.StorageTransformerInitializer{
|
||||
transformer4.StorageTransformerInitializer,
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
#### Preparing transformer(s) to work as pluggins for composeAndExecute
|
||||
To plug in an external transformer we need to:
|
||||
|
||||
* Create a [package](https://github.com/vulcanize/mcd_transformers/blob/staging/transformers/bite/initializer/initializer.go)
|
||||
that exports a variable `TransformerInitializer` or `StorageTransformerInitializer` that are of type [TransformerInitializer](https://github.com/vulcanize/maker-vulcanizedb/blob/compose_and_execute/libraries/shared/transformer/event_transformer.go#L33)
|
||||
or [StorageTransformerInitializer](https://github.com/vulcanize/maker-vulcanizedb/blob/compose_and_execute/libraries/shared/transformer/storage_transformer.go#L31), respectively
|
||||
* Design the transformers to work in the context of their [event](https://github.com/vulcanize/maker-vulcanizedb/blob/compose_and_execute/libraries/shared/watcher/event_watcher.go#L83)
|
||||
or [storage](https://github.com/vulcanize/maker-vulcanizedb/blob/compose_and_execute/libraries/shared/watcher/storage_watcher.go#L53) watchers
|
||||
* Create db migrations to run against vulcanizeDB so that we can store the transformer output
|
||||
* Specify migration locations for each transformer in the config with the `exporter.transformer.migrations` fields
|
||||
* Do not `goose fix` the transformer migrations
|
||||
|
||||
To update a plugin repository with changes to the core vulcanizedb repository, replace the vulcanizedb vendored in the plugin repo (`plugin_repo/vendor/github.com/vulcanize/vulcanizedb`)
|
||||
with the newly updated version
|
||||
* The entire vendor lib within the vendored vulcanizedb needs to be deleted (`plugin_repo/vendor/github.com/vulcanize/vulcanizedb/vendor`)
|
||||
* These complications arise due to this [conflict](https://github.com/golang/go/issues/20481) between `dep` and Go plugins
|
||||
|
@ -1,62 +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 <http://www.gnu.org/licenses/>.
|
||||
|
||||
package cmd
|
||||
|
||||
import (
|
||||
log "github.com/sirupsen/logrus"
|
||||
"github.com/spf13/cobra"
|
||||
"github.com/vulcanize/vulcanizedb/libraries/shared"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/datastore/postgres"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants"
|
||||
)
|
||||
|
||||
// backfillMakerLogsCmd represents the backfillMakerLogs command
|
||||
var backfillMakerLogsCmd = &cobra.Command{
|
||||
Use: "backfillMakerLogs",
|
||||
Short: "Backfill Maker event logs",
|
||||
Long: `Backfills Maker event logs based on previously populated block Header records.
|
||||
This currently includes logs related to Multi-collateral Dai (frob), Auctions (flip-kick),
|
||||
and Price Feeds (ETH/USD, MKR/USD, and REP/USD - LogValue).
|
||||
|
||||
vulcanizedb backfillMakerLogs --config environments/local.toml
|
||||
|
||||
This command expects a light sync to have been run, and the presence of header records in the Vulcanize database.`,
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
backfillMakerLogs()
|
||||
},
|
||||
}
|
||||
|
||||
func backfillMakerLogs() {
|
||||
blockChain := getBlockChain()
|
||||
db, err := postgres.NewDB(databaseConfig, blockChain.Node())
|
||||
if err != nil {
|
||||
log.Fatal("Failed to initialize database.")
|
||||
}
|
||||
|
||||
watcher := shared.NewEventWatcher(db, blockChain)
|
||||
|
||||
watcher.AddTransformers(transformers.TransformerInitializers())
|
||||
err = watcher.Execute(constants.HeaderMissing)
|
||||
if err != nil {
|
||||
// TODO Handle watcher error in backfillMakerLogs
|
||||
}
|
||||
}
|
||||
|
||||
func init() {
|
||||
rootCmd.AddCommand(backfillMakerLogsCmd)
|
||||
}
|
173
cmd/compose.go
Normal file
173
cmd/compose.go
Normal file
@ -0,0 +1,173 @@
|
||||
// Copyright © 2019 Vulcanize, Inc
|
||||
//
|
||||
// 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 <http://www.gnu.org/licenses/>.
|
||||
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
|
||||
log "github.com/sirupsen/logrus"
|
||||
"github.com/spf13/cobra"
|
||||
"github.com/spf13/viper"
|
||||
|
||||
"github.com/vulcanize/vulcanizedb/pkg/config"
|
||||
p2 "github.com/vulcanize/vulcanizedb/pkg/plugin"
|
||||
)
|
||||
|
||||
// composeCmd represents the compose command
|
||||
var composeCmd = &cobra.Command{
|
||||
Use: "compose",
|
||||
Short: "Composes transformer initializer plugin",
|
||||
Long: `This command needs a config .toml file of form:
|
||||
|
||||
[database]
|
||||
name = "vulcanize_public"
|
||||
hostname = "localhost"
|
||||
user = "vulcanize"
|
||||
password = "vulcanize"
|
||||
port = 5432
|
||||
|
||||
[client]
|
||||
ipcPath = "http://kovan0.vulcanize.io:8545"
|
||||
|
||||
[exporter]
|
||||
home = "github.com/vulcanize/vulcanizedb"
|
||||
clone = false
|
||||
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_event"
|
||||
repository = "github.com/account/repo"
|
||||
migrations = "db/migrations"
|
||||
[exporter.transformer4]
|
||||
path = "path/to/transformer4"
|
||||
type = "eth_storage"
|
||||
repository = "github.com/account2/repo2"
|
||||
migrations = "to/db/migrations"
|
||||
|
||||
|
||||
Note: If any of the plugin transformer need additional
|
||||
configuration variables include them in the .toml file as well
|
||||
|
||||
This information is used to write and build a go plugin with a transformer
|
||||
set composed from the transformer imports specified in the config file
|
||||
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
|
||||
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).
|
||||
|
||||
Transformers of different types can be ran together in the same command using a
|
||||
single config file or in separate command instances using different config files
|
||||
|
||||
Specify config location when executing the command:
|
||||
./vulcanizedb compose --config=./environments/config_name.toml`,
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
compose()
|
||||
},
|
||||
}
|
||||
|
||||
func compose() {
|
||||
// Build plugin generator config
|
||||
prepConfig()
|
||||
|
||||
// Generate code to build the plugin according to the config file
|
||||
log.Info("generating plugin")
|
||||
generator, err := p2.NewGenerator(genConfig, databaseConfig)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
err = generator.GenerateExporterPlugin()
|
||||
if err != nil {
|
||||
log.Debug("generating plugin failed")
|
||||
log.Fatal(err)
|
||||
}
|
||||
// TODO: Embed versioning info in the .so files so we know which version of vulcanizedb to run them with
|
||||
_, pluginPath, err := genConfig.GetPluginPaths()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
fmt.Printf("Composed plugin %s", pluginPath)
|
||||
log.Info("plugin .so file output to", pluginPath)
|
||||
}
|
||||
|
||||
func init() {
|
||||
rootCmd.AddCommand(composeCmd)
|
||||
}
|
||||
|
||||
func prepConfig() {
|
||||
log.Info("configuring plugin")
|
||||
names := viper.GetStringSlice("exporter.transformerNames")
|
||||
transformers := make(map[string]config.Transformer)
|
||||
for _, name := range names {
|
||||
transformer := viper.GetStringMapString("exporter." + name)
|
||||
p, ok := transformer["path"]
|
||||
if !ok || p == "" {
|
||||
log.Fatal(fmt.Sprintf("%s transformer config is missing `path` value", name))
|
||||
}
|
||||
r, ok := transformer["repository"]
|
||||
if !ok || r == "" {
|
||||
log.Fatal(fmt.Sprintf("%s transformer config is missing `repository` value", name))
|
||||
}
|
||||
m, ok := transformer["migrations"]
|
||||
if !ok || m == "" {
|
||||
log.Fatal(fmt.Sprintf("%s transformer config is missing `migrations` value", name))
|
||||
}
|
||||
t, ok := transformer["type"]
|
||||
if !ok {
|
||||
log.Fatal(fmt.Sprintf("%s transformer config is missing `type` value", name))
|
||||
}
|
||||
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"`))
|
||||
}
|
||||
|
||||
transformers[name] = config.Transformer{
|
||||
Path: p,
|
||||
Type: transformerType,
|
||||
RepositoryPath: r,
|
||||
MigrationPath: m,
|
||||
}
|
||||
}
|
||||
|
||||
genConfig = config.Plugin{
|
||||
Transformers: transformers,
|
||||
FilePath: "$GOPATH/src/github.com/vulcanize/vulcanizedb/plugins",
|
||||
FileName: viper.GetString("exporter.name"),
|
||||
Save: viper.GetBool("exporter.save"),
|
||||
Home: viper.GetString("exporter.home"),
|
||||
Clone: viper.GetBool("exporter.clone"),
|
||||
}
|
||||
}
|
179
cmd/composeAndExecute.go
Normal file
179
cmd/composeAndExecute.go
Normal file
@ -0,0 +1,179 @@
|
||||
// Copyright © 2019 Vulcanize, Inc
|
||||
//
|
||||
// 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 <http://www.gnu.org/licenses/>.
|
||||
|
||||
package cmd
|
||||
|
||||
import (
|
||||
log "github.com/sirupsen/logrus"
|
||||
"github.com/spf13/cobra"
|
||||
"github.com/vulcanize/vulcanizedb/libraries/shared/watcher"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/fs"
|
||||
p2 "github.com/vulcanize/vulcanizedb/pkg/plugin"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/plugin/helpers"
|
||||
"github.com/vulcanize/vulcanizedb/utils"
|
||||
"os"
|
||||
"plugin"
|
||||
syn "sync"
|
||||
)
|
||||
|
||||
// composeAndExecuteCmd represents the composeAndExecute command
|
||||
var composeAndExecuteCmd = &cobra.Command{
|
||||
Use: "composeAndExecute",
|
||||
Short: "Composes, loads, and executes transformer initializer plugin",
|
||||
Long: `This command needs a config .toml file of form:
|
||||
|
||||
[database]
|
||||
name = "vulcanize_public"
|
||||
hostname = "localhost"
|
||||
user = "vulcanize"
|
||||
password = "vulcanize"
|
||||
port = 5432
|
||||
|
||||
[client]
|
||||
ipcPath = "http://kovan0.vulcanize.io:8545"
|
||||
|
||||
[exporter]
|
||||
home = "github.com/vulcanize/vulcanizedb"
|
||||
clone = false
|
||||
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_event"
|
||||
repository = "github.com/account/repo"
|
||||
migrations = "db/migrations"
|
||||
[exporter.transformer4]
|
||||
path = "path/to/transformer4"
|
||||
type = "eth_storage"
|
||||
repository = "github.com/account2/repo2"
|
||||
migrations = "to/db/migrations"
|
||||
|
||||
|
||||
Note: If any of the plugin transformer need additional
|
||||
configuration variables include them in the .toml file as well
|
||||
|
||||
This information is used to write and build a go plugin with a transformer
|
||||
set composed from the transformer imports specified in the config file
|
||||
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
|
||||
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).
|
||||
|
||||
Transformers of different types can be ran together in the same command using a
|
||||
single config file or in separate command instances using different config files
|
||||
|
||||
Specify config location when executing the command:
|
||||
./vulcanizedb composeAndExecute --config=./environments/config_name.toml`,
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
composeAndExecute()
|
||||
},
|
||||
}
|
||||
|
||||
func composeAndExecute() {
|
||||
// Build plugin generator config
|
||||
prepConfig()
|
||||
|
||||
// Generate code to build the plugin according to the config file
|
||||
log.Info("generating plugin")
|
||||
generator, err := p2.NewGenerator(genConfig, databaseConfig)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
err = generator.GenerateExporterPlugin()
|
||||
if err != nil {
|
||||
log.Debug("generating plugin failed")
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
// Get the plugin path and load the plugin
|
||||
_, pluginPath, err := genConfig.GetPluginPaths()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
if !genConfig.Save {
|
||||
defer helpers.ClearFiles(pluginPath)
|
||||
}
|
||||
log.Info("linking plugin", pluginPath)
|
||||
plug, err := plugin.Open(pluginPath)
|
||||
if err != nil {
|
||||
log.Debug("linking plugin failed")
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
// Load the `Exporter` symbol from the plugin
|
||||
log.Info("loading transformers from plugin")
|
||||
symExporter, err := plug.Lookup("Exporter")
|
||||
if err != nil {
|
||||
log.Debug("loading Exporter symbol failed")
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
// Assert that the symbol is of type Exporter
|
||||
exporter, ok := symExporter.(Exporter)
|
||||
if !ok {
|
||||
log.Debug("plugged-in symbol not of type Exporter")
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
// Use the Exporters export method to load the TransformerInitializer and StorageTransformerInitializer sets
|
||||
ethEventInitializers, ethStorageInitializers := exporter.Export()
|
||||
|
||||
// Setup bc and db objects
|
||||
blockChain := getBlockChain()
|
||||
db := utils.LoadPostgres(databaseConfig, blockChain.Node())
|
||||
|
||||
// Execute over transformer sets returned by the exporter
|
||||
// Use WaitGroup to wait on both goroutines
|
||||
var wg syn.WaitGroup
|
||||
if len(ethEventInitializers) > 0 {
|
||||
ew := watcher.NewEventWatcher(&db, blockChain)
|
||||
ew.AddTransformers(ethEventInitializers)
|
||||
wg.Add(1)
|
||||
go watchEthEvents(&ew, &wg)
|
||||
}
|
||||
|
||||
if len(ethStorageInitializers) > 0 {
|
||||
tailer := fs.FileTailer{Path: storageDiffsPath}
|
||||
sw := watcher.NewStorageWatcher(tailer, &db)
|
||||
sw.AddTransformers(ethStorageInitializers)
|
||||
wg.Add(1)
|
||||
go watchEthStorage(&sw, &wg)
|
||||
}
|
||||
wg.Wait()
|
||||
}
|
||||
|
||||
func init() {
|
||||
rootCmd.AddCommand(composeAndExecuteCmd)
|
||||
composeAndExecuteCmd.Flags().BoolVar(&recheckHeadersArg, "recheckHeaders", false, "checks headers that are already checked for each transformer.")
|
||||
}
|
@ -1,134 +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 <http://www.gnu.org/licenses/>.
|
||||
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
log "github.com/sirupsen/logrus"
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"github.com/vulcanize/vulcanizedb/libraries/shared"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/datastore/postgres"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers"
|
||||
shared2 "github.com/vulcanize/vulcanizedb/pkg/transformers/shared"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants"
|
||||
)
|
||||
|
||||
// continuousLogSyncCmd represents the continuousLogSync command
|
||||
var continuousLogSyncCmd = &cobra.Command{
|
||||
Use: "continuousLogSync",
|
||||
Short: "Continuously sync logs at the head of the chain",
|
||||
Long: fmt.Sprintf(`Continously syncs logs based on the configured transformers.
|
||||
|
||||
vulcanizedb continousLogSync --config environments/local.toml
|
||||
|
||||
Available transformers for (optional) selection with --transformers:
|
||||
%v
|
||||
|
||||
This command expects a light sync to have been run, and the presence of header records in the Vulcanize database.`,
|
||||
constants.AllTransformerLabels()),
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
syncMakerLogs()
|
||||
},
|
||||
}
|
||||
|
||||
var transformerNames []string
|
||||
var recheckHeadersArg bool
|
||||
|
||||
func syncMakerLogs() {
|
||||
ticker := time.NewTicker(pollingInterval)
|
||||
defer ticker.Stop()
|
||||
|
||||
blockChain := getBlockChain()
|
||||
db, err := postgres.NewDB(databaseConfig, blockChain.Node())
|
||||
if err != nil {
|
||||
log.Fatal("Failed to initialize database.")
|
||||
}
|
||||
|
||||
initializers := getTransformerInitializers(transformerNames)
|
||||
|
||||
watcher := shared.NewEventWatcher(db, blockChain)
|
||||
watcher.AddTransformers(initializers)
|
||||
|
||||
for range ticker.C {
|
||||
if recheckHeadersArg {
|
||||
err = watcher.Execute(constants.HeaderRecheck)
|
||||
} else {
|
||||
err = watcher.Execute(constants.HeaderMissing)
|
||||
}
|
||||
if err != nil {
|
||||
// TODO Handle watcher errors in ContinuousLogSync
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func getTransformerInitializers(transformerNames []string) []shared2.TransformerInitializer {
|
||||
var initializers []shared2.TransformerInitializer
|
||||
|
||||
if transformerNames[0] == "all" {
|
||||
initializers = transformers.TransformerInitializers()
|
||||
} else {
|
||||
initializerMap := buildTransformerInitializerMap()
|
||||
for _, transformerName := range transformerNames {
|
||||
initializers = append(initializers, initializerMap[transformerName])
|
||||
}
|
||||
}
|
||||
return initializers
|
||||
}
|
||||
|
||||
func buildTransformerInitializerMap() map[string]shared2.TransformerInitializer {
|
||||
initializerMap := make(map[string]shared2.TransformerInitializer)
|
||||
|
||||
initializerMap[constants.BiteLabel] = transformers.GetBiteTransformer().NewTransformer
|
||||
initializerMap[constants.CatFileChopLumpLabel] = transformers.GetCatFileChopLumpTransformer().NewLogNoteTransformer
|
||||
initializerMap[constants.CatFileFlipLabel] = transformers.GetCatFileFlipTransformer().NewLogNoteTransformer
|
||||
initializerMap[constants.CatFilePitVowLabel] = transformers.GetCatFilePitVowTransformer().NewLogNoteTransformer
|
||||
initializerMap[constants.DealLabel] = transformers.GetDealTransformer().NewLogNoteTransformer
|
||||
initializerMap[constants.DentLabel] = transformers.GetDentTransformer().NewLogNoteTransformer
|
||||
initializerMap[constants.DripDripLabel] = transformers.GetDripDripTransformer().NewLogNoteTransformer
|
||||
initializerMap[constants.DripFileIlkLabel] = transformers.GetDripFileIlkTransformer().NewLogNoteTransformer
|
||||
initializerMap[constants.DripFileRepoLabel] = transformers.GetDripFileRepoTransformer().NewLogNoteTransformer
|
||||
initializerMap[constants.DripFileVowLabel] = transformers.GetDripFileVowTransformer().NewLogNoteTransformer
|
||||
initializerMap[constants.FlapKickLabel] = transformers.GetFlapKickTransformer().NewTransformer
|
||||
initializerMap[constants.FlipKickLabel] = transformers.GetFlipKickTransformer().NewTransformer
|
||||
initializerMap[constants.FlopKickLabel] = transformers.GetFlopKickTransformer().NewTransformer
|
||||
initializerMap[constants.FrobLabel] = transformers.GetFrobTransformer().NewTransformer
|
||||
initializerMap[constants.PitFileDebtCeilingLabel] = transformers.GetPitFileDebtCeilingTransformer().NewLogNoteTransformer
|
||||
initializerMap[constants.PitFileIlkLabel] = transformers.GetPitFileIlkTransformer().NewLogNoteTransformer
|
||||
initializerMap[constants.PriceFeedLabel] = transformers.GetPriceFeedTransformer().NewLogNoteTransformer
|
||||
initializerMap[constants.TendLabel] = transformers.GetTendTransformer().NewLogNoteTransformer
|
||||
initializerMap[constants.VatFluxLabel] = transformers.GetVatFluxTransformer().NewLogNoteTransformer
|
||||
initializerMap[constants.VatFoldLabel] = transformers.GetVatFoldTransformer().NewLogNoteTransformer
|
||||
initializerMap[constants.VatGrabLabel] = transformers.GetVatGrabTransformer().NewLogNoteTransformer
|
||||
initializerMap[constants.VatHealLabel] = transformers.GetVatHealTransformer().NewLogNoteTransformer
|
||||
initializerMap[constants.VatInitLabel] = transformers.GetVatInitTransformer().NewLogNoteTransformer
|
||||
initializerMap[constants.VatMoveLabel] = transformers.GetVatMoveTransformer().NewLogNoteTransformer
|
||||
initializerMap[constants.VatSlipLabel] = transformers.GetVatSlipTransformer().NewLogNoteTransformer
|
||||
initializerMap[constants.VatTollLabel] = transformers.GetVatTollTransformer().NewLogNoteTransformer
|
||||
initializerMap[constants.VatTuneLabel] = transformers.GetVatTuneTransformer().NewLogNoteTransformer
|
||||
initializerMap[constants.VowFlogLabel] = transformers.GetFlogTransformer().NewLogNoteTransformer
|
||||
|
||||
return initializerMap
|
||||
}
|
||||
|
||||
func init() {
|
||||
rootCmd.AddCommand(continuousLogSyncCmd)
|
||||
continuousLogSyncCmd.Flags().StringSliceVar(&transformerNames, "transformers", []string{"all"}, "transformer names to be run during this command")
|
||||
continuousLogSyncCmd.Flags().BoolVar(&recheckHeadersArg, "recheckHeaders", false, "checks headers that are already checked for each transformer.")
|
||||
}
|
170
cmd/execute.go
Normal file
170
cmd/execute.go
Normal file
@ -0,0 +1,170 @@
|
||||
// Copyright © 2019 Vulcanize, Inc
|
||||
//
|
||||
// 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 <http://www.gnu.org/licenses/>.
|
||||
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"plugin"
|
||||
syn "sync"
|
||||
"time"
|
||||
|
||||
log "github.com/sirupsen/logrus"
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"github.com/vulcanize/vulcanizedb/libraries/shared/constants"
|
||||
"github.com/vulcanize/vulcanizedb/libraries/shared/transformer"
|
||||
"github.com/vulcanize/vulcanizedb/libraries/shared/watcher"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/fs"
|
||||
"github.com/vulcanize/vulcanizedb/utils"
|
||||
)
|
||||
|
||||
// executeCmd represents the execute command
|
||||
var executeCmd = &cobra.Command{
|
||||
Use: "execute",
|
||||
Short: "executes a precomposed transformer initializer plugin",
|
||||
Long: `This command needs a config .toml file of form:
|
||||
|
||||
[database]
|
||||
name = "vulcanize_public"
|
||||
hostname = "localhost"
|
||||
user = "vulcanize"
|
||||
password = "vulcanize"
|
||||
port = 5432
|
||||
|
||||
[client]
|
||||
ipcPath = "http://kovan0.vulcanize.io:8545"
|
||||
|
||||
[exporter]
|
||||
name = "exampleTransformerExporter"
|
||||
|
||||
Note: If any of the plugin transformer need additional
|
||||
configuration variables include them in the .toml file as well
|
||||
|
||||
The exporter.name is the name (without extension) of the plugin to be loaded.
|
||||
The plugin file needs to be located in the /plugins directory and this command assumes
|
||||
the db migrations remain from when the plugin was composed. Additionally, the plugin
|
||||
must have been composed by the same version of vulcanizedb or else it will not be compatible.
|
||||
|
||||
Specify config location when executing the command:
|
||||
./vulcanizedb execute --config=./environments/config_name.toml`,
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
execute()
|
||||
},
|
||||
}
|
||||
|
||||
func execute() {
|
||||
// Build plugin generator config
|
||||
prepConfig()
|
||||
|
||||
// Get the plugin path and load the plugin
|
||||
_, pluginPath, err := genConfig.GetPluginPaths()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
fmt.Printf("Executing plugin %s", pluginPath)
|
||||
log.Info("linking plugin", pluginPath)
|
||||
plug, err := plugin.Open(pluginPath)
|
||||
if err != nil {
|
||||
log.Debug("linking plugin failed")
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
// Load the `Exporter` symbol from the plugin
|
||||
log.Info("loading transformers from plugin")
|
||||
symExporter, err := plug.Lookup("Exporter")
|
||||
if err != nil {
|
||||
log.Debug("loading Exporter symbol failed")
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
// Assert that the symbol is of type Exporter
|
||||
exporter, ok := symExporter.(Exporter)
|
||||
if !ok {
|
||||
log.Debug("plugged-in symbol not of type Exporter")
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
// Use the Exporters export method to load the TransformerInitializer and StorageTransformerInitializer sets
|
||||
ethEventInitializers, ethStorageInitializers := exporter.Export()
|
||||
|
||||
// Setup bc and db objects
|
||||
blockChain := getBlockChain()
|
||||
db := utils.LoadPostgres(databaseConfig, blockChain.Node())
|
||||
|
||||
// Execute over transformer sets returned by the exporter
|
||||
// Use WaitGroup to wait on both goroutines
|
||||
var wg syn.WaitGroup
|
||||
if len(ethEventInitializers) > 0 {
|
||||
ew := watcher.NewEventWatcher(&db, blockChain)
|
||||
ew.AddTransformers(ethEventInitializers)
|
||||
wg.Add(1)
|
||||
go watchEthEvents(&ew, &wg)
|
||||
}
|
||||
|
||||
if len(ethStorageInitializers) > 0 {
|
||||
tailer := fs.FileTailer{Path: storageDiffsPath}
|
||||
sw := watcher.NewStorageWatcher(tailer, &db)
|
||||
sw.AddTransformers(ethStorageInitializers)
|
||||
wg.Add(1)
|
||||
go watchEthStorage(&sw, &wg)
|
||||
}
|
||||
wg.Wait()
|
||||
}
|
||||
|
||||
func init() {
|
||||
rootCmd.AddCommand(executeCmd)
|
||||
executeCmd.Flags().BoolVar(&recheckHeadersArg, "recheckHeaders", false, "checks headers that are already checked for each transformer.")
|
||||
}
|
||||
|
||||
type Exporter interface {
|
||||
Export() ([]transformer.TransformerInitializer, []transformer.StorageTransformerInitializer)
|
||||
}
|
||||
|
||||
func watchEthEvents(w *watcher.EventWatcher, wg *syn.WaitGroup) {
|
||||
defer wg.Done()
|
||||
// Execute over the TransformerInitializer set using the watcher
|
||||
log.Info("executing event transformers")
|
||||
var recheck constants.TransformerExecution
|
||||
if recheckHeadersArg {
|
||||
recheck = constants.HeaderRecheck
|
||||
} else {
|
||||
recheck = constants.HeaderMissing
|
||||
}
|
||||
ticker := time.NewTicker(pollingInterval)
|
||||
defer ticker.Stop()
|
||||
for range ticker.C {
|
||||
err := w.Execute(recheck)
|
||||
if err != nil {
|
||||
// TODO Handle watcher errors in execute
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func watchEthStorage(w *watcher.StorageWatcher, wg *syn.WaitGroup) {
|
||||
defer wg.Done()
|
||||
// Execute over the TransformerInitializer set using the watcher
|
||||
log.Info("executing storage transformers")
|
||||
ticker := time.NewTicker(pollingInterval)
|
||||
defer ticker.Stop()
|
||||
for range ticker.C {
|
||||
err := w.Execute()
|
||||
if err != nil {
|
||||
// TODO Handle watcher errors in execute
|
||||
}
|
||||
}
|
||||
}
|
@ -1,74 +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 <http://www.gnu.org/licenses/>.
|
||||
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/spf13/cobra"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants"
|
||||
)
|
||||
|
||||
// getSignaturesCmd represents the getSignatures command
|
||||
var getSignaturesCmd = &cobra.Command{
|
||||
Use: "getSignatures",
|
||||
Short: "A command to see transformer method and event signatures",
|
||||
Long: `A convenience command to see method/event signatures for Maker transformers
|
||||
vulcanizedb getSignatures`,
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
getSignatures()
|
||||
},
|
||||
}
|
||||
|
||||
func getSignatures() {
|
||||
signatures := make(map[string]string)
|
||||
signatures["BiteSignature"] = constants.GetBiteSignature()
|
||||
signatures["CatFileChopLumpSignature"] = constants.GetCatFileChopLumpSignature()
|
||||
signatures["CatFileFlipSignature"] = constants.GetCatFileFlipSignature()
|
||||
signatures["CatFilePitVowSignature"] = constants.GetCatFilePitVowSignature()
|
||||
signatures["DealSignature"] = constants.GetDealSignature()
|
||||
signatures["DentFunctionSignature"] = constants.GetDentFunctionSignature()
|
||||
signatures["DripDripSignature"] = constants.GetDripDripSignature()
|
||||
signatures["DripFileIlkSignature"] = constants.GetDripFileIlkSignature()
|
||||
signatures["DripFileRepoSignature"] = constants.GetDripFileRepoSignature()
|
||||
signatures["DripFileVowSignature"] = constants.GetDripFileVowSignature()
|
||||
signatures["FlapKickSignature"] = constants.GetFlapKickSignature()
|
||||
signatures["FlipKickSignature"] = constants.GetFlipKickSignature()
|
||||
signatures["FlopKickSignature"] = constants.GetFlopKickSignature()
|
||||
signatures["FrobSignature"] = constants.GetFrobSignature()
|
||||
signatures["LogValueSignature"] = constants.GetLogValueSignature()
|
||||
signatures["PitFileDebtCeilingSignature"] = constants.GetPitFileDebtCeilingSignature()
|
||||
signatures["PitFileIlkSignature"] = constants.GetPitFileIlkSignature()
|
||||
signatures["TendFunctionSignature"] = constants.GetTendFunctionSignature()
|
||||
signatures["VatFluxSignature"] = constants.GetVatFluxSignature()
|
||||
signatures["VatFoldSignature"] = constants.GetVatFoldSignature()
|
||||
signatures["VatGrabSignature"] = constants.GetVatGrabSignature()
|
||||
signatures["VatHealSignature"] = constants.GetVatHealSignature()
|
||||
signatures["VatInitSignature"] = constants.GetVatInitSignature()
|
||||
signatures["VatMoveSignature"] = constants.GetVatMoveSignature()
|
||||
signatures["VatSlipSignature"] = constants.GetVatSlipSignature()
|
||||
signatures["VatTollSignature"] = constants.GetVatTollSignature()
|
||||
signatures["VatTuneSignature"] = constants.GetVatTuneSignature()
|
||||
signatures["VowFlogSignature"] = constants.GetVowFlogSignature()
|
||||
|
||||
for name, sig := range signatures {
|
||||
fmt.Println(name, ": ", sig)
|
||||
}
|
||||
}
|
||||
|
||||
func init() {
|
||||
rootCmd.AddCommand(getSignaturesCmd)
|
||||
}
|
@ -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 <http://www.gnu.org/licenses/>.
|
||||
|
||||
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)
|
||||
}
|
||||
}
|
@ -38,12 +38,14 @@ import (
|
||||
var (
|
||||
cfgFile string
|
||||
databaseConfig config.Database
|
||||
genConfig config.Plugin
|
||||
ipc string
|
||||
levelDbPath string
|
||||
startingBlockNumber int64
|
||||
storageDiffsPath string
|
||||
syncAll bool
|
||||
endingBlockNumber int64
|
||||
recheckHeadersArg bool
|
||||
)
|
||||
|
||||
const (
|
||||
@ -93,6 +95,7 @@ func init() {
|
||||
rootCmd.PersistentFlags().String("client-levelDbPath", "", "location of levelDb chaindata")
|
||||
rootCmd.PersistentFlags().String("datadog-name", "vulcanize-test", "datadog service name")
|
||||
rootCmd.PersistentFlags().String("filesystem-storageDiffsPath", "", "location of storage diffs csv file")
|
||||
rootCmd.PersistentFlags().String("exporter-name", "exporter", "name of exporter plugin")
|
||||
|
||||
viper.BindPFlag("database.name", rootCmd.PersistentFlags().Lookup("database-name"))
|
||||
viper.BindPFlag("database.port", rootCmd.PersistentFlags().Lookup("database-port"))
|
||||
@ -103,6 +106,7 @@ func init() {
|
||||
viper.BindPFlag("client.levelDbPath", rootCmd.PersistentFlags().Lookup("client-levelDbPath"))
|
||||
viper.BindPFlag("datadog.name", rootCmd.PersistentFlags().Lookup("datadog-name"))
|
||||
viper.BindPFlag("filesystem.storageDiffsPath", rootCmd.PersistentFlags().Lookup("filesystem-storageDiffsPath"))
|
||||
viper.BindPFlag("exporter.fileName", rootCmd.PersistentFlags().Lookup("exporter-name"))
|
||||
}
|
||||
|
||||
func initConfig() {
|
||||
|
@ -1,8 +1,7 @@
|
||||
-- +goose Up
|
||||
CREATE TABLE public.checked_headers (
|
||||
id SERIAL PRIMARY KEY,
|
||||
header_id INTEGER UNIQUE NOT NULL REFERENCES headers (id) ON DELETE CASCADE,
|
||||
price_feeds_checked BOOLEAN NOT NULL DEFAULT FALSE
|
||||
header_id INTEGER UNIQUE NOT NULL REFERENCES headers (id) ON DELETE CASCADE
|
||||
);
|
||||
|
||||
-- +goose Down
|
@ -1,6 +0,0 @@
|
||||
-- +goose Up
|
||||
CREATE SCHEMA maker;
|
||||
|
||||
|
||||
-- +goose Down
|
||||
DROP SCHEMA maker;
|
@ -1,26 +0,0 @@
|
||||
-- +goose Up
|
||||
CREATE TABLE maker.flip_kick (
|
||||
id SERIAL PRIMARY KEY,
|
||||
header_id INTEGER NOT NULL REFERENCES headers (id) ON DELETE CASCADE,
|
||||
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,
|
||||
UNIQUE (header_id, tx_idx, log_idx)
|
||||
);
|
||||
|
||||
ALTER TABLE public.checked_headers
|
||||
ADD COLUMN flip_kick_checked BOOLEAN NOT NULL DEFAULT FALSE;
|
||||
|
||||
|
||||
-- +goose Down
|
||||
DROP TABLE maker.flip_kick;
|
||||
|
||||
ALTER TABLE public.checked_headers
|
||||
DROP COLUMN flip_kick_checked;
|
@ -1,8 +0,0 @@
|
||||
-- +goose Up
|
||||
CREATE TABLE maker.ilks (
|
||||
id SERIAL PRIMARY KEY,
|
||||
ilk TEXT UNIQUE
|
||||
);
|
||||
|
||||
-- +goose Down
|
||||
DROP TABLE maker.ilks;
|
@ -1,26 +0,0 @@
|
||||
-- +goose Up
|
||||
CREATE TABLE maker.frob (
|
||||
id SERIAL PRIMARY KEY,
|
||||
header_id INTEGER NOT NULL REFERENCES headers (id) ON DELETE CASCADE,
|
||||
ilk INTEGER NOT NULL REFERENCES maker.ilks (id),
|
||||
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,
|
||||
UNIQUE (header_id, tx_idx, log_idx)
|
||||
);
|
||||
|
||||
ALTER TABLE public.checked_headers
|
||||
ADD COLUMN frob_checked BOOLEAN NOT NULL DEFAULT FALSE;
|
||||
|
||||
|
||||
-- +goose Down
|
||||
DROP TABLE maker.frob;
|
||||
|
||||
ALTER TABLE public.checked_headers
|
||||
DROP COLUMN frob_checked;
|
@ -1,16 +0,0 @@
|
||||
-- +goose Up
|
||||
CREATE TABLE maker.price_feeds (
|
||||
id SERIAL PRIMARY KEY,
|
||||
block_number BIGINT NOT NULL,
|
||||
header_id INTEGER NOT NULL REFERENCES headers (id) ON DELETE CASCADE,
|
||||
medianizer_address TEXT,
|
||||
usd_value NUMERIC,
|
||||
log_idx INTEGER NOT NULL,
|
||||
tx_idx INTEGER NOT NULL,
|
||||
raw_log JSONB,
|
||||
UNIQUE (header_id, medianizer_address, tx_idx, log_idx)
|
||||
);
|
||||
|
||||
|
||||
-- +goose Down
|
||||
DROP TABLE maker.price_feeds;
|
@ -1,24 +0,0 @@
|
||||
-- +goose Up
|
||||
CREATE TABLE maker.tend (
|
||||
id SERIAL PRIMARY KEY,
|
||||
header_id INTEGER NOT NULL REFERENCES headers (id) ON DELETE CASCADE,
|
||||
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,
|
||||
UNIQUE (header_id, tx_idx, log_idx)
|
||||
);
|
||||
|
||||
ALTER TABLE public.checked_headers
|
||||
ADD COLUMN tend_checked BOOLEAN NOT NULL DEFAULT FALSE;
|
||||
|
||||
|
||||
-- +goose Down
|
||||
DROP TABLE maker.tend;
|
||||
|
||||
ALTER TABLE public.checked_headers
|
||||
DROP COLUMN tend_checked;
|
@ -1,26 +0,0 @@
|
||||
-- +goose Up
|
||||
CREATE TABLE maker.bite (
|
||||
id SERIAL PRIMARY KEY,
|
||||
header_id INTEGER NOT NULL REFERENCES headers (id) ON DELETE CASCADE,
|
||||
ilk INTEGER NOT NULL REFERENCES maker.ilks (id),
|
||||
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,
|
||||
UNIQUE (header_id, tx_idx, log_idx)
|
||||
);
|
||||
|
||||
ALTER TABLE public.checked_headers
|
||||
ADD COLUMN bite_checked BOOLEAN NOT NULL DEFAULT FALSE;
|
||||
|
||||
|
||||
-- +goose Down
|
||||
DROP TABLE maker.bite;
|
||||
|
||||
ALTER TABLE public.checked_headers
|
||||
DROP COLUMN bite_checked;
|
@ -1,24 +0,0 @@
|
||||
-- +goose Up
|
||||
CREATE TABLE maker.dent (
|
||||
id SERIAL PRIMARY KEY,
|
||||
header_id INTEGER NOT NULL REFERENCES headers (id) ON DELETE CASCADE,
|
||||
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,
|
||||
UNIQUE (header_id, tx_idx, log_idx)
|
||||
);
|
||||
|
||||
ALTER TABLE public.checked_headers
|
||||
ADD COLUMN dent_checked BOOLEAN NOT NULL DEFAULT FALSE;
|
||||
|
||||
|
||||
-- +goose Down
|
||||
DROP TABLE maker.dent;
|
||||
|
||||
ALTER TABLE public.checked_headers
|
||||
DROP COLUMN dent_checked;
|
@ -1,58 +0,0 @@
|
||||
-- +goose Up
|
||||
CREATE TABLE maker.pit_file_ilk (
|
||||
id SERIAL PRIMARY KEY,
|
||||
header_id INTEGER NOT NULL REFERENCES headers (id) ON DELETE CASCADE,
|
||||
ilk INTEGER NOT NULL REFERENCES maker.ilks (id),
|
||||
what TEXT,
|
||||
data NUMERIC,
|
||||
log_idx INTEGER NOT NUll,
|
||||
tx_idx INTEGER NOT NUll,
|
||||
raw_log JSONB,
|
||||
UNIQUE (header_id, tx_idx, log_idx)
|
||||
);
|
||||
|
||||
CREATE TABLE maker.pit_file_stability_fee (
|
||||
id SERIAL PRIMARY KEY,
|
||||
header_id INTEGER NOT NULL REFERENCES headers (id) ON DELETE CASCADE,
|
||||
what TEXT,
|
||||
data TEXT,
|
||||
log_idx INTEGER NOT NULL,
|
||||
tx_idx INTEGER NOT NULL,
|
||||
raw_log JSONB,
|
||||
UNIQUE (header_id, tx_idx, log_idx)
|
||||
);
|
||||
|
||||
CREATE TABLE maker.pit_file_debt_ceiling (
|
||||
id SERIAL PRIMARY KEY,
|
||||
header_id INTEGER NOT NULL REFERENCES headers (id) ON DELETE CASCADE,
|
||||
what TEXT,
|
||||
data NUMERIC,
|
||||
log_idx INTEGER NOT NULL,
|
||||
tx_idx INTEGER NOT NULL,
|
||||
raw_log JSONB,
|
||||
UNIQUE (header_id, tx_idx, log_idx)
|
||||
);
|
||||
|
||||
ALTER TABLE public.checked_headers
|
||||
ADD COLUMN pit_file_debt_ceiling_checked BOOLEAN NOT NULL DEFAULT FALSE;
|
||||
|
||||
ALTER TABLE public.checked_headers
|
||||
ADD COLUMN pit_file_ilk_checked BOOLEAN NOT NULL DEFAULT FALSE;
|
||||
|
||||
ALTER TABLE public.checked_headers
|
||||
ADD COLUMN pit_file_stability_fee_checked BOOLEAN NOT NULL DEFAULT FALSE;
|
||||
|
||||
|
||||
-- +goose Down
|
||||
DROP TABLE maker.pit_file_ilk;
|
||||
DROP TABLE maker.pit_file_stability_fee;
|
||||
DROP TABLE maker.pit_file_debt_ceiling;
|
||||
|
||||
ALTER TABLE public.checked_headers
|
||||
DROP COLUMN pit_file_debt_ceiling_checked;
|
||||
|
||||
ALTER TABLE public.checked_headers
|
||||
DROP COLUMN pit_file_ilk_checked;
|
||||
|
||||
ALTER TABLE public.checked_headers
|
||||
DROP COLUMN pit_file_stability_fee_checked;
|
@ -1,20 +0,0 @@
|
||||
-- +goose Up
|
||||
CREATE TABLE maker.vat_init (
|
||||
id SERIAL PRIMARY KEY,
|
||||
header_id INTEGER NOT NULL REFERENCES headers (id) ON DELETE CASCADE,
|
||||
ilk INTEGER NOT NULL REFERENCES maker.ilks (id),
|
||||
log_idx INTEGER NOT NUll,
|
||||
tx_idx INTEGER NOT NUll,
|
||||
raw_log JSONB,
|
||||
UNIQUE (header_id, tx_idx, log_idx)
|
||||
);
|
||||
|
||||
ALTER TABLE public.checked_headers
|
||||
ADD COLUMN vat_init_checked BOOLEAN NOT NULL DEFAULT FALSE;
|
||||
|
||||
|
||||
-- +goose Down
|
||||
DROP TABLE maker.vat_init;
|
||||
|
||||
ALTER TABLE public.checked_headers
|
||||
DROP COLUMN vat_init_checked;
|
@ -1,58 +0,0 @@
|
||||
-- +goose Up
|
||||
CREATE TABLE maker.drip_file_ilk (
|
||||
id SERIAL PRIMARY KEY,
|
||||
header_id INTEGER NOT NULL REFERENCES headers (id) ON DELETE CASCADE,
|
||||
ilk INTEGER NOT NULL REFERENCES maker.ilks (id),
|
||||
vow TEXT,
|
||||
tax NUMERIC,
|
||||
log_idx INTEGER NOT NUll,
|
||||
tx_idx INTEGER NOT NUll,
|
||||
raw_log JSONB,
|
||||
UNIQUE (header_id, tx_idx, log_idx)
|
||||
);
|
||||
|
||||
CREATE TABLE maker.drip_file_repo (
|
||||
id SERIAL PRIMARY KEY,
|
||||
header_id INTEGER NOT NULL REFERENCES headers (id) ON DELETE CASCADE,
|
||||
what TEXT,
|
||||
data NUMERIC,
|
||||
log_idx INTEGER NOT NULL,
|
||||
tx_idx INTEGER NOT NULL,
|
||||
raw_log JSONB,
|
||||
UNIQUE (header_id, tx_idx, log_idx)
|
||||
);
|
||||
|
||||
CREATE TABLE maker.drip_file_vow (
|
||||
id SERIAL PRIMARY KEY,
|
||||
header_id INTEGER NOT NULL REFERENCES headers (id) ON DELETE CASCADE,
|
||||
what TEXT,
|
||||
data TEXT,
|
||||
log_idx INTEGER NOT NULL,
|
||||
tx_idx INTEGER NOT NULL,
|
||||
raw_log JSONB,
|
||||
UNIQUE (header_id, tx_idx, log_idx)
|
||||
);
|
||||
|
||||
ALTER TABLE public.checked_headers
|
||||
ADD COLUMN drip_file_ilk_checked BOOLEAN NOT NULL DEFAULT FALSE;
|
||||
|
||||
ALTER TABLE public.checked_headers
|
||||
ADD COLUMN drip_file_repo_checked BOOLEAN NOT NULL DEFAULT FALSE;
|
||||
|
||||
ALTER TABLE public.checked_headers
|
||||
ADD COLUMN drip_file_vow_checked BOOLEAN NOT NULL DEFAULT FALSE;
|
||||
|
||||
|
||||
-- +goose Down
|
||||
DROP TABLE maker.drip_file_ilk;
|
||||
DROP TABLE maker.drip_file_repo;
|
||||
DROP TABLE maker.drip_file_vow;
|
||||
|
||||
ALTER TABLE public.checked_headers
|
||||
DROP COLUMN drip_file_ilk_checked;
|
||||
|
||||
ALTER TABLE public.checked_headers
|
||||
DROP COLUMN drip_file_repo_checked;
|
||||
|
||||
ALTER TABLE public.checked_headers
|
||||
DROP COLUMN drip_file_vow_checked;
|
@ -1,20 +0,0 @@
|
||||
-- +goose Up
|
||||
CREATE TABLE maker.deal (
|
||||
id SERIAL PRIMARY KEY,
|
||||
header_id INTEGER NOT NULL REFERENCES headers (id) ON DELETE CASCADE,
|
||||
bid_id NUMERIC NOT NULL,
|
||||
contract_address VARCHAR,
|
||||
log_idx INTEGER NOT NUll,
|
||||
tx_idx INTEGER NOT NUll,
|
||||
raw_log JSONB,
|
||||
UNIQUE (header_id, tx_idx, log_idx)
|
||||
);
|
||||
|
||||
ALTER TABLE public.checked_headers
|
||||
ADD COLUMN deal_checked BOOLEAN NOT NULL DEFAULT FALSE;
|
||||
|
||||
-- +goose Down
|
||||
DROP TABLE maker.deal;
|
||||
|
||||
ALTER TABLE public.checked_headers
|
||||
DROP COLUMN deal_checked;
|
@ -1,21 +0,0 @@
|
||||
-- +goose Up
|
||||
-- +goose StatementBegin
|
||||
CREATE OR REPLACE FUNCTION notify_pricefeed() RETURNS trigger 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;
|
||||
$$ LANGUAGE plpgsql;
|
||||
-- +goose StatementEnd
|
||||
|
||||
CREATE TRIGGER notify_pricefeeds
|
||||
AFTER INSERT ON maker.price_feeds
|
||||
FOR EACH ROW
|
||||
EXECUTE PROCEDURE notify_pricefeed();
|
||||
|
||||
|
||||
-- +goose Down
|
||||
DROP TRIGGER notify_pricefeeds ON maker.price_feeds;
|
@ -1,20 +0,0 @@
|
||||
-- +goose Up
|
||||
CREATE TABLE maker.drip_drip (
|
||||
id SERIAL PRIMARY KEY,
|
||||
header_id INTEGER NOT NULL REFERENCES headers (id) ON DELETE CASCADE,
|
||||
ilk INTEGER NOT NULL REFERENCES maker.ilks (id),
|
||||
log_idx INTEGER NOT NUll,
|
||||
tx_idx INTEGER NOT NUll,
|
||||
raw_log JSONB,
|
||||
UNIQUE (header_id, tx_idx, log_idx)
|
||||
);
|
||||
|
||||
ALTER TABLE public.checked_headers
|
||||
ADD COLUMN drip_drip_checked BOOLEAN NOT NULL DEFAULT FALSE;
|
||||
|
||||
|
||||
-- +goose Down
|
||||
DROP TABLE maker.drip_drip;
|
||||
|
||||
ALTER TABLE public.checked_headers
|
||||
DROP COLUMN drip_drip_checked;
|
@ -1,59 +0,0 @@
|
||||
-- +goose Up
|
||||
CREATE TABLE maker.cat_file_chop_lump (
|
||||
id SERIAL PRIMARY KEY,
|
||||
header_id INTEGER NOT NULL REFERENCES headers (id) ON DELETE CASCADE,
|
||||
ilk INTEGER NOT NULL REFERENCES maker.ilks (id),
|
||||
what TEXT,
|
||||
data NUMERIC,
|
||||
tx_idx INTEGER NOT NUll,
|
||||
log_idx INTEGER NOT NULL,
|
||||
raw_log JSONB,
|
||||
UNIQUE (header_id, tx_idx, log_idx)
|
||||
);
|
||||
|
||||
CREATE TABLE maker.cat_file_flip (
|
||||
id SERIAL PRIMARY KEY,
|
||||
header_id INTEGER NOT NULL REFERENCES headers (id) ON DELETE CASCADE,
|
||||
ilk TEXT,
|
||||
what TEXT,
|
||||
flip TEXT,
|
||||
tx_idx INTEGER NOT NUll,
|
||||
log_idx INTEGER NOT NULL,
|
||||
raw_log JSONB,
|
||||
UNIQUE (header_id, tx_idx, log_idx)
|
||||
);
|
||||
|
||||
CREATE TABLE maker.cat_file_pit_vow (
|
||||
id SERIAL PRIMARY KEY,
|
||||
header_id INTEGER NOT NULL REFERENCES headers (id) ON DELETE CASCADE,
|
||||
what TEXT,
|
||||
data TEXT,
|
||||
tx_idx INTEGER NOT NUll,
|
||||
log_idx INTEGER NOT NULL,
|
||||
raw_log JSONB,
|
||||
UNIQUE (header_id, tx_idx, log_idx)
|
||||
);
|
||||
|
||||
ALTER TABLE public.checked_headers
|
||||
ADD COLUMN cat_file_chop_lump_checked BOOLEAN NOT NULL DEFAULT FALSE;
|
||||
|
||||
ALTER TABLE public.checked_headers
|
||||
ADD COLUMN cat_file_flip_checked BOOLEAN NOT NULL DEFAULT FALSE;
|
||||
|
||||
ALTER TABLE public.checked_headers
|
||||
ADD COLUMN cat_file_pit_vow_checked BOOLEAN NOT NULL DEFAULT FALSE;
|
||||
|
||||
|
||||
-- +goose Down
|
||||
DROP TABLE maker.cat_file_chop_lump;
|
||||
DROP TABLE maker.cat_file_flip;
|
||||
DROP TABLE maker.cat_file_pit_vow;
|
||||
|
||||
ALTER TABLE public.checked_headers
|
||||
DROP COLUMN cat_file_chop_lump_checked;
|
||||
|
||||
ALTER TABLE public.checked_headers
|
||||
DROP COLUMN cat_file_flip_checked;
|
||||
|
||||
ALTER TABLE public.checked_headers
|
||||
DROP COLUMN cat_file_pit_vow_checked;
|
@ -1,23 +0,0 @@
|
||||
-- +goose Up
|
||||
CREATE TABLE maker.flop_kick (
|
||||
id SERIAL PRIMARY KEY,
|
||||
header_id INTEGER NOT NULL REFERENCES headers (id) ON DELETE CASCADE,
|
||||
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,
|
||||
UNIQUE (header_id, tx_idx, log_idx)
|
||||
);
|
||||
|
||||
ALTER TABLE public.checked_headers
|
||||
ADD COLUMN flop_kick_checked BOOLEAN NOT NULL DEFAULT FALSE;
|
||||
|
||||
|
||||
-- +goose Down
|
||||
DROP TABLE maker.flop_kick;
|
||||
ALTER TABLE public.checked_headers
|
||||
DROP COLUMN flop_kick_checked;
|
@ -1,21 +0,0 @@
|
||||
-- +goose Up
|
||||
CREATE TABLE maker.vat_move (
|
||||
id SERIAL PRIMARY KEY,
|
||||
header_id INTEGER NOT NULL REFERENCES headers (id) ON DELETE CASCADE,
|
||||
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,
|
||||
UNIQUE (header_id, tx_idx, log_idx)
|
||||
);
|
||||
|
||||
ALTER TABLE public.checked_headers
|
||||
ADD COLUMN vat_move_checked BOOLEAN NOT NULL DEFAULT FALSE;
|
||||
|
||||
|
||||
-- +goose Down
|
||||
DROP TABLE maker.vat_move;
|
||||
ALTER TABLE public.checked_headers
|
||||
DROP COLUMN vat_move_checked;
|
@ -1,21 +0,0 @@
|
||||
-- +goose Up
|
||||
CREATE TABLE maker.vat_fold (
|
||||
id SERIAL PRIMARY KEY,
|
||||
header_id INTEGER NOT NULL REFERENCES headers (id) ON DELETE CASCADE,
|
||||
ilk INTEGER NOT NULL REFERENCES maker.ilks (id),
|
||||
urn TEXT,
|
||||
rate NUMERIC,
|
||||
log_idx INTEGER NOT NULL,
|
||||
tx_idx INTEGER NOT NULL,
|
||||
raw_log JSONB,
|
||||
UNIQUE (header_id, tx_idx, log_idx)
|
||||
);
|
||||
|
||||
ALTER TABLE public.checked_headers
|
||||
ADD COLUMN vat_fold_checked BOOLEAN NOT NULL DEFAULT FALSE;
|
||||
|
||||
|
||||
-- +goose Down
|
||||
DROP TABLE maker.vat_fold;
|
||||
ALTER TABLE public.checked_headers
|
||||
DROP COLUMN vat_fold_checked;
|
@ -1,21 +0,0 @@
|
||||
-- +goose Up
|
||||
CREATE TABLE maker.vat_heal (
|
||||
id SERIAL PRIMARY KEY,
|
||||
header_id INTEGER NOT NULL REFERENCES headers (id) ON DELETE CASCADE,
|
||||
urn TEXT,
|
||||
v TEXT,
|
||||
rad NUMERIC,
|
||||
log_idx INTEGER NOT NULL,
|
||||
tx_idx INTEGER NOT NULL,
|
||||
raw_log JSONB,
|
||||
UNIQUE (header_id, tx_idx, log_idx)
|
||||
);
|
||||
|
||||
ALTER TABLE public.checked_headers
|
||||
ADD COLUMN vat_heal_checked BOOLEAN NOT NULL DEFAULT FALSE;
|
||||
|
||||
|
||||
-- +goose Down
|
||||
DROP TABLE maker.vat_heal;
|
||||
ALTER TABLE public.checked_headers
|
||||
DROP COLUMN vat_heal_checked;
|
@ -1,21 +0,0 @@
|
||||
-- +goose Up
|
||||
CREATE TABLE maker.vat_toll (
|
||||
id SERIAL PRIMARY KEY,
|
||||
header_id INTEGER NOT NULL REFERENCES headers (id) ON DELETE CASCADE,
|
||||
ilk INTEGER NOT NULL REFERENCES maker.ilks (id),
|
||||
urn TEXT,
|
||||
take NUMERIC,
|
||||
tx_idx INTEGER NOT NULL,
|
||||
log_idx INTEGER NOT NULL,
|
||||
raw_log JSONB,
|
||||
UNIQUE (header_id, tx_idx, log_idx)
|
||||
);
|
||||
|
||||
ALTER TABLE public.checked_headers
|
||||
ADD COLUMN vat_toll_checked BOOLEAN NOT NULL DEFAULT FALSE;
|
||||
|
||||
|
||||
-- +goose Down
|
||||
DROP TABLE maker.vat_toll;
|
||||
ALTER TABLE public.checked_headers
|
||||
DROP COLUMN vat_toll_checked;
|
@ -1,24 +0,0 @@
|
||||
-- +goose Up
|
||||
CREATE TABLE maker.vat_tune (
|
||||
id SERIAL PRIMARY KEY,
|
||||
header_id INTEGER NOT NULL REFERENCES headers (id) ON DELETE CASCADE,
|
||||
ilk INTEGER NOT NULL REFERENCES maker.ilks (id),
|
||||
urn TEXT,
|
||||
v TEXT,
|
||||
w TEXT,
|
||||
dink NUMERIC,
|
||||
dart NUMERIC,
|
||||
tx_idx INTEGER NOT NULL,
|
||||
log_idx INTEGER NOT NULL,
|
||||
raw_log JSONB,
|
||||
UNIQUE (header_id, tx_idx, log_idx)
|
||||
);
|
||||
|
||||
ALTER TABLE public.checked_headers
|
||||
ADD COLUMN vat_tune_checked BOOLEAN NOT NULL DEFAULT FALSE;
|
||||
|
||||
|
||||
-- +goose Down
|
||||
DROP TABLE maker.vat_tune;
|
||||
ALTER TABLE public.checked_headers
|
||||
DROP COLUMN vat_tune_checked;
|
@ -1,24 +0,0 @@
|
||||
-- +goose Up
|
||||
CREATE TABLE maker.vat_grab (
|
||||
id SERIAL PRIMARY KEY,
|
||||
header_id INTEGER NOT NULL REFERENCES headers (id) ON DELETE CASCADE,
|
||||
ilk INTEGER NOT NULL REFERENCES maker.ilks (id),
|
||||
urn TEXT,
|
||||
v TEXT,
|
||||
w TEXT,
|
||||
dink NUMERIC,
|
||||
dart NUMERIC,
|
||||
log_idx INTEGER NOT NULL,
|
||||
tx_idx INTEGER NOT NULL,
|
||||
raw_log JSONB,
|
||||
UNIQUE (header_id, tx_idx, log_idx)
|
||||
);
|
||||
|
||||
ALTER TABLE public.checked_headers
|
||||
ADD COLUMN vat_grab_checked BOOLEAN NOT NULL DEFAULT FALSE;
|
||||
|
||||
|
||||
-- +goose Down
|
||||
DROP TABLE maker.vat_grab;
|
||||
ALTER TABLE public.checked_headers
|
||||
DROP COLUMN vat_grab_checked;
|
@ -1,22 +0,0 @@
|
||||
-- +goose Up
|
||||
CREATE TABLE maker.vat_flux (
|
||||
id SERIAL PRIMARY KEY,
|
||||
header_id INTEGER NOT NULL REFERENCES headers (id) ON DELETE CASCADE,
|
||||
ilk INTEGER NOT NULL REFERENCES maker.ilks (id),
|
||||
src TEXT,
|
||||
dst TEXT,
|
||||
rad numeric,
|
||||
tx_idx INTEGER NOT NULL,
|
||||
log_idx INTEGER NOT NULL,
|
||||
raw_log JSONB,
|
||||
UNIQUE (header_id, tx_idx, log_idx)
|
||||
);
|
||||
|
||||
ALTER TABLE public.checked_headers
|
||||
ADD COLUMN vat_flux_checked BOOLEAN NOT NULL DEFAULT FALSE;
|
||||
|
||||
|
||||
-- +goose Down
|
||||
DROP TABLE maker.vat_flux;
|
||||
ALTER TABLE public.checked_headers
|
||||
DROP COLUMN vat_flux_checked;
|
@ -1,21 +0,0 @@
|
||||
-- +goose Up
|
||||
CREATE TABLE maker.vat_slip (
|
||||
id SERIAL PRIMARY KEY,
|
||||
header_id INTEGER NOT NULL REFERENCES headers (id) ON DELETE CASCADE,
|
||||
ilk INTEGER NOT NULL REFERENCES maker.ilks (id),
|
||||
guy TEXT,
|
||||
rad NUMERIC,
|
||||
tx_idx INTEGER NOT NULL,
|
||||
log_idx INTEGER NOT NULL,
|
||||
raw_log JSONB,
|
||||
UNIQUE (header_id, tx_idx, log_idx)
|
||||
);
|
||||
|
||||
ALTER TABLE public.checked_headers
|
||||
ADD COLUMN vat_slip_checked BOOLEAN NOT NULL DEFAULT FALSE;
|
||||
|
||||
|
||||
-- +goose Down
|
||||
DROP TABLE maker.vat_slip;
|
||||
ALTER TABLE public.checked_headers
|
||||
DROP COLUMN vat_slip_checked;
|
@ -1,19 +0,0 @@
|
||||
-- +goose Up
|
||||
CREATE TABLE maker.vow_flog (
|
||||
id SERIAL PRIMARY KEY,
|
||||
header_id INTEGER NOT NULL REFERENCES headers (id) ON DELETE CASCADE,
|
||||
era INTEGER NOT NULL,
|
||||
log_idx INTEGER NOT NULL,
|
||||
tx_idx INTEGER NOT NULL,
|
||||
raw_log JSONB,
|
||||
UNIQUE (header_id, tx_idx, log_idx)
|
||||
);
|
||||
|
||||
ALTER TABLE public.checked_headers
|
||||
ADD COLUMN vow_flog_checked BOOLEAN NOT NULL DEFAULT FALSE;
|
||||
|
||||
|
||||
-- +goose Down
|
||||
DROP TABLE maker.vow_flog;
|
||||
ALTER TABLE public.checked_headers
|
||||
DROP COLUMN vow_flog_checked;
|
@ -1,23 +0,0 @@
|
||||
-- +goose Up
|
||||
CREATE TABLE maker.flap_kick (
|
||||
id SERIAL PRIMARY KEY,
|
||||
header_id INTEGER NOT NULL REFERENCES headers (id) ON DELETE CASCADE,
|
||||
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,
|
||||
UNIQUE (header_id, tx_idx, log_idx)
|
||||
);
|
||||
|
||||
ALTER TABLE public.checked_headers
|
||||
ADD COLUMN flap_kick_checked BOOLEAN NOT NULL DEFAULT FALSE;
|
||||
|
||||
|
||||
-- +goose Down
|
||||
DROP TABLE maker.flap_kick;
|
||||
ALTER TABLE public.checked_headers
|
||||
DROP COLUMN flap_kick_checked;
|
@ -1,21 +0,0 @@
|
||||
-- +goose Up
|
||||
DROP TABLE maker.pit_file_stability_fee;
|
||||
|
||||
ALTER TABLE public.checked_headers
|
||||
DROP COLUMN pit_file_stability_fee_checked;
|
||||
|
||||
|
||||
-- +goose Down
|
||||
CREATE TABLE maker.pit_file_stability_fee (
|
||||
id SERIAL PRIMARY KEY,
|
||||
header_id INTEGER NOT NULL REFERENCES headers (id) ON DELETE CASCADE,
|
||||
what TEXT,
|
||||
data TEXT,
|
||||
log_idx INTEGER NOT NULL,
|
||||
tx_idx INTEGER NOT NULL,
|
||||
raw_log JSONB,
|
||||
UNIQUE (header_id, tx_idx, log_idx)
|
||||
);
|
||||
|
||||
ALTER TABLE public.checked_headers
|
||||
ADD COLUMN pit_file_stability_fee_checked BOOLEAN NOT NULL DEFAULT FALSE;
|
@ -1,52 +0,0 @@
|
||||
-- +goose Up
|
||||
CREATE TABLE maker.pit_drip (
|
||||
id SERIAL PRIMARY KEY,
|
||||
block_number BIGINT,
|
||||
block_hash TEXT,
|
||||
drip TEXT
|
||||
);
|
||||
|
||||
CREATE TABLE maker.pit_ilk_spot (
|
||||
id SERIAL PRIMARY KEY,
|
||||
block_number BIGINT,
|
||||
block_hash TEXT,
|
||||
ilk INTEGER NOT NULL REFERENCES maker.ilks (id),
|
||||
spot NUMERIC NOT NULL
|
||||
);
|
||||
|
||||
CREATE TABLE maker.pit_ilk_line (
|
||||
id SERIAL PRIMARY KEY,
|
||||
block_number BIGINT,
|
||||
block_hash TEXT,
|
||||
ilk INTEGER NOT NULL REFERENCES maker.ilks (id),
|
||||
line NUMERIC NOT NULL
|
||||
);
|
||||
|
||||
CREATE TABLE maker.pit_line (
|
||||
id SERIAL PRIMARY KEY,
|
||||
block_number BIGINT,
|
||||
block_hash TEXT,
|
||||
line NUMERIC NOT NULL
|
||||
);
|
||||
|
||||
CREATE TABLE maker.pit_live (
|
||||
id SERIAL PRIMARY KEY,
|
||||
block_number BIGINT,
|
||||
block_hash TEXT,
|
||||
live NUMERIC NOT NULL
|
||||
);
|
||||
|
||||
CREATE TABLE maker.pit_vat (
|
||||
id SERIAL PRIMARY KEY,
|
||||
block_number BIGINT,
|
||||
block_hash TEXT,
|
||||
vat TEXT
|
||||
);
|
||||
|
||||
-- +goose Down
|
||||
DROP TABLE maker.pit_drip;
|
||||
DROP TABLE maker.pit_ilk_spot;
|
||||
DROP TABLE maker.pit_ilk_line;
|
||||
DROP TABLE maker.pit_line;
|
||||
DROP TABLE maker.pit_live;
|
||||
DROP TABLE maker.pit_vat;
|
@ -1,175 +0,0 @@
|
||||
-- +goose Up
|
||||
ALTER TABLE checked_headers
|
||||
ALTER price_feeds_checked SET DEFAULT null,
|
||||
ALTER flip_kick_checked SET DEFAULT null,
|
||||
ALTER frob_checked SET DEFAULT null,
|
||||
ALTER tend_checked SET DEFAULT null,
|
||||
ALTER bite_checked SET DEFAULT null,
|
||||
ALTER dent_checked SET DEFAULT null,
|
||||
ALTER pit_file_debt_ceiling_checked SET DEFAULT null,
|
||||
ALTER pit_file_ilk_checked SET DEFAULT null,
|
||||
ALTER vat_init_checked SET DEFAULT null,
|
||||
ALTER drip_file_ilk_checked SET DEFAULT null,
|
||||
ALTER drip_file_repo_checked SET DEFAULT null,
|
||||
ALTER drip_file_vow_checked SET DEFAULT null,
|
||||
ALTER deal_checked SET DEFAULT null,
|
||||
ALTER drip_drip_checked SET DEFAULT null,
|
||||
ALTER cat_file_chop_lump_checked SET DEFAULT null,
|
||||
ALTER cat_file_flip_checked SET DEFAULT null,
|
||||
ALTER cat_file_pit_vow_checked SET DEFAULT null,
|
||||
ALTER flop_kick_checked SET DEFAULT null,
|
||||
ALTER vat_move_checked SET DEFAULT null,
|
||||
ALTER vat_fold_checked SET DEFAULT null,
|
||||
ALTER vat_heal_checked SET DEFAULT null,
|
||||
ALTER vat_toll_checked SET DEFAULT null,
|
||||
ALTER vat_tune_checked SET DEFAULT null,
|
||||
ALTER vat_grab_checked SET DEFAULT null,
|
||||
ALTER vat_flux_checked SET DEFAULT null,
|
||||
ALTER vat_slip_checked SET DEFAULT null,
|
||||
ALTER vow_flog_checked SET DEFAULT null,
|
||||
ALTER flap_kick_checked SET DEFAULT null;
|
||||
|
||||
ALTER TABLE checked_headers
|
||||
ALTER COLUMN price_feeds_checked TYPE integer USING CASE WHEN false THEN 0 ELSE 1 END,
|
||||
ALTER price_feeds_checked SET DEFAULT 0,
|
||||
ALTER COLUMN flip_kick_checked TYPE integer USING CASE WHEN false THEN 0 ELSE 1 END,
|
||||
ALTER flip_kick_checked SET DEFAULT 0,
|
||||
ALTER COLUMN frob_checked TYPE integer USING CASE WHEN false THEN 0 ELSE 1 END,
|
||||
ALTER frob_checked SET DEFAULT 0,
|
||||
ALTER COLUMN tend_checked TYPE integer USING CASE WHEN false THEN 0 ELSE 1 END,
|
||||
ALTER tend_checked SET DEFAULT 0,
|
||||
ALTER COLUMN bite_checked TYPE integer USING CASE WHEN false THEN 0 ELSE 1 END,
|
||||
ALTER bite_checked SET DEFAULT 0,
|
||||
ALTER COLUMN dent_checked TYPE integer USING CASE WHEN false THEN 0 ELSE 1 END,
|
||||
ALTER dent_checked SET DEFAULT 0,
|
||||
ALTER COLUMN pit_file_debt_ceiling_checked TYPE integer USING CASE WHEN false THEN 0 ELSE 1 END,
|
||||
ALTER pit_file_debt_ceiling_checked SET DEFAULT 0,
|
||||
ALTER COLUMN pit_file_ilk_checked TYPE integer USING CASE WHEN false THEN 0 ELSE 1 END,
|
||||
ALTER pit_file_ilk_checked SET DEFAULT 0,
|
||||
ALTER COLUMN vat_init_checked TYPE integer USING CASE WHEN false THEN 0 ELSE 1 END,
|
||||
ALTER vat_init_checked SET DEFAULT 0,
|
||||
ALTER COLUMN drip_file_ilk_checked TYPE integer USING CASE WHEN false THEN 0 ELSE 1 END,
|
||||
ALTER drip_file_ilk_checked SET DEFAULT 0,
|
||||
ALTER COLUMN drip_file_repo_checked TYPE integer USING CASE WHEN false THEN 0 ELSE 1 END,
|
||||
ALTER drip_file_repo_checked SET DEFAULT 0,
|
||||
ALTER COLUMN drip_file_vow_checked TYPE integer USING CASE WHEN false THEN 0 ELSE 1 END,
|
||||
ALTER drip_file_vow_checked SET DEFAULT 0,
|
||||
ALTER COLUMN deal_checked TYPE integer USING CASE WHEN false THEN 0 ELSE 1 END,
|
||||
ALTER deal_checked SET DEFAULT 0,
|
||||
ALTER COLUMN drip_drip_checked TYPE integer USING CASE WHEN false THEN 0 ELSE 1 END,
|
||||
ALTER drip_drip_checked SET DEFAULT 0,
|
||||
ALTER COLUMN cat_file_chop_lump_checked TYPE integer USING CASE WHEN false THEN 0 ELSE 1 END,
|
||||
ALTER cat_file_chop_lump_checked SET DEFAULT 0,
|
||||
ALTER COLUMN cat_file_flip_checked TYPE integer USING CASE WHEN false THEN 0 ELSE 1 END,
|
||||
ALTER cat_file_flip_checked SET DEFAULT 0,
|
||||
ALTER COLUMN cat_file_pit_vow_checked TYPE integer USING CASE WHEN false THEN 0 ELSE 1 END,
|
||||
ALTER cat_file_pit_vow_checked SET DEFAULT 0,
|
||||
ALTER COLUMN flop_kick_checked TYPE integer USING CASE WHEN false THEN 0 ELSE 1 END,
|
||||
ALTER flop_kick_checked SET DEFAULT 0,
|
||||
ALTER COLUMN vat_move_checked TYPE integer USING CASE WHEN false THEN 0 ELSE 1 END,
|
||||
ALTER vat_move_checked SET DEFAULT 0,
|
||||
ALTER COLUMN vat_fold_checked TYPE integer USING CASE WHEN false THEN 0 ELSE 1 END,
|
||||
ALTER vat_fold_checked SET DEFAULT 0,
|
||||
ALTER COLUMN vat_heal_checked TYPE integer USING CASE WHEN false THEN 0 ELSE 1 END,
|
||||
ALTER vat_heal_checked SET DEFAULT 0,
|
||||
ALTER COLUMN vat_toll_checked TYPE integer USING CASE WHEN false THEN 0 ELSE 1 END,
|
||||
ALTER vat_toll_checked SET DEFAULT 0,
|
||||
ALTER COLUMN vat_tune_checked TYPE integer USING CASE WHEN false THEN 0 ELSE 1 END,
|
||||
ALTER vat_tune_checked SET DEFAULT 0,
|
||||
ALTER COLUMN vat_grab_checked TYPE integer USING CASE WHEN false THEN 0 ELSE 1 END,
|
||||
ALTER vat_grab_checked SET DEFAULT 0,
|
||||
ALTER COLUMN vat_flux_checked TYPE integer USING CASE WHEN false THEN 0 ELSE 1 END,
|
||||
ALTER vat_flux_checked SET DEFAULT 0,
|
||||
ALTER COLUMN vat_slip_checked TYPE integer USING CASE WHEN false THEN 0 ELSE 1 END,
|
||||
ALTER vat_slip_checked SET DEFAULT 0,
|
||||
ALTER COLUMN vow_flog_checked TYPE integer USING CASE WHEN false THEN 0 ELSE 1 END,
|
||||
ALTER vow_flog_checked SET DEFAULT 0,
|
||||
ALTER COLUMN flap_kick_checked TYPE integer USING CASE WHEN false THEN 0 ELSE 1 END,
|
||||
ALTER flap_kick_checked SET DEFAULT 0;
|
||||
|
||||
-- +goose Down
|
||||
ALTER TABLE checked_headers
|
||||
ALTER price_feeds_checked drop default,
|
||||
ALTER COLUMN price_feeds_checked SET DATA TYPE boolean USING CASE WHEN price_feeds_checked = 0 THEN FALSE ELSE TRUE END,
|
||||
ALTER price_feeds_checked SET DEFAULT FALSE,
|
||||
ALTER flip_kick_checked drop default,
|
||||
ALTER COLUMN flip_kick_checked SET DATA TYPE boolean USING CASE WHEN flip_kick_checked = 0 THEN FALSE ELSE TRUE END,
|
||||
ALTER flip_kick_checked SET DEFAULT FALSE,
|
||||
ALTER frob_checked drop default,
|
||||
ALTER COLUMN frob_checked SET DATA TYPE boolean USING CASE WHEN frob_checked = 0 THEN FALSE ELSE TRUE END,
|
||||
ALTER frob_checked SET DEFAULT FALSE,
|
||||
ALTER tend_checked drop default,
|
||||
ALTER COLUMN tend_checked SET DATA TYPE boolean USING CASE WHEN tend_checked = 0 THEN FALSE ELSE TRUE END,
|
||||
ALTER tend_checked SET DEFAULT FALSE,
|
||||
ALTER bite_checked drop default,
|
||||
ALTER COLUMN bite_checked SET DATA TYPE boolean USING CASE WHEN bite_checked = 0 THEN FALSE ELSE TRUE END,
|
||||
ALTER bite_checked SET DEFAULT FALSE,
|
||||
ALTER dent_checked drop default,
|
||||
ALTER COLUMN dent_checked SET DATA TYPE boolean USING CASE WHEN dent_checked = 0 THEN FALSE ELSE TRUE END,
|
||||
ALTER dent_checked SET DEFAULT FALSE,
|
||||
ALTER pit_file_debt_ceiling_checked drop default,
|
||||
ALTER COLUMN pit_file_debt_ceiling_checked SET DATA TYPE boolean USING CASE WHEN pit_file_debt_ceiling_checked = 0 THEN FALSE ELSE TRUE END,
|
||||
ALTER pit_file_debt_ceiling_checked SET DEFAULT FALSE,
|
||||
ALTER pit_file_ilk_checked drop default,
|
||||
ALTER COLUMN pit_file_ilk_checked SET DATA TYPE boolean USING CASE WHEN pit_file_ilk_checked = 0 THEN FALSE ELSE TRUE END,
|
||||
ALTER pit_file_ilk_checked SET DEFAULT FALSE,
|
||||
ALTER vat_init_checked drop default,
|
||||
ALTER COLUMN vat_init_checked SET DATA TYPE boolean USING CASE WHEN vat_init_checked = 0 THEN FALSE ELSE TRUE END,
|
||||
ALTER vat_init_checked SET DEFAULT FALSE,
|
||||
ALTER drip_file_ilk_checked drop default,
|
||||
ALTER COLUMN drip_file_ilk_checked SET DATA TYPE boolean USING CASE WHEN drip_file_ilk_checked = 0 THEN FALSE ELSE TRUE END,
|
||||
ALTER drip_file_ilk_checked SET DEFAULT FALSE,
|
||||
ALTER drip_file_repo_checked drop default,
|
||||
ALTER COLUMN drip_file_repo_checked SET DATA TYPE boolean USING CASE WHEN drip_file_repo_checked = 0 THEN FALSE ELSE TRUE END,
|
||||
ALTER drip_file_repo_checked SET DEFAULT FALSE,
|
||||
ALTER drip_file_vow_checked drop default,
|
||||
ALTER COLUMN drip_file_vow_checked SET DATA TYPE boolean USING CASE WHEN drip_file_vow_checked = 0 THEN FALSE ELSE TRUE END,
|
||||
ALTER drip_file_vow_checked SET DEFAULT FALSE,
|
||||
ALTER deal_checked drop default,
|
||||
ALTER COLUMN deal_checked SET DATA TYPE boolean USING CASE WHEN deal_checked = 0 THEN FALSE ELSE TRUE END,
|
||||
ALTER deal_checked SET DEFAULT FALSE,
|
||||
ALTER drip_drip_checked drop default,
|
||||
ALTER COLUMN drip_drip_checked SET DATA TYPE boolean USING CASE WHEN drip_drip_checked = 0 THEN FALSE ELSE TRUE END,
|
||||
ALTER drip_drip_checked SET DEFAULT FALSE,
|
||||
ALTER cat_file_chop_lump_checked drop default,
|
||||
ALTER COLUMN cat_file_chop_lump_checked SET DATA TYPE boolean USING CASE WHEN cat_file_chop_lump_checked = 0 THEN FALSE ELSE TRUE END,
|
||||
ALTER cat_file_chop_lump_checked SET DEFAULT FALSE,
|
||||
ALTER cat_file_flip_checked drop default,
|
||||
ALTER COLUMN cat_file_flip_checked SET DATA TYPE boolean USING CASE WHEN cat_file_flip_checked = 0 THEN FALSE ELSE TRUE END,
|
||||
ALTER cat_file_flip_checked SET DEFAULT FALSE,
|
||||
ALTER cat_file_pit_vow_checked drop default,
|
||||
ALTER COLUMN cat_file_pit_vow_checked SET DATA TYPE boolean USING CASE WHEN cat_file_pit_vow_checked = 0 THEN FALSE ELSE TRUE END,
|
||||
ALTER cat_file_pit_vow_checked SET DEFAULT FALSE,
|
||||
ALTER flop_kick_checked drop default,
|
||||
ALTER COLUMN flop_kick_checked SET DATA TYPE boolean USING CASE WHEN flop_kick_checked = 0 THEN FALSE ELSE TRUE END,
|
||||
ALTER flop_kick_checked SET DEFAULT FALSE,
|
||||
ALTER vat_move_checked drop default,
|
||||
ALTER COLUMN vat_move_checked SET DATA TYPE boolean USING CASE WHEN vat_move_checked = 0 THEN FALSE ELSE TRUE END,
|
||||
ALTER vat_move_checked SET DEFAULT FALSE,
|
||||
ALTER vat_fold_checked drop default,
|
||||
ALTER COLUMN vat_fold_checked SET DATA TYPE boolean USING CASE WHEN vat_fold_checked = 0 THEN FALSE ELSE TRUE END,
|
||||
ALTER vat_fold_checked SET DEFAULT FALSE,
|
||||
ALTER vat_heal_checked drop default,
|
||||
ALTER COLUMN vat_heal_checked SET DATA TYPE boolean USING CASE WHEN vat_heal_checked = 0 THEN FALSE ELSE TRUE END,
|
||||
ALTER vat_heal_checked SET DEFAULT FALSE,
|
||||
ALTER vat_toll_checked drop default,
|
||||
ALTER COLUMN vat_toll_checked SET DATA TYPE boolean USING CASE WHEN vat_toll_checked = 0 THEN FALSE ELSE TRUE END,
|
||||
ALTER vat_toll_checked SET DEFAULT FALSE,
|
||||
ALTER vat_tune_checked drop default,
|
||||
ALTER COLUMN vat_tune_checked SET DATA TYPE boolean USING CASE WHEN vat_tune_checked = 0 THEN FALSE ELSE TRUE END,
|
||||
ALTER vat_tune_checked SET DEFAULT FALSE,
|
||||
ALTER vat_grab_checked drop default,
|
||||
ALTER COLUMN vat_grab_checked SET DATA TYPE boolean USING CASE WHEN vat_grab_checked = 0 THEN FALSE ELSE TRUE END,
|
||||
ALTER vat_grab_checked SET DEFAULT FALSE,
|
||||
ALTER vat_flux_checked drop default,
|
||||
ALTER COLUMN vat_flux_checked SET DATA TYPE boolean USING CASE WHEN vat_flux_checked = 0 THEN FALSE ELSE TRUE END,
|
||||
ALTER vat_flux_checked SET DEFAULT FALSE,
|
||||
ALTER vat_slip_checked drop default,
|
||||
ALTER COLUMN vat_slip_checked SET DATA TYPE boolean USING CASE WHEN vat_slip_checked = 0 THEN FALSE ELSE TRUE END,
|
||||
ALTER vat_slip_checked SET DEFAULT FALSE,
|
||||
ALTER vow_flog_checked drop default,
|
||||
ALTER COLUMN vow_flog_checked SET DATA TYPE boolean USING CASE WHEN vow_flog_checked = 0 THEN FALSE ELSE TRUE END,
|
||||
ALTER vow_flog_checked SET DEFAULT FALSE,
|
||||
ALTER flap_kick_checked drop default,
|
||||
ALTER COLUMN flap_kick_checked SET DATA TYPE boolean USING CASE WHEN flap_kick_checked = 0 THEN FALSE ELSE TRUE END,
|
||||
ALTER flap_kick_checked SET DEFAULT FALSE;
|
@ -1,102 +0,0 @@
|
||||
-- +goose Up
|
||||
CREATE TABLE maker.vat_debt (
|
||||
id SERIAL PRIMARY KEY,
|
||||
block_number BIGINT,
|
||||
block_hash TEXT,
|
||||
debt NUMERIC NOT NULL
|
||||
);
|
||||
|
||||
CREATE TABLE maker.vat_vice (
|
||||
id SERIAL PRIMARY KEY,
|
||||
block_number BIGINT,
|
||||
block_hash TEXT,
|
||||
vice NUMERIC NOT NULL
|
||||
);
|
||||
|
||||
CREATE TABLE maker.vat_ilk_art (
|
||||
id SERIAL PRIMARY KEY,
|
||||
block_number BIGINT,
|
||||
block_hash TEXT,
|
||||
ilk INTEGER NOT NULL REFERENCES maker.ilks (id),
|
||||
art NUMERIC NOT NULL
|
||||
);
|
||||
|
||||
CREATE TABLE maker.vat_ilk_ink (
|
||||
id SERIAL PRIMARY KEY,
|
||||
block_number BIGINT,
|
||||
block_hash TEXT,
|
||||
ilk INTEGER NOT NULL REFERENCES maker.ilks (id),
|
||||
ink NUMERIC NOT NULL
|
||||
);
|
||||
|
||||
CREATE TABLE maker.vat_ilk_rate (
|
||||
id SERIAL PRIMARY KEY,
|
||||
block_number BIGINT,
|
||||
block_hash TEXT,
|
||||
ilk INTEGER NOT NULL REFERENCES maker.ilks (id),
|
||||
rate NUMERIC NOT NULL
|
||||
);
|
||||
|
||||
CREATE TABLE maker.vat_ilk_take (
|
||||
id SERIAL PRIMARY KEY,
|
||||
block_number BIGINT,
|
||||
block_hash TEXT,
|
||||
ilk INTEGER NOT NULL REFERENCES maker.ilks (id),
|
||||
take NUMERIC NOT NULL
|
||||
);
|
||||
|
||||
CREATE TABLE maker.vat_urn_art (
|
||||
id SERIAL PRIMARY KEY,
|
||||
block_number BIGINT,
|
||||
block_hash TEXT,
|
||||
ilk INTEGER NOT NULL REFERENCES maker.ilks (id),
|
||||
urn TEXT,
|
||||
art TEXT
|
||||
);
|
||||
|
||||
CREATE TABLE maker.vat_urn_ink (
|
||||
id SERIAL PRIMARY KEY,
|
||||
block_number BIGINT,
|
||||
block_hash TEXT,
|
||||
ilk INTEGER NOT NULL REFERENCES maker.ilks (id),
|
||||
urn TEXT,
|
||||
ink NUMERIC NOT NULL
|
||||
);
|
||||
|
||||
CREATE TABLE maker.vat_gem (
|
||||
id SERIAL PRIMARY KEY,
|
||||
block_number BIGINT,
|
||||
block_hash TEXT,
|
||||
ilk INTEGER NOT NULL REFERENCES maker.ilks (id),
|
||||
guy TEXT,
|
||||
gem NUMERIC NOT NULL
|
||||
);
|
||||
|
||||
CREATE TABLE maker.vat_dai (
|
||||
id SERIAL PRIMARY KEY,
|
||||
block_number BIGINT,
|
||||
block_hash TEXT,
|
||||
guy TEXT,
|
||||
dai NUMERIC NOT NULL
|
||||
);
|
||||
|
||||
CREATE TABLE maker.vat_sin (
|
||||
id SERIAL PRIMARY KEY,
|
||||
block_number BIGINT,
|
||||
block_hash TEXT,
|
||||
guy TEXT,
|
||||
sin NUMERIC NOT NULL
|
||||
);
|
||||
|
||||
-- +goose Down
|
||||
DROP TABLE maker.vat_debt;
|
||||
DROP TABLE maker.vat_vice;
|
||||
DROP TABLE maker.vat_ilk_art;
|
||||
DROP TABLE maker.vat_ilk_ink;
|
||||
DROP TABLE maker.vat_ilk_rate;
|
||||
DROP TABLE maker.vat_ilk_take;
|
||||
DROP TABLE maker.vat_urn_art;
|
||||
DROP TABLE maker.vat_urn_ink;
|
||||
DROP TABLE maker.vat_gem;
|
||||
DROP TABLE maker.vat_dai;
|
||||
DROP TABLE maker.vat_sin;
|
@ -1,82 +0,0 @@
|
||||
-- +goose Up
|
||||
CREATE TABLE maker.vow_vat (
|
||||
id SERIAL PRIMARY KEY,
|
||||
block_number BIGINT,
|
||||
block_hash TEXT,
|
||||
vat TEXT
|
||||
);
|
||||
|
||||
CREATE TABLE maker.vow_cow (
|
||||
id SERIAL PRIMARY KEY,
|
||||
block_number BIGINT,
|
||||
block_hash TEXT,
|
||||
cow TEXT
|
||||
);
|
||||
|
||||
CREATE TABLE maker.vow_row (
|
||||
id SERIAL PRIMARY KEY,
|
||||
block_number BIGINT,
|
||||
block_hash TEXT,
|
||||
row TEXT
|
||||
);
|
||||
|
||||
CREATE TABLE maker.vow_sin (
|
||||
id SERIAL PRIMARY KEY,
|
||||
block_number BIGINT,
|
||||
block_hash TEXT,
|
||||
sin numeric
|
||||
);
|
||||
|
||||
CREATE TABLE maker.vow_woe (
|
||||
id SERIAL PRIMARY KEY,
|
||||
block_number BIGINT,
|
||||
block_hash TEXT,
|
||||
woe numeric
|
||||
);
|
||||
|
||||
CREATE TABLE maker.vow_ash (
|
||||
id SERIAL PRIMARY KEY,
|
||||
block_number BIGINT,
|
||||
block_hash TEXT,
|
||||
ash numeric
|
||||
);
|
||||
|
||||
CREATE TABLE maker.vow_wait (
|
||||
id SERIAL PRIMARY KEY,
|
||||
block_number BIGINT,
|
||||
block_hash TEXT,
|
||||
wait numeric
|
||||
);
|
||||
|
||||
CREATE TABLE maker.vow_sump (
|
||||
id SERIAL PRIMARY KEY,
|
||||
block_number BIGINT,
|
||||
block_hash TEXT,
|
||||
sump numeric
|
||||
);
|
||||
|
||||
CREATE TABLE maker.vow_bump (
|
||||
id SERIAL PRIMARY KEY,
|
||||
block_number BIGINT,
|
||||
block_hash TEXT,
|
||||
bump numeric
|
||||
);
|
||||
|
||||
CREATE TABLE maker.vow_hump (
|
||||
id SERIAL PRIMARY KEY,
|
||||
block_number BIGINT,
|
||||
block_hash TEXT,
|
||||
hump numeric
|
||||
);
|
||||
|
||||
-- +goose Down
|
||||
DROP TABLE maker.vow_vat;
|
||||
DROP TABLE maker.vow_cow;
|
||||
DROP TABLE maker.vow_row;
|
||||
DROP TABLE maker.vow_sin;
|
||||
DROP TABLE maker.vow_woe;
|
||||
DROP TABLE maker.vow_ash;
|
||||
DROP TABLE maker.vow_wait;
|
||||
DROP TABLE maker.vow_sump;
|
||||
DROP TABLE maker.vow_bump;
|
||||
DROP TABLE maker.vow_hump;
|
@ -1,106 +0,0 @@
|
||||
-- +goose Up
|
||||
CREATE TABLE maker.cat_nflip (
|
||||
id SERIAL PRIMARY KEY,
|
||||
block_number BIGINT,
|
||||
block_hash TEXT,
|
||||
nflip NUMERIC NOT NULL
|
||||
);
|
||||
|
||||
CREATE TABLE maker.cat_live (
|
||||
id SERIAL PRIMARY KEY,
|
||||
block_number BIGINT,
|
||||
block_hash TEXT,
|
||||
live NUMERIC NOT NULL
|
||||
);
|
||||
|
||||
CREATE TABLE maker.cat_vat (
|
||||
id SERIAL PRIMARY KEY,
|
||||
block_number BIGINT,
|
||||
block_hash TEXT,
|
||||
vat TEXT
|
||||
);
|
||||
|
||||
CREATE TABLE maker.cat_pit (
|
||||
id SERIAL PRIMARY KEY,
|
||||
block_number BIGINT,
|
||||
block_hash TEXT,
|
||||
pit TEXT
|
||||
);
|
||||
|
||||
CREATE TABLE maker.cat_vow (
|
||||
id SERIAL PRIMARY KEY,
|
||||
block_number BIGINT,
|
||||
block_hash TEXT,
|
||||
vow TEXT
|
||||
);
|
||||
|
||||
CREATE TABLE maker.cat_ilk_flip (
|
||||
id SERIAL PRIMARY KEY,
|
||||
block_number BIGINT,
|
||||
block_hash TEXT,
|
||||
ilk INTEGER NOT NULL REFERENCES maker.ilks (id),
|
||||
flip TEXT
|
||||
);
|
||||
|
||||
CREATE TABLE maker.cat_ilk_chop (
|
||||
id SERIAL PRIMARY KEY,
|
||||
block_number BIGINT,
|
||||
block_hash TEXT,
|
||||
ilk INTEGER NOT NULL REFERENCES maker.ilks (id),
|
||||
chop NUMERIC NOT NULL
|
||||
);
|
||||
|
||||
CREATE TABLE maker.cat_ilk_lump (
|
||||
id SERIAL PRIMARY KEY,
|
||||
block_number BIGINT,
|
||||
block_hash TEXT,
|
||||
ilk INTEGER NOT NULL REFERENCES maker.ilks (id),
|
||||
lump NUMERIC NOT NULL
|
||||
);
|
||||
|
||||
CREATE TABLE maker.cat_flip_ilk (
|
||||
id SERIAL PRIMARY KEY,
|
||||
block_number BIGINT,
|
||||
block_hash TEXT,
|
||||
flip NUMERIC NOT NULL,
|
||||
ilk INTEGER NOT NULL REFERENCES maker.ilks (id)
|
||||
);
|
||||
|
||||
CREATE TABLE maker.cat_flip_urn (
|
||||
id SERIAL PRIMARY KEY,
|
||||
block_number BIGINT,
|
||||
block_hash TEXT,
|
||||
flip NUMERIC NOT NULL,
|
||||
urn TEXT
|
||||
);
|
||||
|
||||
CREATE TABLE maker.cat_flip_ink (
|
||||
id SERIAL PRIMARY KEY,
|
||||
block_number BIGINT,
|
||||
block_hash TEXT,
|
||||
flip NUMERIC NOT NULL,
|
||||
ink NUMERIC NOT NULL
|
||||
);
|
||||
|
||||
CREATE TABLE maker.cat_flip_tab (
|
||||
id SERIAL PRIMARY KEY,
|
||||
block_number BIGINT,
|
||||
block_hash TEXT,
|
||||
flip NUMERIC NOT NULL,
|
||||
tab NUMERIC NOT NULL
|
||||
);
|
||||
|
||||
|
||||
-- +goose Down
|
||||
DROP TABLE maker.cat_nflip;
|
||||
DROP TABLE maker.cat_live;
|
||||
DROP TABLE maker.cat_vat;
|
||||
DROP TABLE maker.cat_pit;
|
||||
DROP TABLE maker.cat_vow;
|
||||
DROP TABLE maker.cat_ilk_flip;
|
||||
DROP TABLE maker.cat_ilk_chop;
|
||||
DROP TABLE maker.cat_ilk_lump;
|
||||
DROP TABLE maker.cat_flip_ilk;
|
||||
DROP TABLE maker.cat_flip_urn;
|
||||
DROP TABLE maker.cat_flip_ink;
|
||||
DROP TABLE maker.cat_flip_tab;
|
4072
db/schema.sql
4072
db/schema.sql
File diff suppressed because it is too large
Load Diff
@ -4,15 +4,4 @@ hostname = "localhost"
|
||||
port = 5432
|
||||
|
||||
[client]
|
||||
ipcPath = "https://mainnet.infura.io/J5Vd2fRtGsw0zZ0Ov3BL"
|
||||
|
||||
[contract]
|
||||
cat = "0x2f34f22a00ee4b7a8f8bbc4eaee1658774c624e0"
|
||||
drip = "0x891c04639a5edcae088e546fa125b5d7fb6a2b9d"
|
||||
eth_flip = "0x32D496Ad866D110060866B7125981C73642cc509"
|
||||
mcd_flop = "0x6191C9b0086c2eBF92300cC507009b53996FbFFa"
|
||||
pep = "0xB1997239Cfc3d15578A3a09730f7f84A90BB4975"
|
||||
pip = "0x9FfFE440258B79c5d6604001674A4722FfC0f7Bc"
|
||||
pit = "0xe7cf3198787c9a4daac73371a38f29aaeeced87e"
|
||||
rep = "0xf88bbdc1e2718f8857f30a180076ec38d53cf296"
|
||||
vat = "0xcd726790550afcd77e9a7a47e86a3f9010af126b"
|
||||
ipcPath = "https://mainnet.infura.io/J5Vd2fRtGsw0zZ0Ov3BL"
|
@ -4,16 +4,4 @@ hostname = "localhost"
|
||||
port = 5432
|
||||
|
||||
[client]
|
||||
ipcPath = "http://127.0.0.1:7545"
|
||||
|
||||
[contract]
|
||||
cat = "0x2f34f22a00ee4b7a8f8bbc4eaee1658774c624e0"
|
||||
drip = "0x891c04639a5edcae088e546fa125b5d7fb6a2b9d"
|
||||
eth_flip = "0x32D496Ad866D110060866B7125981C73642cc509"
|
||||
mcd_flop = "0x6191C9b0086c2eBF92300cC507009b53996FbFFa"
|
||||
pep = "0xB1997239Cfc3d15578A3a09730f7f84A90BB4975"
|
||||
pip = "0x9FfFE440258B79c5d6604001674A4722FfC0f7Bc"
|
||||
pit = "0xe7cf3198787c9a4daac73371a38f29aaeeced87e"
|
||||
rep = "0xf88bbdc1e2718f8857f30a180076ec38d53cf296"
|
||||
vat = "0xcd726790550afcd77e9a7a47e86a3f9010af126b"
|
||||
vow = "0x76189df410263ad1d9fe2f4af2eab3d24f1b6f41"
|
||||
ipcPath = "http://127.0.0.1:7545"
|
@ -1,23 +0,0 @@
|
||||
[database]
|
||||
name = "vulcanize_public"
|
||||
hostname = "localhost"
|
||||
user = "vulcanize"
|
||||
password = "vulcanize"
|
||||
port = 5432
|
||||
|
||||
[client]
|
||||
ipcPath = "https://kovan.infura.io/J5Vd2fRtGsw0zZ0Ov3BL"
|
||||
|
||||
[datadog]
|
||||
name = "maker_vdb_prod"
|
||||
|
||||
[contract]
|
||||
cat = "0x2f34f22a00ee4b7a8f8bbc4eaee1658774c624e0"
|
||||
drip = "0x891c04639a5edcae088e546fa125b5d7fb6a2b9d"
|
||||
eth_flip = "0x32D496Ad866D110060866B7125981C73642cc509"
|
||||
mcd_flop = "0x6191C9b0086c2eBF92300cC507009b53996FbFFa"
|
||||
pep = "0xB1997239Cfc3d15578A3a09730f7f84A90BB4975"
|
||||
pip = "0x9FfFE440258B79c5d6604001674A4722FfC0f7Bc"
|
||||
pit = "0xe7cf3198787c9a4daac73371a38f29aaeeced87e"
|
||||
rep = "0xf88bbdc1e2718f8857f30a180076ec38d53cf296"
|
||||
vat = "0xcd726790550afcd77e9a7a47e86a3f9010af126b"
|
@ -5,16 +5,4 @@ port = 5432
|
||||
|
||||
[client]
|
||||
ipcPath = <local node's IPC filepath>
|
||||
levelDbPath = <local node's LevelDB chaindata filepath>
|
||||
|
||||
[contract]
|
||||
cat = "0x2f34f22a00ee4b7a8f8bbc4eaee1658774c624e0"
|
||||
drip = "0x891c04639a5edcae088e546fa125b5d7fb6a2b9d"
|
||||
eth_flip = "0x32D496Ad866D110060866B7125981C73642cc509"
|
||||
mcd_flap = "0x8868BAd8e74FcA4505676D1B5B21EcC23328d132"
|
||||
mcd_flop = "0x6191C9b0086c2eBF92300cC507009b53996FbFFa"
|
||||
pep = "0xB1997239Cfc3d15578A3a09730f7f84A90BB4975"
|
||||
pip = "0x9FfFE440258B79c5d6604001674A4722FfC0f7Bc"
|
||||
pit = "0xe7cf3198787c9a4daac73371a38f29aaeeced87e"
|
||||
rep = "0xf88bBDc1E2718F8857F30A180076ec38d53cf296"
|
||||
vat = "0xcd726790550afcd77e9a7a47e86a3f9010af126b"
|
||||
levelDbPath = <local node's LevelDB chaindata filepath>
|
@ -1,52 +0,0 @@
|
||||
[database]
|
||||
name = "vulcanize_public"
|
||||
hostname = "localhost"
|
||||
user = "vulcanize"
|
||||
password = "vulcanize"
|
||||
port = 5432
|
||||
|
||||
[client]
|
||||
ipcPath = "http://kovan0.vulcanize.io:8545"
|
||||
|
||||
[datadog]
|
||||
name = "maker_vdb_staging"
|
||||
|
||||
[filesystem]
|
||||
storageDiffsPath = "INSERT-PATH-TO-STORAGE-DIFFS"
|
||||
|
||||
[contract]
|
||||
[contract.address]
|
||||
cat = "0x2f34f22a00ee4b7a8f8bbc4eaee1658774c624e0"
|
||||
drip = "0x891c04639a5edcae088e546fa125b5d7fb6a2b9d"
|
||||
eth_flip = "0x32D496Ad866D110060866B7125981C73642cc509"
|
||||
mcd_flap = "0x8868BAd8e74FcA4505676D1B5B21EcC23328d132"
|
||||
mcd_flop = "0x6191C9b0086c2eBF92300cC507009b53996FbFFa"
|
||||
pep = "0xB1997239Cfc3d15578A3a09730f7f84A90BB4975"
|
||||
pip = "0x9FfFE440258B79c5d6604001674A4722FfC0f7Bc"
|
||||
pit = "0xe7cf3198787c9a4daac73371a38f29aaeeced87e"
|
||||
rep = "0xf88bbdc1e2718f8857f30a180076ec38d53cf296"
|
||||
vat = "0xcd726790550afcd77e9a7a47e86a3f9010af126b"
|
||||
vow = "0x3728e9777B2a0a611ee0F89e00E01044ce4736d1"
|
||||
[contract.abi]
|
||||
cat = '[{"constant":true,"inputs":[],"name":"vat","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function","signature":"0x36569e77"},{"constant":true,"inputs":[],"name":"vow","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function","signature":"0x626cb3c5"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"flips","outputs":[{"name":"ilk","type":"bytes32"},{"name":"urn","type":"bytes32"},{"name":"ink","type":"uint256"},{"name":"tab","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function","signature":"0x70d9235a"},{"constant":true,"inputs":[],"name":"nflip","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function","signature":"0x76181a51"},{"constant":true,"inputs":[],"name":"live","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function","signature":"0x957aa58c"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"wards","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function","signature":"0xbf353dbb"},{"constant":true,"inputs":[{"name":"","type":"bytes32"}],"name":"ilks","outputs":[{"name":"flip","type":"address"},{"name":"chop","type":"uint256"},{"name":"lump","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function","signature":"0xd9638d36"},{"constant":true,"inputs":[],"name":"pit","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function","signature":"0xf03c7c6e"},{"inputs":[{"name":"vat_","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor","signature":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"name":"ilk","type":"bytes32"},{"indexed":true,"name":"urn","type":"bytes32"},{"indexed":false,"name":"ink","type":"uint256"},{"indexed":false,"name":"art","type":"uint256"},{"indexed":false,"name":"tab","type":"uint256"},{"indexed":false,"name":"flip","type":"uint256"},{"indexed":false,"name":"iArt","type":"uint256"}],"name":"Bite","type":"event","signature":"0x99b5620489b6ef926d4518936cfec15d305452712b88bd59da2d9c10fb0953e8"},{"anonymous":true,"inputs":[{"indexed":true,"name":"sig","type":"bytes4"},{"indexed":true,"name":"guy","type":"address"},{"indexed":true,"name":"foo","type":"bytes32"},{"indexed":true,"name":"bar","type":"bytes32"},{"indexed":false,"name":"wad","type":"uint256"},{"indexed":false,"name":"fax","type":"bytes"}],"name":"LogNote","type":"event","signature":"0x644843f351d3fba4abcd60109eaff9f54bac8fb8ccf0bab941009c21df21cf31"},{"constant":false,"inputs":[{"name":"guy","type":"address"}],"name":"rely","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x65fae35e"},{"constant":false,"inputs":[{"name":"guy","type":"address"}],"name":"deny","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x9c52a7f1"},{"constant":false,"inputs":[{"name":"ilk","type":"bytes32"},{"name":"what","type":"bytes32"},{"name":"data","type":"uint256"}],"name":"file","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x1a0b287e"},{"constant":false,"inputs":[{"name":"what","type":"bytes32"},{"name":"data","type":"address"}],"name":"file","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0xd4e8be83"},{"constant":false,"inputs":[{"name":"ilk","type":"bytes32"},{"name":"what","type":"bytes32"},{"name":"flip","type":"address"}],"name":"file","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0xebecb39d"},{"constant":false,"inputs":[{"name":"ilk","type":"bytes32"},{"name":"urn","type":"bytes32"}],"name":"bite","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x72f7b593"},{"constant":false,"inputs":[{"name":"n","type":"uint256"},{"name":"wad","type":"uint256"}],"name":"flip","outputs":[{"name":"id","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0xe6f95917"}]'
|
||||
drip = '[{"constant":true,"inputs":[],"name":"vat","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function","signature":"0x36569e77"},{"constant":true,"inputs":[],"name":"repo","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function","signature":"0x56ff3122"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"wards","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function","signature":"0xbf353dbb"},{"constant":true,"inputs":[{"name":"","type":"bytes32"}],"name":"ilks","outputs":[{"name":"vow","type":"bytes32"},{"name":"tax","type":"uint256"},{"name":"rho","type":"uint48"}],"payable":false,"stateMutability":"view","type":"function","signature":"0xd9638d36"},{"inputs":[{"name":"vat_","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor","signature":"constructor"},{"anonymous":true,"inputs":[{"indexed":true,"name":"sig","type":"bytes4"},{"indexed":true,"name":"guy","type":"address"},{"indexed":true,"name":"foo","type":"bytes32"},{"indexed":true,"name":"bar","type":"bytes32"},{"indexed":false,"name":"wad","type":"uint256"},{"indexed":false,"name":"fax","type":"bytes"}],"name":"LogNote","type":"event","signature":"0x644843f351d3fba4abcd60109eaff9f54bac8fb8ccf0bab941009c21df21cf31"},{"constant":false,"inputs":[{"name":"guy","type":"address"}],"name":"rely","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x65fae35e"},{"constant":false,"inputs":[{"name":"guy","type":"address"}],"name":"deny","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x9c52a7f1"},{"constant":true,"inputs":[],"name":"era","outputs":[{"name":"","type":"uint48"}],"payable":false,"stateMutability":"view","type":"function","signature":"0x143e55e0"},{"constant":false,"inputs":[{"name":"ilk","type":"bytes32"},{"name":"vow","type":"bytes32"},{"name":"tax","type":"uint256"}],"name":"file","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x1a0b287e"},{"constant":false,"inputs":[{"name":"what","type":"bytes32"},{"name":"data","type":"uint256"}],"name":"file","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x29ae8114"},{"constant":false,"inputs":[{"name":"ilk","type":"bytes32"}],"name":"drip","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x44e2a5a8"}]'
|
||||
mcd_flap = '[{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"bids","outputs":[{"name":"bid","type":"uint256"},{"name":"lot","type":"uint256"},{"name":"guy","type":"address"},{"name":"tic","type":"uint48"},{"name":"end","type":"uint48"},{"name":"gal","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"ttl","outputs":[{"name":"","type":"uint48"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"gem","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"beg","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"tau","outputs":[{"name":"","type":"uint48"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"kicks","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"dai","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[{"name":"dai_","type":"address"},{"name":"gem_","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"name":"id","type":"uint256"},{"indexed":false,"name":"lot","type":"uint256"},{"indexed":false,"name":"bid","type":"uint256"},{"indexed":false,"name":"gal","type":"address"},{"indexed":false,"name":"end","type":"uint48"}],"name":"Kick","type":"event"},{"anonymous":true,"inputs":[{"indexed":true,"name":"sig","type":"bytes4"},{"indexed":true,"name":"guy","type":"address"},{"indexed":true,"name":"foo","type":"bytes32"},{"indexed":true,"name":"bar","type":"bytes32"},{"indexed":false,"name":"wad","type":"uint256"},{"indexed":false,"name":"fax","type":"bytes"}],"name":"LogNote","type":"event"},{"constant":false,"inputs":[{"name":"gal","type":"address"},{"name":"lot","type":"uint256"},{"name":"bid","type":"uint256"}],"name":"kick","outputs":[{"name":"id","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"id","type":"uint256"},{"name":"lot","type":"uint256"},{"name":"bid","type":"uint256"}],"name":"tend","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"id","type":"uint256"}],"name":"deal","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"}]'
|
||||
eth_flip = '[{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"bids","outputs":[{"name":"bid","type":"uint256"},{"name":"lot","type":"uint256"},{"name":"guy","type":"address"},{"name":"tic","type":"uint48"},{"name":"end","type":"uint48"},{"name":"urn","type":"bytes32"},{"name":"gal","type":"address"},{"name":"tab","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function","signature":"0x4423c5f1"},{"constant":true,"inputs":[],"name":"ttl","outputs":[{"name":"","type":"uint48"}],"payable":false,"stateMutability":"view","type":"function","signature":"0x4e8b1dd5"},{"constant":true,"inputs":[],"name":"gem","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function","signature":"0x7bd2bea7"},{"constant":true,"inputs":[],"name":"beg","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function","signature":"0x7d780d82"},{"constant":true,"inputs":[],"name":"tau","outputs":[{"name":"","type":"uint48"}],"payable":false,"stateMutability":"view","type":"function","signature":"0xcfc4af55"},{"constant":true,"inputs":[],"name":"kicks","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function","signature":"0xcfdd3302"},{"constant":true,"inputs":[],"name":"dai","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function","signature":"0xf4b9fa75"},{"inputs":[{"name":"dai_","type":"address"},{"name":"gem_","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor","signature":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"name":"id","type":"uint256"},{"indexed":false,"name":"lot","type":"uint256"},{"indexed":false,"name":"bid","type":"uint256"},{"indexed":false,"name":"gal","type":"address"},{"indexed":false,"name":"end","type":"uint48"},{"indexed":true,"name":"urn","type":"bytes32"},{"indexed":false,"name":"tab","type":"uint256"}],"name":"Kick","type":"event","signature":"0xbac86238bdba81d21995024470425ecb370078fa62b7271b90cf28cbd1e3e87e"},{"anonymous":true,"inputs":[{"indexed":true,"name":"sig","type":"bytes4"},{"indexed":true,"name":"guy","type":"address"},{"indexed":true,"name":"foo","type":"bytes32"},{"indexed":true,"name":"bar","type":"bytes32"},{"indexed":false,"name":"wad","type":"uint256"},{"indexed":false,"name":"fax","type":"bytes"}],"name":"LogNote","type":"event","signature":"0x644843f351d3fba4abcd60109eaff9f54bac8fb8ccf0bab941009c21df21cf31"},{"constant":true,"inputs":[],"name":"era","outputs":[{"name":"","type":"uint48"}],"payable":false,"stateMutability":"view","type":"function","signature":"0x143e55e0"},{"constant":false,"inputs":[{"name":"urn","type":"bytes32"},{"name":"gal","type":"address"},{"name":"tab","type":"uint256"},{"name":"lot","type":"uint256"},{"name":"bid","type":"uint256"}],"name":"kick","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0xeae19d9e"},{"constant":false,"inputs":[{"name":"id","type":"uint256"}],"name":"tick","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0xfc7b6aee"},{"constant":false,"inputs":[{"name":"id","type":"uint256"},{"name":"lot","type":"uint256"},{"name":"bid","type":"uint256"}],"name":"tend","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x4b43ed12"},{"constant":false,"inputs":[{"name":"id","type":"uint256"},{"name":"lot","type":"uint256"},{"name":"bid","type":"uint256"}],"name":"dent","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x5ff3a382"},{"constant":false,"inputs":[{"name":"id","type":"uint256"}],"name":"deal","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0xc959c42b"}]'
|
||||
mcd_flop = '[{"constant":true,"inputs":[],"name":"era","outputs":[{"name":"","type":"uint48"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"bids","outputs":[{"name":"bid","type":"uint256"},{"name":"lot","type":"uint256"},{"name":"guy","type":"address"},{"name":"tic","type":"uint48"},{"name":"end","type":"uint48"},{"name":"vow","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"ttl","outputs":[{"name":"","type":"uint48"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"id","type":"uint256"},{"name":"lot","type":"uint256"},{"name":"bid","type":"uint256"}],"name":"dent","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"guy","type":"address"}],"name":"rely","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"gem","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"beg","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"guy","type":"address"}],"name":"deny","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"gal","type":"address"},{"name":"lot","type":"uint256"},{"name":"bid","type":"uint256"}],"name":"kick","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"wards","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"id","type":"uint256"}],"name":"deal","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"tau","outputs":[{"name":"","type":"uint48"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"kicks","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"dai","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[{"name":"dai_","type":"address"},{"name":"gem_","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"name":"id","type":"uint256"},{"indexed":false,"name":"lot","type":"uint256"},{"indexed":false,"name":"bid","type":"uint256"},{"indexed":false,"name":"gal","type":"address"},{"indexed":false,"name":"end","type":"uint48"}],"name":"Kick","type":"event"},{"anonymous":true,"inputs":[{"indexed":true,"name":"sig","type":"bytes4"},{"indexed":true,"name":"guy","type":"address"},{"indexed":true,"name":"foo","type":"bytes32"},{"indexed":true,"name":"bar","type":"bytes32"},{"indexed":false,"name":"wad","type":"uint256"},{"indexed":false,"name":"fax","type":"bytes"}],"name":"LogNote","type":"event"}]'
|
||||
medianizer = '[{"constant":false,"inputs":[{"name":"owner_","type":"address"}],"name":"setOwner","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"","type":"bytes32"}],"name":"poke","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"poke","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"compute","outputs":[{"name":"","type":"bytes32"},{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"wat","type":"address"}],"name":"set","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"wat","type":"address"}],"name":"unset","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"indexes","outputs":[{"name":"","type":"bytes12"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"next","outputs":[{"name":"","type":"bytes12"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"read","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"peek","outputs":[{"name":"","type":"bytes32"},{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"bytes12"}],"name":"values","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"min_","type":"uint96"}],"name":"setMin","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"authority_","type":"address"}],"name":"setAuthority","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"void","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"pos","type":"bytes12"},{"name":"wat","type":"address"}],"name":"set","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"authority","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"pos","type":"bytes12"}],"name":"unset","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"next_","type":"bytes12"}],"name":"setNext","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"min","outputs":[{"name":"","type":"uint96"}],"payable":false,"stateMutability":"view","type":"function"},{"anonymous":false,"inputs":[{"indexed":false,"name":"val","type":"bytes32"}],"name":"LogValue","type":"event"},{"anonymous":true,"inputs":[{"indexed":true,"name":"sig","type":"bytes4"},{"indexed":true,"name":"guy","type":"address"},{"indexed":true,"name":"foo","type":"bytes32"},{"indexed":true,"name":"bar","type":"bytes32"},{"indexed":false,"name":"wad","type":"uint256"},{"indexed":false,"name":"fax","type":"bytes"}],"name":"LogNote","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"authority","type":"address"}],"name":"LogSetAuthority","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"owner","type":"address"}],"name":"LogSetOwner","type":"event"}]]'
|
||||
# TODO: replace with updated ABI when contract is deployed (with no pit file stability fee method + modified Frob event)
|
||||
pit = '[{"constant":true,"inputs":[],"name":"vat","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function","signature":"0x36569e77"},{"constant":true,"inputs":[],"name":"live","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function","signature":"0x957aa58c"},{"constant":true,"inputs":[],"name":"drip","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function","signature":"0x9f678cca"},{"constant":true,"inputs":[],"name":"Line","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function","signature":"0xbabe8a3f"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"wards","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function","signature":"0xbf353dbb"},{"constant":true,"inputs":[{"name":"","type":"bytes32"}],"name":"ilks","outputs":[{"name":"spot","type":"uint256"},{"name":"line","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function","signature":"0xd9638d36"},{"inputs":[{"name":"vat_","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor","signature":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"name":"ilk","type":"bytes32"},{"indexed":true,"name":"urn","type":"bytes32"},{"indexed":false,"name":"ink","type":"uint256"},{"indexed":false,"name":"art","type":"uint256"},{"indexed":false,"name":"dink","type":"int256"},{"indexed":false,"name":"dart","type":"int256"},{"indexed":false,"name":"iArt","type":"uint256"}],"name":"Frob","type":"event","signature":"0xb2afa28318bcc689926b52835d844de174ef8de97e982a85c0199d584920791b"},{"anonymous":true,"inputs":[{"indexed":true,"name":"sig","type":"bytes4"},{"indexed":true,"name":"guy","type":"address"},{"indexed":true,"name":"foo","type":"bytes32"},{"indexed":true,"name":"bar","type":"bytes32"},{"indexed":false,"name":"wad","type":"uint256"},{"indexed":false,"name":"fax","type":"bytes"}],"name":"LogNote","type":"event","signature":"0x644843f351d3fba4abcd60109eaff9f54bac8fb8ccf0bab941009c21df21cf31"},{"constant":false,"inputs":[{"name":"guy","type":"address"}],"name":"rely","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x65fae35e"},{"constant":false,"inputs":[{"name":"guy","type":"address"}],"name":"deny","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x9c52a7f1"},{"constant":false,"inputs":[{"name":"ilk","type":"bytes32"},{"name":"what","type":"bytes32"},{"name":"data","type":"uint256"}],"name":"file","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x1a0b287e"},{"constant":false,"inputs":[{"name":"what","type":"bytes32"},{"name":"data","type":"uint256"}],"name":"file","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x29ae8114"},{"constant":false,"inputs":[{"name":"what","type":"bytes32"},{"name":"data","type":"address"}],"name":"file","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0xd4e8be83"},{"constant":false,"inputs":[{"name":"ilk","type":"bytes32"},{"name":"dink","type":"int256"},{"name":"dart","type":"int256"}],"name":"frob","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x5a984ded"}]'
|
||||
vat = '[{"constant":true,"inputs":[],"name":"debt","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function","signature":"0x0dca59c1"},{"constant":true,"inputs":[{"name":"","type":"bytes32"},{"name":"","type":"bytes32"}],"name":"urns","outputs":[{"name":"ink","type":"uint256"},{"name":"art","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function","signature":"0x26e27482"},{"constant":true,"inputs":[],"name":"vice","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function","signature":"0x2d61a355"},{"constant":true,"inputs":[{"name":"","type":"bytes32"}],"name":"sin","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function","signature":"0xa60f1d3e"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"wards","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function","signature":"0xbf353dbb"},{"constant":true,"inputs":[{"name":"","type":"bytes32"},{"name":"","type":"bytes32"}],"name":"gem","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function","signature":"0xc0912683"},{"constant":true,"inputs":[{"name":"","type":"bytes32"}],"name":"ilks","outputs":[{"name":"take","type":"uint256"},{"name":"rate","type":"uint256"},{"name":"Ink","type":"uint256"},{"name":"Art","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function","signature":"0xd9638d36"},{"constant":true,"inputs":[{"name":"","type":"bytes32"}],"name":"dai","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function","signature":"0xf53e4e69"},{"inputs":[],"payable":false,"stateMutability":"nonpayable","type":"constructor","signature":"constructor"},{"anonymous":true,"inputs":[{"indexed":true,"name":"sig","type":"bytes4"},{"indexed":true,"name":"foo","type":"bytes32"},{"indexed":true,"name":"bar","type":"bytes32"},{"indexed":true,"name":"too","type":"bytes32"},{"indexed":false,"name":"fax","type":"bytes"}],"name":"Note","type":"event","signature":"0x8c2dbbc2b33ffaa77c104b777e574a8a4ff79829dfee8b66f4dc63e3f8067152"},{"constant":false,"inputs":[{"name":"guy","type":"address"}],"name":"rely","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x65fae35e"},{"constant":false,"inputs":[{"name":"guy","type":"address"}],"name":"deny","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x9c52a7f1"},{"constant":false,"inputs":[{"name":"ilk","type":"bytes32"}],"name":"init","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x3b663195"},{"constant":false,"inputs":[{"name":"ilk","type":"bytes32"},{"name":"guy","type":"bytes32"},{"name":"rad","type":"int256"}],"name":"slip","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x42066cbb"},{"constant":false,"inputs":[{"name":"ilk","type":"bytes32"},{"name":"src","type":"bytes32"},{"name":"dst","type":"bytes32"},{"name":"rad","type":"int256"}],"name":"flux","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0xa6e41821"},{"constant":false,"inputs":[{"name":"src","type":"bytes32"},{"name":"dst","type":"bytes32"},{"name":"rad","type":"int256"}],"name":"move","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x78f19470"},{"constant":false,"inputs":[{"name":"i","type":"bytes32"},{"name":"u","type":"bytes32"},{"name":"v","type":"bytes32"},{"name":"w","type":"bytes32"},{"name":"dink","type":"int256"},{"name":"dart","type":"int256"}],"name":"tune","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x5dd6471a"},{"constant":false,"inputs":[{"name":"i","type":"bytes32"},{"name":"u","type":"bytes32"},{"name":"v","type":"bytes32"},{"name":"w","type":"bytes32"},{"name":"dink","type":"int256"},{"name":"dart","type":"int256"}],"name":"grab","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x3690ae4c"},{"constant":false,"inputs":[{"name":"u","type":"bytes32"},{"name":"v","type":"bytes32"},{"name":"rad","type":"int256"}],"name":"heal","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x990a5f63"},{"constant":false,"inputs":[{"name":"i","type":"bytes32"},{"name":"u","type":"bytes32"},{"name":"rate","type":"int256"}],"name":"fold","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0xe6a6a64d"},{"constant":false,"inputs":[{"name":"i","type":"bytes32"},{"name":"u","type":"bytes32"},{"name":"take","type":"int256"}],"name":"toll","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x09b7a0b5"}]'
|
||||
vow = '[{"constant":true,"inputs":[],"name":"Awe","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"Joy","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"flap","outputs":[{"name":"id","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"hump","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"wad","type":"uint256"}],"name":"kiss","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"what","type":"bytes32"},{"name":"data","type":"uint256"}],"name":"file","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"Ash","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"era","type":"uint48"}],"name":"flog","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"vat","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"Woe","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"wait","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"guy","type":"address"}],"name":"rely","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"bump","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"tab","type":"uint256"}],"name":"fess","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"row","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint48"}],"name":"sin","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"guy","type":"address"}],"name":"deny","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"flop","outputs":[{"name":"id","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"wards","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"sump","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"Sin","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"what","type":"bytes32"},{"name":"addr","type":"address"}],"name":"file","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"cow","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"wad","type":"uint256"}],"name":"heal","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"inputs":[],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":true,"inputs":[{"indexed":true,"name":"sig","type":"bytes4"},{"indexed":true,"name":"guy","type":"address"},{"indexed":true,"name":"foo","type":"bytes32"},{"indexed":true,"name":"bar","type":"bytes32"},{"indexed":false,"name":"wad","type":"uint256"},{"indexed":false,"name":"fax","type":"bytes"}],"name":"LogNote","type":"event"}]'
|
||||
[contract.deployment-block]
|
||||
cat = 8751794
|
||||
drip = 8762197
|
||||
eth_flip = 8535561
|
||||
mcd_flap = 8535544
|
||||
mcd_flop = 8535545
|
||||
pep = 8760655
|
||||
pip = 8760588
|
||||
pit = 8535538
|
||||
rep = 8760681
|
||||
vat = 8535536
|
||||
vow = 8751792
|
@ -14,20 +14,20 @@
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
package flip_test
|
||||
package chunker_test
|
||||
|
||||
import (
|
||||
log "github.com/sirupsen/logrus"
|
||||
"io/ioutil"
|
||||
"testing"
|
||||
|
||||
. "github.com/onsi/ginkgo"
|
||||
. "github.com/onsi/gomega"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"io/ioutil"
|
||||
)
|
||||
|
||||
func TestFlip(t *testing.T) {
|
||||
func TestFactories(t *testing.T) {
|
||||
RegisterFailHandler(Fail)
|
||||
RunSpecs(t, "Flip Suite")
|
||||
RunSpecs(t, "Shared Chunker Suite")
|
||||
}
|
||||
|
||||
var _ = BeforeSuite(func() {
|
@ -14,16 +14,19 @@
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
package shared
|
||||
package chunker
|
||||
|
||||
import (
|
||||
"strings"
|
||||
|
||||
"github.com/ethereum/go-ethereum/common"
|
||||
"github.com/ethereum/go-ethereum/core/types"
|
||||
"strings"
|
||||
|
||||
shared_t "github.com/vulcanize/vulcanizedb/libraries/shared/transformer"
|
||||
)
|
||||
|
||||
type Chunker interface {
|
||||
AddConfigs(transformerConfigs []TransformerConfig)
|
||||
AddConfigs(transformerConfigs []shared_t.TransformerConfig)
|
||||
ChunkLogs(logs []types.Log) map[string][]types.Log
|
||||
}
|
||||
|
||||
@ -42,7 +45,7 @@ func NewLogChunker() *LogChunker {
|
||||
}
|
||||
|
||||
// Configures the chunker by adding more addreses and topics to consider.
|
||||
func (chunker *LogChunker) AddConfigs(transformerConfigs []TransformerConfig) {
|
||||
func (chunker *LogChunker) AddConfigs(transformerConfigs []shared_t.TransformerConfig) {
|
||||
for _, config := range transformerConfigs {
|
||||
for _, address := range config.ContractAddresses {
|
||||
var lowerCaseAddress = strings.ToLower(address)
|
@ -14,42 +14,44 @@
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
package shared_test
|
||||
package chunker_test
|
||||
|
||||
import (
|
||||
"github.com/ethereum/go-ethereum/common"
|
||||
"github.com/ethereum/go-ethereum/core/types"
|
||||
. "github.com/onsi/ginkgo"
|
||||
. "github.com/onsi/gomega"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared"
|
||||
|
||||
chunk "github.com/vulcanize/vulcanizedb/libraries/shared/chunker"
|
||||
shared_t "github.com/vulcanize/vulcanizedb/libraries/shared/transformer"
|
||||
)
|
||||
|
||||
var _ = Describe("Log chunker", func() {
|
||||
var (
|
||||
configs []shared.TransformerConfig
|
||||
chunker *shared.LogChunker
|
||||
configs []shared_t.TransformerConfig
|
||||
chunker *chunk.LogChunker
|
||||
)
|
||||
|
||||
BeforeEach(func() {
|
||||
configA := shared.TransformerConfig{
|
||||
configA := shared_t.TransformerConfig{
|
||||
TransformerName: "TransformerA",
|
||||
ContractAddresses: []string{"0x00000000000000000000000000000000000000A1", "0x00000000000000000000000000000000000000A2"},
|
||||
Topic: "0xA",
|
||||
}
|
||||
configB := shared.TransformerConfig{
|
||||
configB := shared_t.TransformerConfig{
|
||||
TransformerName: "TransformerB",
|
||||
ContractAddresses: []string{"0x00000000000000000000000000000000000000B1"},
|
||||
Topic: "0xB",
|
||||
}
|
||||
|
||||
configC := shared.TransformerConfig{
|
||||
configC := shared_t.TransformerConfig{
|
||||
TransformerName: "TransformerC",
|
||||
ContractAddresses: []string{"0x00000000000000000000000000000000000000A2"},
|
||||
Topic: "0xC",
|
||||
}
|
||||
|
||||
configs = []shared.TransformerConfig{configA, configB, configC}
|
||||
chunker = shared.NewLogChunker()
|
||||
configs = []shared_t.TransformerConfig{configA, configB, configC}
|
||||
chunker = chunk.NewLogChunker()
|
||||
chunker.AddConfigs(configs)
|
||||
})
|
||||
|
||||
@ -71,24 +73,24 @@ var _ = Describe("Log chunker", func() {
|
||||
|
||||
Describe("AddConfigs", func() {
|
||||
It("can add more configs later", func() {
|
||||
configD := shared.TransformerConfig{
|
||||
configD := shared_t.TransformerConfig{
|
||||
TransformerName: "TransformerD",
|
||||
ContractAddresses: []string{"0x000000000000000000000000000000000000000D"},
|
||||
Topic: "0xD",
|
||||
}
|
||||
chunker.AddConfigs([]shared.TransformerConfig{configD})
|
||||
chunker.AddConfigs([]shared_t.TransformerConfig{configD})
|
||||
|
||||
Expect(chunker.AddressToNames).To(ContainElement([]string{"TransformerD"}))
|
||||
Expect(chunker.NameToTopic0).To(ContainElement(common.HexToHash("0xD")))
|
||||
})
|
||||
|
||||
It("lower cases address", func() {
|
||||
configD := shared.TransformerConfig{
|
||||
configD := shared_t.TransformerConfig{
|
||||
TransformerName: "TransformerD",
|
||||
ContractAddresses: []string{"0x000000000000000000000000000000000000000D"},
|
||||
Topic: "0xD",
|
||||
}
|
||||
chunker.AddConfigs([]shared.TransformerConfig{configD})
|
||||
chunker.AddConfigs([]shared_t.TransformerConfig{configD})
|
||||
|
||||
Expect(chunker.AddressToNames["0x000000000000000000000000000000000000000d"]).To(Equal([]string{"TransformerD"}))
|
||||
})
|
@ -14,15 +14,12 @@
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
package price_feeds
|
||||
package constants
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"math/big"
|
||||
)
|
||||
type TransformerExecution bool
|
||||
|
||||
var (
|
||||
ErrNoMatchingLog = errors.New("no matching log")
|
||||
Ether = big.NewFloat(1e18)
|
||||
Ray = big.NewFloat(1e27)
|
||||
const (
|
||||
HeaderRecheck TransformerExecution = true
|
||||
HeaderMissing TransformerExecution = false
|
||||
RecheckHeaderCap = "4"
|
||||
)
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user