Started moving to a chainDB for tracking history.

This commit is contained in:
James Wells 2021-12-02 05:44:53 -08:00
parent 749bd6557e
commit 458214aaa9
Signed by: jwells
GPG key ID: 73196D10B8E65666
6 changed files with 31 additions and 18 deletions

View file

@ -6,6 +6,7 @@ import (
http "net/http"
sync "sync"
gcdb "git.dragonheim.net/dragonheim/gagent/internal/chaindb"
gstructs "git.dragonheim.net/dragonheim/gagent/internal/gstructs"
prometheus "github.com/prometheus/client_golang/prometheus"
@ -18,6 +19,8 @@ var (
opsProcessed = promauto.NewCounter(prometheus.CounterOpts{
Name: "client_requests_recieved",
})
db gcdb.GagentDb
)
/*
@ -38,6 +41,8 @@ func Main(wg *sync.WaitGroup, config gstructs.GagentConfig) {
workerSock, _ := zmq.NewSocket(zmq.DEALER)
defer workerSock.Close()
db.Init()
workerListener := fmt.Sprintf("tcp://%s:%d", config.ListenAddr, config.WorkerPort)
_ = workerSock.Bind(workerListener)