Skip to content
Snippets Groups Projects
Commit aa004776 authored by Benjamin Wenger's avatar Benjamin Wenger
Browse files

fixed all loading

parent c60f7420
Branches
No related tags found
No related merge requests found
...@@ -2,7 +2,9 @@ package main ...@@ -2,7 +2,9 @@ package main
import ( import (
"gitlab.com/elixxir/client/api" "gitlab.com/elixxir/client/api"
"gitlab.com/elixxir/client/interfaces/contact"
"gitlab.com/elixxir/client/interfaces/params" "gitlab.com/elixxir/client/interfaces/params"
"gitlab.com/xx_network/primitives/utils"
"io/ioutil" "io/ioutil"
"gitlab.com/elixxir/client/single" "gitlab.com/elixxir/client/single"
"os" "os"
...@@ -101,3 +103,21 @@ func waitUntilConnected(connected chan bool) { ...@@ -101,3 +103,21 @@ func waitUntilConnected(connected chan bool) {
} }
}() }()
} }
func readBotContact() contact.Contact {
// Read from file
data, err := utils.ReadFile(botContactPath)
jww.INFO.Printf("Contact file size read in: %d bytes", len(data))
if err != nil {
jww.FATAL.Panicf("Failed to read contact file: %+v", err)
}
// Unmarshal contact
c, err := contact.Unmarshal(data)
if err != nil {
jww.FATAL.Panicf("Failed to unmarshal contact: %+v", err)
}
return c
}
\ No newline at end of file
...@@ -11,16 +11,20 @@ import ( ...@@ -11,16 +11,20 @@ import (
"github.com/dtylman/gowd/bootstrap" "github.com/dtylman/gowd/bootstrap"
) )
var password string var password = "password"
var session string var session = ".session"
var ndfPath string var ndfPath = "ndf.json"
var singleMngr *single.Manager var botContactPath = "botContact.bin"
var botContact contact.Contact var botContact contact.Contact
var singleMngr *single.Manager
var body *gowd.Element var body *gowd.Element
func main() { func main() {
botContact = readBotContact()
_, singleMngr = initClient() _, singleMngr = initClient()
//creates a new bootstrap fluid container //creates a new bootstrap fluid container
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment