-
Notifications
You must be signed in to change notification settings - Fork 9
/
main.go
42 lines (32 loc) · 716 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package main
import (
_ "embed"
"open-outcry/pkg/conf"
"open-outcry/pkg/db"
"open-outcry/pkg/models"
"open-outcry/pkg/rest"
"os"
log "github.com/sirupsen/logrus"
)
//go:embed fees.csv
var fees string
func main() {
envVarValue := os.Getenv("ENV")
if envVarValue == "" {
envVarValue = "DEV"
}
conf.LoadConfig(envVarValue)
log.SetOutput(os.Stdout)
db.SetupInstance()
if conf.Get().UpdateFees {
models.LoadFees(fees)
}
// Sample seed for debugging
//_, tradingAccount1 := services.Acc("test")
//services.ProcessTradeOrder(tradingAccount1, "BTC_EUR", "LIMIT", models.Sell, 10.00, 1, "GTC")
server := rest.NewServer()
err := server.ListenAndServe()
if err != nil {
log.Fatal(err)
}
}