-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
69 lines (59 loc) · 2.34 KB
/
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
package main
import (
"flag"
"log"
"os"
"github.com/awesome-gocui/gocui"
"github.com/vele/chia-console/chia"
)
var (
certFile = flag.String("cert", "/root/.flax/mainnet/config/ssl/full_node/private_full_node.crt", "A PEM eoncoded certificate file.")
keyFile = flag.String("key", "/root/.flax/mainnet/config/ssl/full_node/private_full_node.key", "A PEM encoded private key file.")
walletCertFile = flag.String("walletCrt", "/root/.flax/mainnet/config/ssl/wallet/private_wallet.crt", "A PEM encoded private key file.")
walletKeyFile = flag.String("walletKey", "/root/.flax/mainnet/config/ssl/wallet/private_wallet.key", "A PEM encoded private key file.")
harvesterCertFile = flag.String("harvesterCrt", "/root/.flax/mainnet/config/ssl/harvester/private_harvester.crt", "A PEM encoded private key file.")
harvesterKeyFile = flag.String("harvesterKey", "/root/.flax/mainnet/config/ssl/harvester/private_harvester.key", "A PEM encoded private key file.")
caFile = flag.String("CA", "/root/.flax/mainnet/config/ssl/ca/chia_ca.crt", "A PEM eoncoded CA's certificate file.")
logFile = flag.String("LogFileDir", " /root/.flax/mainnet/log/debug.log", "The location of chia log files.")
)
func main() {
flag.Parse()
os.Setenv("CHIA_CA_CRT", *caFile)
os.Setenv("CHIA_FULL_NODE_CRT", *certFile)
os.Setenv("CHIA_FULL_NODE_KEY", *keyFile)
os.Setenv("CHIA_WALLET_CRT", *walletCertFile)
os.Setenv("CHIA_WALLET_KEY", *walletKeyFile)
os.Setenv("CHIA_HARVESTER_CRT", *harvesterCertFile)
os.Setenv("CHIA_HARVESTER_KEY", *harvesterKeyFile)
os.Setenv("CHIA_SERVER_URL", "https://127.0.0.1:6755")
os.Setenv("CHIA_WALLET_URL", "https://127.0.0.1:6883")
os.Setenv("CHIA_HARVESTER_URL", "https://127.0.0.1:6760")
os.Setenv("CHIA_LOGFILE", *logFile)
err := chia.CreateSqlSchema()
if err != nil {
log.Panicln(err)
}
err = chia.FetchChiaMap()
if err != nil {
log.Panicln(err)
}
g, err := gocui.NewGui(gocui.OutputNormal, false)
if err != nil {
log.Panicln(err)
}
defer g.Close()
g.Cursor = true
g.SetManagerFunc(firstRowGraph)
g.SupportOverlaps = false
wg.Add(1)
go drawEligablePlotsGraph(g)
go drawProcessingTimesGraph(g)
go drawFreeSpaceTable(g)
go updateChiaPriceDB()
if err := keybindings(g); err != nil {
log.Panicln(err)
}
if err := g.MainLoop(); err != nil && err != gocui.ErrQuit {
log.Panicln(err)
}
}