update readme and cmd usage comments

This commit is contained in:
Ian Norden
2019-03-13 11:42:29 -05:00
parent 84aa0a7eba
commit b3ce1ecd78
3 changed files with 23 additions and 5 deletions
+8 -4
View File
@@ -59,21 +59,25 @@ var composeCmd = &cobra.Command{
type = "eth_event"
repository = "github.com/account/repo"
migrations = "db/migrations"
rank = "0"
[exporter.transformer2]
path = "path/to/transformer2"
type = "eth_event"
repository = "github.com/account/repo"
migrations = "db/migrations"
rank = "2"
[exporter.transformer3]
path = "path/to/transformer3"
type = "eth_event"
repository = "github.com/account/repo"
migrations = "db/migrations"
rank = "0"
[exporter.transformer4]
path = "path/to/transformer4"
type = "eth_storage"
repository = "github.com/account2/repo2"
migrations = "to/db/migrations"
rank = "1"
Note: If any of the plugin transformer need additional
@@ -149,6 +153,10 @@ func prepConfig() {
if !mrOK || mr == "" {
log.Fatal(name, "transformer config is missing `rank` value")
}
rank, err := strconv.Atoi(mr)
if err != nil {
log.Fatal(name, "migration `rank` can't be converted to an integer")
}
t, tOK := transformer["type"]
if !tOK {
log.Fatal(name, "transformer config is missing `type` value")
@@ -157,10 +165,6 @@ func prepConfig() {
if transformerType == config.UnknownTransformerType {
log.Fatal(errors.New(`unknown transformer type in exporter config accepted types are "eth_event", "eth_storage"`))
}
rank, err := strconv.Atoi(mr)
if err != nil {
log.Fatal(name, "migration `rank` can't be converted to an integer")
}
transformers[name] = config.Transformer{
Path: p,