Skip to content
Snippets Groups Projects
Commit 6fa94743 authored by Jonah Husson's avatar Jonah Husson
Browse files

Fixes to get node key exchange going

parent 2e58aa11
No related branches found
No related tags found
No related merge requests found
...@@ -135,7 +135,6 @@ func NewPrecannedClient(precannedID uint, defJSON, storageDir string, password [ ...@@ -135,7 +135,6 @@ func NewPrecannedClient(precannedID uint, defJSON, storageDir string, password [
return loadClient(storageSess, rngStreamGen) return loadClient(storageSess, rngStreamGen)
} }
// LoadClient initalizes a client object from existing storage. // LoadClient initalizes a client object from existing storage.
func LoadClient(storageDir string, password []byte) (*Client, error) { func LoadClient(storageDir string, password []byte) (*Client, error) {
// Use fastRNG for RNG ops (AES fortuna based RNG using system RNG) // Use fastRNG for RNG ops (AES fortuna based RNG using system RNG)
...@@ -213,6 +212,11 @@ func loadClient(session *storage.Session, rngStreamGen *fastRNG.StreamGenerator) ...@@ -213,6 +212,11 @@ func loadClient(session *storage.Session, rngStreamGen *fastRNG.StreamGenerator)
return nil, err return nil, err
} }
err = c.network.GetInstance().UpdateGatewayConnections()
if err != nil {
return nil, err
}
return c, nil return c, nil
} }
...@@ -315,7 +319,6 @@ func (c *Client) GetRoundEvents() interfaces.RoundEvents { ...@@ -315,7 +319,6 @@ func (c *Client) GetRoundEvents() interfaces.RoundEvents {
return c.network.GetInstance().GetRoundEvents() return c.network.GetInstance().GetRoundEvents()
} }
// Returns the switchboard for Registration // Returns the switchboard for Registration
func (c *Client) GetSwitchboard() interfaces.Switchboard { func (c *Client) GetSwitchboard() interfaces.Switchboard {
jww.INFO.Printf("GetSwitchboard()") jww.INFO.Printf("GetSwitchboard()")
......
...@@ -204,6 +204,12 @@ var rootCmd = &cobra.Command{ ...@@ -204,6 +204,12 @@ var rootCmd = &cobra.Command{
user := client.GetUser() user := client.GetUser()
jww.INFO.Printf("%s", user.ID) jww.INFO.Printf("%s", user.ID)
err := client.StartNetworkFollower()
if err != nil {
jww.FATAL.Panicf("%+v", err)
}
select {}
}, },
} }
......
...@@ -246,6 +246,8 @@ github.com/zeebo/assert v1.1.0/go.mod h1:Pq9JiuJQpG8JLJdtkwrJESF0Foym2/D9XMU5ciN ...@@ -246,6 +246,8 @@ github.com/zeebo/assert v1.1.0/go.mod h1:Pq9JiuJQpG8JLJdtkwrJESF0Foym2/D9XMU5ciN
github.com/zeebo/blake3 v0.0.4 h1:vtZ4X8B2lKXZFg2Xyg6Wo36mvmnJvc2VQYTtA4RDCkI= github.com/zeebo/blake3 v0.0.4 h1:vtZ4X8B2lKXZFg2Xyg6Wo36mvmnJvc2VQYTtA4RDCkI=
github.com/zeebo/blake3 v0.0.4/go.mod h1:YOZo8A49yNqM0X/Y+JmDUZshJWLt1laHsNSn5ny2i34= github.com/zeebo/blake3 v0.0.4/go.mod h1:YOZo8A49yNqM0X/Y+JmDUZshJWLt1laHsNSn5ny2i34=
github.com/zeebo/pcg v0.0.0-20181207190024-3cdc6b625a05/go.mod h1:Gr+78ptB0MwXxm//LBaEvBiaXY7hXJ6KGe2V32X2F6E= github.com/zeebo/pcg v0.0.0-20181207190024-3cdc6b625a05/go.mod h1:Gr+78ptB0MwXxm//LBaEvBiaXY7hXJ6KGe2V32X2F6E=
gitlab.com/elixxir/client v1.5.0/go.mod h1:/uVTzYDhKaGgN8LGGh1sSsxbh+BrpVi1X8VToAT3DfA=
gitlab.com/elixxir/comms v0.0.0-20200707210150-b8ebd0951d23/go.mod h1:OsWMZ1O/R9fOkm+PoHnR3rkXfFtipGoPs73FuKuurHY=
gitlab.com/elixxir/comms v0.0.0-20200810165153-3039323b5656 h1:A5S3E7EPL95s3+PGhgAiwnMaa7VcWj8/RtBur3lxdOw= gitlab.com/elixxir/comms v0.0.0-20200810165153-3039323b5656 h1:A5S3E7EPL95s3+PGhgAiwnMaa7VcWj8/RtBur3lxdOw=
gitlab.com/elixxir/comms v0.0.0-20200810165153-3039323b5656/go.mod h1:EeS1z5wXKrnWOvR0dJlVNVv8OzuiGJz7fa6LyUeN6Q0= gitlab.com/elixxir/comms v0.0.0-20200810165153-3039323b5656/go.mod h1:EeS1z5wXKrnWOvR0dJlVNVv8OzuiGJz7fa6LyUeN6Q0=
gitlab.com/elixxir/comms v0.0.0-20200813225502-e879259ca741 h1:yIjgre8xSDpnhJkDzTr1lgR7NC1bPWCk2Sgn8udiS2A= gitlab.com/elixxir/comms v0.0.0-20200813225502-e879259ca741 h1:yIjgre8xSDpnhJkDzTr1lgR7NC1bPWCk2Sgn8udiS2A=
...@@ -272,6 +274,7 @@ gitlab.com/elixxir/comms v0.0.0-20200916212207-60e7bd5b0913 h1:p4TLPPaMysV//lOJU ...@@ -272,6 +274,7 @@ gitlab.com/elixxir/comms v0.0.0-20200916212207-60e7bd5b0913 h1:p4TLPPaMysV//lOJU
gitlab.com/elixxir/comms v0.0.0-20200916212207-60e7bd5b0913/go.mod h1:yBEsOZSPyJQJvDbtlQ5L8ydy1JRgVlRoNgMDy9koQcE= gitlab.com/elixxir/comms v0.0.0-20200916212207-60e7bd5b0913/go.mod h1:yBEsOZSPyJQJvDbtlQ5L8ydy1JRgVlRoNgMDy9koQcE=
gitlab.com/elixxir/comms v0.0.0-20200917172539-929fc227eb0c h1:go7/RknV7646Ie+nmQXZAa/aJ5wZBn5bpAYRB+tPens= gitlab.com/elixxir/comms v0.0.0-20200917172539-929fc227eb0c h1:go7/RknV7646Ie+nmQXZAa/aJ5wZBn5bpAYRB+tPens=
gitlab.com/elixxir/comms v0.0.0-20200917172539-929fc227eb0c/go.mod h1:yBEsOZSPyJQJvDbtlQ5L8ydy1JRgVlRoNgMDy9koQcE= gitlab.com/elixxir/comms v0.0.0-20200917172539-929fc227eb0c/go.mod h1:yBEsOZSPyJQJvDbtlQ5L8ydy1JRgVlRoNgMDy9koQcE=
gitlab.com/elixxir/comms v0.0.0-20200917221445-8a509560122a/go.mod h1:L2Va13j2AbQkpkveOQmNzrQD37uI5NKeBhYH+LWMOx0=
gitlab.com/elixxir/comms v0.0.0-20200921200427-5955a0a798b9 h1:skzHNWCMh+T7Cn58/88Mikg2R8KnSWfzLV0w7SnerOs= gitlab.com/elixxir/comms v0.0.0-20200921200427-5955a0a798b9 h1:skzHNWCMh+T7Cn58/88Mikg2R8KnSWfzLV0w7SnerOs=
gitlab.com/elixxir/comms v0.0.0-20200921200427-5955a0a798b9/go.mod h1:uRr8j6yTjCslxZxbRe6k4ixACu9gAeF61JZH36OFFa0= gitlab.com/elixxir/comms v0.0.0-20200921200427-5955a0a798b9/go.mod h1:uRr8j6yTjCslxZxbRe6k4ixACu9gAeF61JZH36OFFa0=
gitlab.com/elixxir/comms v0.0.0-20200922163657-3e723b7170f6 h1:dFgfdATZuiPybonCBh0s4HeLB8Qw3Zm9EoLDRh2Eaaw= gitlab.com/elixxir/comms v0.0.0-20200922163657-3e723b7170f6 h1:dFgfdATZuiPybonCBh0s4HeLB8Qw3Zm9EoLDRh2Eaaw=
...@@ -280,6 +283,10 @@ gitlab.com/elixxir/comms v0.0.0-20200924072138-2e2709483d89 h1:PQalM7pnCRzZRKvdz ...@@ -280,6 +283,10 @@ gitlab.com/elixxir/comms v0.0.0-20200924072138-2e2709483d89 h1:PQalM7pnCRzZRKvdz
gitlab.com/elixxir/comms v0.0.0-20200924072138-2e2709483d89/go.mod h1:uRr8j6yTjCslxZxbRe6k4ixACu9gAeF61JZH36OFFa0= gitlab.com/elixxir/comms v0.0.0-20200924072138-2e2709483d89/go.mod h1:uRr8j6yTjCslxZxbRe6k4ixACu9gAeF61JZH36OFFa0=
gitlab.com/elixxir/comms v0.0.0-20200924210331-d7903c023fa6 h1:ctVsHyiabgRls3esApbBemDwmQ/a0CramEmZt9RCQb8= gitlab.com/elixxir/comms v0.0.0-20200924210331-d7903c023fa6 h1:ctVsHyiabgRls3esApbBemDwmQ/a0CramEmZt9RCQb8=
gitlab.com/elixxir/comms v0.0.0-20200924210331-d7903c023fa6/go.mod h1:9+Jj7K8HOTgBjPuiP69VtTKTv7GvAK6bWlh4lgMAqrk= gitlab.com/elixxir/comms v0.0.0-20200924210331-d7903c023fa6/go.mod h1:9+Jj7K8HOTgBjPuiP69VtTKTv7GvAK6bWlh4lgMAqrk=
gitlab.com/elixxir/comms v0.0.0-20200924225440-76e02f95fb92 h1:KwqVzHpqYg1l1/KG6uRqnl7HBgvrzuknMVCeEvRsbow=
gitlab.com/elixxir/comms v0.0.0-20200924225440-76e02f95fb92/go.mod h1:3i4o6ie4LFC+EVN68l9tdt9JxJlAd3+pNNnKBFubKSg=
gitlab.com/elixxir/crypto v0.0.0-20200707005343-97f868cbd930/go.mod h1:LHBAaEf48a0/AjU118rjoworH0LgXifhAqmNX3ZRvME=
gitlab.com/elixxir/crypto v0.0.0-20200731174640-0503cf80524a/go.mod h1:LHBAaEf48a0/AjU118rjoworH0LgXifhAqmNX3ZRvME=
gitlab.com/elixxir/crypto v0.0.0-20200804182833-984246dea2c4 h1:28ftZDeYEko7xptCZzeFWS1Iam95dj46TWFVVlKmw6A= gitlab.com/elixxir/crypto v0.0.0-20200804182833-984246dea2c4 h1:28ftZDeYEko7xptCZzeFWS1Iam95dj46TWFVVlKmw6A=
gitlab.com/elixxir/crypto v0.0.0-20200804182833-984246dea2c4/go.mod h1:ucm9SFKJo+K0N2GwRRpaNr+tKXMIOVWzmyUD0SbOu2c= gitlab.com/elixxir/crypto v0.0.0-20200804182833-984246dea2c4/go.mod h1:ucm9SFKJo+K0N2GwRRpaNr+tKXMIOVWzmyUD0SbOu2c=
gitlab.com/elixxir/crypto v0.0.0-20200805174804-bdf909f2a16d/go.mod h1:cu6uNoANVLV0J6HyTL6KqVtVyh9SHU1RjJhytYlsbVQ= gitlab.com/elixxir/crypto v0.0.0-20200805174804-bdf909f2a16d/go.mod h1:cu6uNoANVLV0J6HyTL6KqVtVyh9SHU1RjJhytYlsbVQ=
...@@ -321,6 +328,8 @@ gitlab.com/elixxir/ekv v0.1.1 h1:Em3rF8sv+tNbQGXbcpYzAS2blWRAP708JGhYlkN74Kg= ...@@ -321,6 +328,8 @@ gitlab.com/elixxir/ekv v0.1.1 h1:Em3rF8sv+tNbQGXbcpYzAS2blWRAP708JGhYlkN74Kg=
gitlab.com/elixxir/ekv v0.1.1/go.mod h1:bXY0kgbV5BHYda4YY5/hiG5bjimGK+R3PYub5yM9C/s= gitlab.com/elixxir/ekv v0.1.1/go.mod h1:bXY0kgbV5BHYda4YY5/hiG5bjimGK+R3PYub5yM9C/s=
gitlab.com/elixxir/ekv v0.1.3 h1:OE+LBMIhjGUMwc6hHJzYvEPNJQV7t1vMnJyIgxUMUo8= gitlab.com/elixxir/ekv v0.1.3 h1:OE+LBMIhjGUMwc6hHJzYvEPNJQV7t1vMnJyIgxUMUo8=
gitlab.com/elixxir/ekv v0.1.3/go.mod h1:e6WPUt97taFZe5PFLPb1Dupk7tqmDCTQu1kkstqJvw4= gitlab.com/elixxir/ekv v0.1.3/go.mod h1:e6WPUt97taFZe5PFLPb1Dupk7tqmDCTQu1kkstqJvw4=
gitlab.com/elixxir/primitives v0.0.0-20200706165052-9fe7a4fb99a3/go.mod h1:OQgUZq7SjnE0b+8+iIAT2eqQF+2IFHn73tOo+aV11mg=
gitlab.com/elixxir/primitives v0.0.0-20200708185800-a06e961280e6/go.mod h1:OQgUZq7SjnE0b+8+iIAT2eqQF+2IFHn73tOo+aV11mg=
gitlab.com/elixxir/primitives v0.0.0-20200731184040-494269b53b4d/go.mod h1:OQgUZq7SjnE0b+8+iIAT2eqQF+2IFHn73tOo+aV11mg= gitlab.com/elixxir/primitives v0.0.0-20200731184040-494269b53b4d/go.mod h1:OQgUZq7SjnE0b+8+iIAT2eqQF+2IFHn73tOo+aV11mg=
gitlab.com/elixxir/primitives v0.0.0-20200804170709-a1896d262cd9/go.mod h1:p0VelQda72OzoUckr1O+vPW0AiFe0nyKQ6gYcmFSuF8= gitlab.com/elixxir/primitives v0.0.0-20200804170709-a1896d262cd9/go.mod h1:p0VelQda72OzoUckr1O+vPW0AiFe0nyKQ6gYcmFSuF8=
gitlab.com/elixxir/primitives v0.0.0-20200804182913-788f47bded40/go.mod h1:tzdFFvb1ESmuTCOl1z6+yf6oAICDxH2NPUemVgoNLxc= gitlab.com/elixxir/primitives v0.0.0-20200804182913-788f47bded40/go.mod h1:tzdFFvb1ESmuTCOl1z6+yf6oAICDxH2NPUemVgoNLxc=
...@@ -346,8 +355,11 @@ gitlab.com/xx_network/comms v0.0.0-20200910173932-bd179f5fee4f h1:ExTCqEoro7VuS1 ...@@ -346,8 +355,11 @@ gitlab.com/xx_network/comms v0.0.0-20200910173932-bd179f5fee4f h1:ExTCqEoro7VuS1
gitlab.com/xx_network/comms v0.0.0-20200910173932-bd179f5fee4f/go.mod h1:+jEkDQKoK51WLl2ZZuxfAZkz6YFbUQ+oZfH0dt2wIF0= gitlab.com/xx_network/comms v0.0.0-20200910173932-bd179f5fee4f/go.mod h1:+jEkDQKoK51WLl2ZZuxfAZkz6YFbUQ+oZfH0dt2wIF0=
gitlab.com/xx_network/comms v0.0.0-20200915154643-d533291041b7 h1:lPx1wpkjNpwLaZ0pyd7/iCcdITjT+eCMmb0HXCVoIkk= gitlab.com/xx_network/comms v0.0.0-20200915154643-d533291041b7 h1:lPx1wpkjNpwLaZ0pyd7/iCcdITjT+eCMmb0HXCVoIkk=
gitlab.com/xx_network/comms v0.0.0-20200915154643-d533291041b7/go.mod h1:+jEkDQKoK51WLl2ZZuxfAZkz6YFbUQ+oZfH0dt2wIF0= gitlab.com/xx_network/comms v0.0.0-20200915154643-d533291041b7/go.mod h1:+jEkDQKoK51WLl2ZZuxfAZkz6YFbUQ+oZfH0dt2wIF0=
gitlab.com/xx_network/comms v0.0.0-20200916172635-6ab807c3c820/go.mod h1:J+GJ6fn71a4xnYVvbcrhtvWSOQIqqhaGcaej5xB3/JY=
gitlab.com/xx_network/comms v0.0.0-20200924172734-1124191b69ee h1:dPRaW0OxcoBlWALd5H6VUYnL/ALvT7j14kWJNBi0K7A= gitlab.com/xx_network/comms v0.0.0-20200924172734-1124191b69ee h1:dPRaW0OxcoBlWALd5H6VUYnL/ALvT7j14kWJNBi0K7A=
gitlab.com/xx_network/comms v0.0.0-20200924172734-1124191b69ee/go.mod h1:jECvMkoYKZFooCudoZxxaf2bo1DzpWP0gCahXHdlqUM= gitlab.com/xx_network/comms v0.0.0-20200924172734-1124191b69ee/go.mod h1:jECvMkoYKZFooCudoZxxaf2bo1DzpWP0gCahXHdlqUM=
gitlab.com/xx_network/comms v0.0.0-20200924225518-0c867207b1e6 h1:8rNFHiwKJvcfN89FAmp4RyfjD/rknp4tNm9sI/Nos0g=
gitlab.com/xx_network/comms v0.0.0-20200924225518-0c867207b1e6/go.mod h1:jECvMkoYKZFooCudoZxxaf2bo1DzpWP0gCahXHdlqUM=
gitlab.com/xx_network/crypto v0.0.0-20200805231039-4aa0e350ed0a h1:BlfWGPokU6yU69O+PGGsgc5iA/P9gERbHzYUvjoYbgM= gitlab.com/xx_network/crypto v0.0.0-20200805231039-4aa0e350ed0a h1:BlfWGPokU6yU69O+PGGsgc5iA/P9gERbHzYUvjoYbgM=
gitlab.com/xx_network/crypto v0.0.0-20200806202113-978fa1984bbf/go.mod h1:i0df/q6dDCBiscgD51fMoS2U2TBrm6LcyN822JmB5Tw= gitlab.com/xx_network/crypto v0.0.0-20200806202113-978fa1984bbf/go.mod h1:i0df/q6dDCBiscgD51fMoS2U2TBrm6LcyN822JmB5Tw=
gitlab.com/xx_network/crypto v0.0.0-20200806235322-ede3c15881ce h1:gypNBUl2guESEv4MDgH+miwYqR4jPoWM8dLt2Zs5gIs= gitlab.com/xx_network/crypto v0.0.0-20200806235322-ede3c15881ce h1:gypNBUl2guESEv4MDgH+miwYqR4jPoWM8dLt2Zs5gIs=
...@@ -419,6 +431,7 @@ golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn ...@@ -419,6 +431,7 @@ golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn
golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/net v0.0.0-20200707034311-ab3426394381 h1:VXak5I6aEWmAXeQjA+QSZzlgNrpq9mjcfDemuexIKsU= golang.org/x/net v0.0.0-20200707034311-ab3426394381 h1:VXak5I6aEWmAXeQjA+QSZzlgNrpq9mjcfDemuexIKsU=
golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
...@@ -498,6 +511,7 @@ google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98 ...@@ -498,6 +511,7 @@ google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8=
google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
google.golang.org/genproto v0.0.0-20200514193133-8feb7f20f2a2/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U=
google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo=
google.golang.org/genproto v0.0.0-20200709005830-7a2ca40e9dc3 h1:JwLN1jVnmIsfE4HkDVe2AblFAbo0Z+4cjteDSOnv6oE= google.golang.org/genproto v0.0.0-20200709005830-7a2ca40e9dc3 h1:JwLN1jVnmIsfE4HkDVe2AblFAbo0Z+4cjteDSOnv6oE=
google.golang.org/genproto v0.0.0-20200709005830-7a2ca40e9dc3/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200709005830-7a2ca40e9dc3/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
......
...@@ -23,6 +23,7 @@ package network ...@@ -23,6 +23,7 @@ package network
import ( import (
"gitlab.com/elixxir/client/network/gateway" "gitlab.com/elixxir/client/network/gateway"
"gitlab.com/elixxir/client/storage"
"gitlab.com/elixxir/crypto/csprng" "gitlab.com/elixxir/crypto/csprng"
"gitlab.com/elixxir/primitives/knownRounds" "gitlab.com/elixxir/primitives/knownRounds"
"gitlab.com/xx_network/comms/connect" "gitlab.com/xx_network/comms/connect"
...@@ -73,19 +74,20 @@ func (m *manager) follow(rng csprng.Source, comms followNetworkComms) { ...@@ -73,19 +74,20 @@ func (m *manager) follow(rng csprng.Source, comms followNetworkComms) {
Hash: m.Instance.GetPartialNdf().GetHash(), Hash: m.Instance.GetPartialNdf().GetHash(),
}, },
LastUpdate: uint64(m.Instance.GetLastUpdateID()), LastUpdate: uint64(m.Instance.GetLastUpdateID()),
ClientID: m.Uid.Bytes(),
} }
pollResp, err := comms.SendPoll(gwHost, &pollReq) pollResp, err := comms.SendPoll(gwHost, &pollReq)
if err != nil { if err != nil {
jww.ERROR.Printf(err.Error()) jww.ERROR.Printf("%+v", err)
return return
} }
// ---- Process Update Data ---- // ---- Process Update Data ----
lastTrackedRound := id.Round(pollResp.LastTrackedRound) lastTrackedRound := id.Round(pollResp.LastTrackedRound)
gwRoundsState := &knownRounds.KnownRounds{} gwRoundsState := knownRounds.NewKnownRound(storage.CheckRoundsMaxSize + 1)
err = gwRoundsState.Unmarshal(pollResp.KnownRounds) err = gwRoundsState.Unmarshal(pollResp.KnownRounds)
if err != nil { if err != nil {
jww.ERROR.Printf(err.Error()) jww.ERROR.Printf("Failed to unmartial: %+v", err)
return return
} }
...@@ -98,6 +100,12 @@ func (m *manager) follow(rng csprng.Source, comms followNetworkComms) { ...@@ -98,6 +100,12 @@ func (m *manager) follow(rng csprng.Source, comms followNetworkComms) {
jww.ERROR.Printf(err.Error()) jww.ERROR.Printf(err.Error())
return return
} }
err = m.Instance.UpdateGatewayConnections()
if err != nil {
jww.ERROR.Printf(err.Error())
return
}
} }
// NOTE: this updates rounds and updates the tracking of the health of the // NOTE: this updates rounds and updates the tracking of the health of the
......
...@@ -20,10 +20,11 @@ func Get(ndf *ndf.NetworkDefinition, hg HostGetter, rng io.Reader) (*connect.Hos ...@@ -20,10 +20,11 @@ func Get(ndf *ndf.NetworkDefinition, hg HostGetter, rng io.Reader) (*connect.Hos
// Get a random gateway // Get a random gateway
gateways := ndf.Gateways gateways := ndf.Gateways
gwIdx := ReadRangeUint32(0, uint32(len(gateways)), rng) gwIdx := ReadRangeUint32(0, uint32(len(gateways)), rng)
gwID, err := id.Unmarshal(gateways[gwIdx].ID) gwID, err := id.Unmarshal(ndf.Nodes[gwIdx].ID)
if err != nil { if err != nil {
return nil, errors.WithMessage(err, "failed to get Gateway") return nil, errors.WithMessage(err, "failed to get Gateway")
} }
gwID.SetType(id.Gateway)
gwHost, ok := hg.GetHost(gwID) gwHost, ok := hg.GetHost(gwID)
if !ok { if !ok {
return nil, errors.Errorf("host for gateway %s could not be "+ return nil, errors.Errorf("host for gateway %s could not be "+
......
...@@ -96,7 +96,6 @@ func NewManager(session *storage.Session, switchboard *switchboard.Switchboard, ...@@ -96,7 +96,6 @@ func NewManager(session *storage.Session, switchboard *switchboard.Switchboard,
// - Garbled Messages (/network/message/garbled.go) // - Garbled Messages (/network/message/garbled.go)
// - Critical Messages (/network/message/critical.go) // - Critical Messages (/network/message/critical.go)
func (m *manager) Follow() (stoppable.Stoppable, error) { func (m *manager) Follow() (stoppable.Stoppable, error) {
if !atomic.CompareAndSwapUint32(m.running, 0, 1) { if !atomic.CompareAndSwapUint32(m.running, 0, 1) {
return nil, errors.Errorf("network routines are already running") return nil, errors.Errorf("network routines are already running")
} }
...@@ -138,7 +137,6 @@ func (m *manager) Follow() (stoppable.Stoppable, error) { ...@@ -138,7 +137,6 @@ func (m *manager) Follow() (stoppable.Stoppable, error) {
return closer, nil return closer, nil
} }
// GetHealthTracker returns the health tracker // GetHealthTracker returns the health tracker
func (m *manager) GetHealthTracker() interfaces.HealthTracker { func (m *manager) GetHealthTracker() interfaces.HealthTracker {
return m.Health return m.Health
...@@ -155,4 +153,3 @@ func (m *manager) GetInstance() *network.Instance { ...@@ -155,4 +153,3 @@ func (m *manager) GetInstance() *network.Instance {
func (m *manager) CheckGarbledMessages() { func (m *manager) CheckGarbledMessages() {
m.message.CheckGarbledMessages() m.message.CheckGarbledMessages()
} }
...@@ -75,14 +75,19 @@ func registerNodes(session *storage.Session, rngGen *fastRNG.StreamGenerator, co ...@@ -75,14 +75,19 @@ func registerNodes(session *storage.Session, rngGen *fastRNG.StreamGenerator, co
// It registers a user with a specific in the client's ndf. // It registers a user with a specific in the client's ndf.
func registerWithNode(comms RegisterNodeCommsInterface, ngw network.NodeGateway, regSig []byte, func registerWithNode(comms RegisterNodeCommsInterface, ngw network.NodeGateway, regSig []byte,
uci *user.CryptographicIdentity, store *cmix.Store, rng csprng.Source) error { uci *user.CryptographicIdentity, store *cmix.Store, rng csprng.Source) error {
gw := ngw.Gateway nodeID, err := ngw.Node.GetNodeId()
gatewayID, err := id.Unmarshal(gw.ID)
if err != nil { if err != nil {
jww.ERROR.Println("registerWithNode() failed to decode nodeId")
return err return err
} }
nodeID := gatewayID.DeepCopy() gatewayID, err := ngw.Gateway.GetGatewayId()
nodeID.SetType(id.Node) if err != nil {
jww.ERROR.Println("registerWithNode() failed to decode gatewayID")
return err
}
jww.INFO.Printf("Begin registration with node: %s", nodeID)
if store.IsRegistered(nodeID) { if store.IsRegistered(nodeID) {
return nil return nil
...@@ -124,6 +129,8 @@ func registerWithNode(comms RegisterNodeCommsInterface, ngw network.NodeGateway, ...@@ -124,6 +129,8 @@ func registerWithNode(comms RegisterNodeCommsInterface, ngw network.NodeGateway,
store.Add(nodeID, transmissionKey) store.Add(nodeID, transmissionKey)
jww.INFO.Printf("Completed registration with node %s", nodeID)
return nil return nil
} }
......
...@@ -11,6 +11,7 @@ package storage ...@@ -11,6 +11,7 @@ package storage
import ( import (
"github.com/pkg/errors" "github.com/pkg/errors"
"gitlab.com/elixxir/client/globals" "gitlab.com/elixxir/client/globals"
userInterface "gitlab.com/elixxir/client/interfaces/user"
"gitlab.com/elixxir/client/storage/cmix" "gitlab.com/elixxir/client/storage/cmix"
"gitlab.com/elixxir/client/storage/conversation" "gitlab.com/elixxir/client/storage/conversation"
"gitlab.com/elixxir/client/storage/e2e" "gitlab.com/elixxir/client/storage/e2e"
...@@ -28,11 +29,10 @@ import ( ...@@ -28,11 +29,10 @@ import (
"gitlab.com/xx_network/primitives/ndf" "gitlab.com/xx_network/primitives/ndf"
"sync" "sync"
"testing" "testing"
userInterface "gitlab.com/elixxir/client/interfaces/user"
) )
// Number of rounds to store in the CheckedRound buffer // Number of rounds to store in the CheckedRound buffer
const checkRoundsMaxSize = 1000000 / 64 const CheckRoundsMaxSize = 1000000 / 64
// Session object, backed by encrypted filestore // Session object, backed by encrypted filestore
type Session struct { type Session struct {
...@@ -88,27 +88,32 @@ func New(baseDir, password string, u userInterface.User, cmixGrp, ...@@ -88,27 +88,32 @@ func New(baseDir, password string, u userInterface.User, cmixGrp,
s.user, err = user.NewUser(s.kv, u.ID, u.Salt, u.RSA, u.Precanned) s.user, err = user.NewUser(s.kv, u.ID, u.Salt, u.RSA, u.Precanned)
if err != nil { if err != nil {
return nil, errors.WithMessage(err, "Failed to create session") return nil, errors.WithMessage(err, "Failed to create user")
} }
s.cmix, err = cmix.NewStore(cmixGrp, s.kv, u.CmixDhPrivateKey) s.cmix, err = cmix.NewStore(cmixGrp, s.kv, u.CmixDhPrivateKey)
if err != nil { if err != nil {
return nil, errors.WithMessage(err, "Failed to create session") return nil, errors.WithMessage(err, "Failed to create cmix store")
} }
s.e2e, err = e2e.NewStore(e2eGrp, s.kv, u.E2eDhPrivateKey, rng) s.e2e, err = e2e.NewStore(e2eGrp, s.kv, u.E2eDhPrivateKey, rng)
if err != nil { if err != nil {
return nil, errors.WithMessage(err, "Failed to create session") return nil, errors.WithMessage(err, "Failed to create e2e store")
} }
s.garbledMessages, err = utility.NewMeteredCmixMessageBuffer(s.kv, garbledMessagesKey) s.garbledMessages, err = utility.NewMeteredCmixMessageBuffer(s.kv, garbledMessagesKey)
if err != nil { if err != nil {
return nil, errors.WithMessage(err, "Failed to create session") return nil, errors.WithMessage(err, "Failed to create garbledMessages buffer")
} }
s.checkedRounds, err = utility.NewKnownRounds(s.kv, checkedRoundsKey, checkRoundsMaxSize) s.checkedRounds, err = utility.NewKnownRounds(s.kv, checkedRoundsKey, CheckRoundsMaxSize)
if err != nil { if err != nil {
return nil, errors.WithMessage(err, "Failed to create session") return nil, errors.WithMessage(err, "Failed to create checkedRounds")
}
s.criticalMessages, err = utility.NewE2eMessageBuffer(s.kv, criticalMessagesKey)
if err != nil {
return nil, errors.WithMessage(err, "Failed to create e2e message buffer")
} }
s.conversations = conversation.NewStore(s.kv) s.conversations = conversation.NewStore(s.kv)
...@@ -154,7 +159,7 @@ func Load(baseDir, password string, rng *fastRNG.StreamGenerator) (*Session, err ...@@ -154,7 +159,7 @@ func Load(baseDir, password string, rng *fastRNG.StreamGenerator) (*Session, err
return nil, errors.WithMessage(err, "Failed to load session") return nil, errors.WithMessage(err, "Failed to load session")
} }
s.checkedRounds, err = utility.LoadKnownRounds(s.kv, checkedRoundsKey, checkRoundsMaxSize) s.checkedRounds, err = utility.LoadKnownRounds(s.kv, checkedRoundsKey, CheckRoundsMaxSize)
if err != nil { if err != nil {
return nil, errors.WithMessage(err, "Failed to load session") return nil, errors.WithMessage(err, "Failed to load session")
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment