2017-11-09 19:59:12 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"flag"
|
|
|
|
|
|
|
|
"github.com/8thlight/vulcanizedb/cmd"
|
2017-12-04 22:54:35 +00:00
|
|
|
"github.com/8thlight/vulcanizedb/pkg/core"
|
2017-11-09 19:59:12 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
environment := flag.String("environment", "", "Environment name")
|
|
|
|
contractHash := flag.String("contract-hash", "", "contract-hash=x1234")
|
2017-12-04 21:12:27 +00:00
|
|
|
abiFilepath := flag.String("abi-filepath", "", "path/to/abifile.json")
|
2017-11-09 19:59:12 +00:00
|
|
|
flag.Parse()
|
|
|
|
config := cmd.LoadConfig(*environment)
|
2017-12-04 15:53:36 +00:00
|
|
|
repository := cmd.LoadPostgres(config.Database)
|
2017-12-04 22:54:35 +00:00
|
|
|
watchedContract := core.Contract{
|
2017-12-04 21:12:27 +00:00
|
|
|
Abi: cmd.ReadAbiFile(*abiFilepath),
|
|
|
|
Hash: *contractHash,
|
|
|
|
}
|
2017-12-04 22:54:35 +00:00
|
|
|
repository.CreateContract(watchedContract)
|
2017-11-09 19:59:12 +00:00
|
|
|
}
|