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

fixed all loading

parent c60f7420
No related branches found
No related tags found
No related merge requests found
......@@ -2,7 +2,9 @@ package main
import (
"gitlab.com/elixxir/client/api"
"gitlab.com/elixxir/client/interfaces/contact"
"gitlab.com/elixxir/client/interfaces/params"
"gitlab.com/xx_network/primitives/utils"
"io/ioutil"
"gitlab.com/elixxir/client/single"
"os"
......@@ -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 (
"github.com/dtylman/gowd/bootstrap"
)
var password string
var session string
var ndfPath string
var singleMngr *single.Manager
var password = "password"
var session = ".session"
var ndfPath = "ndf.json"
var botContactPath = "botContact.bin"
var botContact contact.Contact
var singleMngr *single.Manager
var body *gowd.Element
func main() {
botContact = readBotContact()
_, singleMngr = initClient()
//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