Skip to content
Snippets Groups Projects
Commit 7e2659e4 authored by Xavier Perret's avatar Xavier Perret
Browse files

added initialization of object storage

parent dd70fdad
No related branches found
No related tags found
1 merge request!2added file to separate client function from the server
......@@ -4,8 +4,8 @@ import (
"fmt"
"gopkg.in/yaml.v3"
"net"
"node/connection"
object_storage "node/object-storage"
ObjectStorage "node/object-storage"
ProcessConnection "node/process-connection"
. "node/types"
"node/utilities"
"os"
......@@ -43,7 +43,7 @@ func listenForConnections(serverConfig Config, objectStorage Blob, addressToList
if err != nil {
fmt.Println("Error accepting: ", err.Error())
} else {
go connection.ProcessClient(conn, server, serverConfig, amIRoot, &mu)
go ProcessConnection.ProcessClient(conn, server, objectStorage, serverConfig, amIRoot, &mu)
}
}
}
......@@ -86,14 +86,11 @@ func main() {
fmt.Println("Third argument is not --root meaning this node is not meant to be directly stimulated by the client")
}
fmt.Println("Launching server loop")
addressToListenOn := "0.0.0.0"
azureCreds := object_storage.InitAzureCredentials("hepiadistributedsystems")
azureCreds := ObjectStorage.InitAzureCredentials("hepiadistributedsystems")
blobName := "blockchain" + "-" + "database" + "" + strconv.Itoa(serverConfig.ID)
objectStorage := object_storage.InitializeBlobFromObjectStorageCreds(blobName, azureCreds)
objectStorage := ObjectStorage.InitializeBlobFromObjectStorageCreds(blobName, azureCreds)
addressToListenOn := "0.0.0.0"
go listenForConnections(serverConfig, objectStorage, addressToListenOn, amIRoot)
fmt.Println("Launching user input command line")
userInputLoop(serverConfig, true)
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment