Handle events
- Adds interfaces for developers to build handlers that update data in response to log events - Resolves #29
This commit is contained in:
+2
-10
@@ -11,18 +11,10 @@ import (
|
||||
|
||||
"github.com/vulcanize/vulcanizedb/pkg/config"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/core"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/datastore/postgres"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/geth"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/repositories/postgres"
|
||||
)
|
||||
|
||||
func LoadConfig(environment string) config.Config {
|
||||
cfg, err := config.NewConfig(environment)
|
||||
if err != nil {
|
||||
log.Fatalf("Error loading config\n%v", err)
|
||||
}
|
||||
return cfg
|
||||
}
|
||||
|
||||
func LoadPostgres(database config.Database, node core.Node) postgres.DB {
|
||||
db, err := postgres.NewDB(database, node)
|
||||
if err != nil {
|
||||
@@ -53,7 +45,7 @@ func GetAbi(abiFilepath string, contractHash string, network string) string {
|
||||
if abiFilepath != "" {
|
||||
contractAbiString = ReadAbiFile(abiFilepath)
|
||||
} else {
|
||||
url := geth.GenUrl(network)
|
||||
url := geth.GenURL(network)
|
||||
etherscan := geth.NewEtherScanClient(url)
|
||||
log.Printf("No ABI supplied. Retrieving ABI from Etherscan: %s", url)
|
||||
contractAbiString, _ = etherscan.GetAbi(contractHash)
|
||||
|
||||
Reference in New Issue
Block a user