forked from cerc-io/ipld-eth-server
Refactor run main.go
This commit is contained in:
parent
84205a21ea
commit
a655470f18
@ -17,15 +17,15 @@ func main() {
|
|||||||
environment := flag.String("environment", "", "Environment name")
|
environment := flag.String("environment", "", "Environment name")
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
config := cmd.LoadConfig(*environment)
|
config := cmd.LoadConfig(*environment)
|
||||||
|
|
||||||
fmt.Println("Client Path ", config.Client.IPCPath)
|
fmt.Println("Client Path ", config.Client.IPCPath)
|
||||||
blockchain := geth.NewGethBlockchain(config.Client.IPCPath)
|
|
||||||
loggingObserver := observers.BlockchainLoggingObserver{}
|
|
||||||
repository := repositories.NewPostgres(config.Database)
|
repository := repositories.NewPostgres(config.Database)
|
||||||
dbObserver := observers.NewBlockchainDbObserver(repository)
|
listener := blockchain_listener.NewBlockchainListener(
|
||||||
listener := blockchain_listener.NewBlockchainListener(blockchain, []core.BlockchainObserver{
|
geth.NewGethBlockchain(config.Client.IPCPath),
|
||||||
loggingObserver,
|
[]core.BlockchainObserver{
|
||||||
dbObserver,
|
observers.BlockchainLoggingObserver{},
|
||||||
})
|
observers.NewBlockchainDbObserver(repository),
|
||||||
|
},
|
||||||
|
)
|
||||||
listener.Start()
|
listener.Start()
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user