Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
client
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
elixxir
client
Commits
ae1e6f43
Commit
ae1e6f43
authored
6 years ago
by
Jake Taylor
Browse files
Options
Downloads
Patches
Plain Diff
Some final cleanup and log messages for registration
parent
5625d169
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
cmd/root.go
+15
-11
15 additions, 11 deletions
cmd/root.go
with
15 additions
and
11 deletions
cmd/root.go
+
15
−
11
View file @
ae1e6f43
...
...
@@ -19,10 +19,11 @@ import (
"gitlab.com/elixxir/client/cmixproto"
"gitlab.com/elixxir/client/globals"
"gitlab.com/elixxir/client/parse"
"gitlab.com/elixxir/primitives/switchboard"
"gitlab.com/elixxir/client/user"
"gitlab.com/elixxir/comms/connect"
"gitlab.com/elixxir/primitives/format"
"gitlab.com/elixxir/primitives/id"
"gitlab.com/elixxir/primitives/switchboard"
"io/ioutil"
"log"
"math/big"
...
...
@@ -30,7 +31,6 @@ import (
"strings"
"sync/atomic"
"time"
"gitlab.com/elixxir/primitives/format"
)
var
verbose
bool
...
...
@@ -116,26 +116,30 @@ func sessionInitialization() {
}
}
// Holds the User ID
var
uid
[]
byte
// Register a new user if requested
if
register
{
// FIXME Use a different encoding for the user ID command line argument,
// to allow testing with IDs that are long enough to exercise more than
// 64 bits
regCode
:=
new
(
id
.
User
)
.
SetUints
(
&
[
4
]
uint64
{
0
,
0
,
0
,
userId
})
.
RegistrationCode
()
_
,
err
:=
bindings
.
Register
(
regCode
,
registrationAddr
,
regCode
:=
"AAAA"
// FIXME: Need to pass in registration code
fmt
.
Printf
(
"Attempting to register with code %s...
\n
"
,
regCode
)
uid
,
err
=
bindings
.
Register
(
regCode
,
registrationAddr
,
strings
.
Join
(
gwAddresses
,
","
),
mint
)
if
err
!=
nil
{
fmt
.
Printf
(
"Could Not Register User: %s
\n
"
,
err
.
Error
())
return
}
fmt
.
Printf
(
"Successfully registered user %v!
\n
"
,
uid
)
}
// Log the user in, for now using the first gateway specified
uid
:=
id
.
NewUserFromUint
(
userId
,
nil
)
if
!
register
{
uid
=
id
.
NewUserFromUint
(
userId
,
nil
)
.
Bytes
()
}
_
,
err
=
bindings
.
Login
(
uid
[
:
],
gwAddresses
[
0
],
""
)
if
err
!=
nil
{
fmt
.
Printf
(
"Could Not Log In
\n
"
)
fmt
.
Printf
(
"Could Not Log In
: %s
\n
"
,
err
)
return
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment