refactor: refactored the chainDB and added write capability.

This commit is contained in:
James Wells 2023-03-22 17:37:11 -07:00
parent 1bcc682b7c
commit d5fcd11592
Signed by: jwells
GPG key ID: 73196D10B8E65666
2 changed files with 62 additions and 24 deletions

View file

@ -43,7 +43,12 @@ func Main(wg *sync.WaitGroup, config gstructs.GagentConfig) {
workerSock, _ := zmq.NewSocket(zmq.DEALER)
defer workerSock.Close()
db.Init()
chain := gcdb.NewGagentDb()
log.Println("[DEBUG] Loading chaindb ")
err := chain.LoadHCL()
if err != nil {
log.Printf("[ERROR] Error loading chaindb: %s", err)
}
workerListener := "tcp://" + config.ListenAddr + ":" + strconv.Itoa(config.WorkerPort)
_ = workerSock.Bind(workerListener)