ipld-eth-server/cmd/subscribe_contract/main.go
2017-12-04 15:12:27 -06:00

23 lines
623 B
Go

package main
import (
"flag"
"github.com/8thlight/vulcanizedb/cmd"
"github.com/8thlight/vulcanizedb/pkg/repositories"
)
func main() {
environment := flag.String("environment", "", "Environment name")
contractHash := flag.String("contract-hash", "", "contract-hash=x1234")
abiFilepath := flag.String("abi-filepath", "", "path/to/abifile.json")
flag.Parse()
config := cmd.LoadConfig(*environment)
repository := cmd.LoadPostgres(config.Database)
watchedContract := repositories.WatchedContract{
Abi: cmd.ReadAbiFile(*abiFilepath),
Hash: *contractHash,
}
repository.CreateWatchedContract(watchedContract)
}