This repository has been archived on 2022-11-30. You can view files and clone it, but cannot push or open issues or pull requests.
tacitus/cmd/watcher/main.go
Kevin Cotugno f4fa7f24b3 watcher: inital validator
This begin this code for the validator. Currently this just build an
array of the starting and ending missing trades.

TODO: Download the missing trades
2017-09-27 23:23:34 -07:00

47 lines
858 B
Go

package main
import (
"github.com/kcotugno/tacitus/gdax"
"github.com/kcotugno/tacitus/gdax/websocket"
"github.com/kcotugno/tacitus/ops"
"github.com/kcotugno/tacitus/osutil"
"github.com/kcotugno/tacitus/postgres"
)
func main() {
logger := osutil.NewLogger()
db := postgres.NewClient()
db.Name = "gdax"
db.User = "gdax"
db.SetLogger(logger)
err := db.Open()
if err != nil {
logger.Info("Error openning database connection: %v", err)
return
}
ws := websocket.NewClient()
ls := &gdax.ListenerService{}
ls.Client = ws
ls.Logger = logger
r := ops.Registrar{}
r.Database = db
r.Listener = ls
r.SetLogger(logger)
if err := r.Record("ETH-USD", "BTC-USD"); err != nil {
logger.Info("Error: %v", err)
return
}
v := validator{}
v.db = db
v.logger = logger
v.validate("ETH-USD", "BTC-USD")
v.stop()
t := make(chan bool)
<-t
}