Implemented signup and login users with JWT and MongoDB connection. Added runTmuxTextPeers.sh to deploy the different peers and servers in a unique console

This commit is contained in:
arnaucode
2017-12-26 18:52:09 +01:00
parent c83cbc0ec2
commit 08e3915994
14 changed files with 327 additions and 51 deletions

View File

@@ -6,6 +6,8 @@ import (
"net/http"
"time"
mgo "gopkg.in/mgo.v2"
"github.com/fatih/color"
"github.com/gorilla/handlers"
)
@@ -26,14 +28,22 @@ type PeersList struct {
var peersList PeersList
var userCollection *mgo.Collection
func main() {
color.Blue("Starting CA")
//read configuration file
readConfig("config.json")
reconstructBlockchainFromBlock("http://"+config.IP+":"+config.ServerRESTPort, "")
initializeToken()
//mongodb
session, err := getSession()
check(err)
userCollection = getCollection(session, "users")
//run thw webserver
go webserver()