Kevin Cotugno
f4fa7f24b3
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
47 lines
858 B
Go
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
|
|
}
|