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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
elixxir
client
Commits
52dcb533
Commit
52dcb533
authored
Aug 19, 2019
by
Benjamin Wenger
Browse files
Options
Downloads
Patches
Plain Diff
small QOL changes
parent
4abbb28e
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
api/client.go
+4
-11
4 additions, 11 deletions
api/client.go
cmd/root.go
+0
-7
0 additions, 7 deletions
cmd/root.go
with
4 additions
and
18 deletions
api/client.go
+
4
−
11
View file @
52dcb533
...
...
@@ -36,7 +36,6 @@ import (
"gitlab.com/elixxir/primitives/ndf"
"gitlab.com/elixxir/primitives/switchboard"
goio
"io"
"io/ioutil"
"time"
)
...
...
@@ -162,10 +161,7 @@ func (cl *Client) Connect() error {
var
gwCreds
[]
byte
var
err
error
if
gateway
.
TlsCertificate
!=
""
{
gwCreds
,
err
=
ioutil
.
ReadFile
(
gateway
.
TlsCertificate
)
if
err
!=
nil
{
globals
.
Log
.
ERROR
.
Printf
(
"Failed to read certificate at %s: %+v"
,
gateway
.
TlsCertificate
,
err
)
}
gwCreds
=
[]
byte
(
gateway
.
TlsCertificate
)
}
gwID
:=
id
.
NewNodeFromBytes
(
cl
.
ndf
.
Nodes
[
i
]
.
ID
)
.
NewGateway
()
err
=
(
cl
.
comm
)
.
(
*
io
.
Messaging
)
.
Comms
.
ConnectToGateway
(
gwID
,
gateway
.
Address
,
gwCreds
)
...
...
@@ -176,16 +172,13 @@ func (cl *Client) Connect() error {
//connect to the registration server
if
cl
.
ndf
.
Registration
.
Address
!=
""
{
var
c
ert
[]
byte
var
regC
ert
[]
byte
var
err
error
if
cl
.
ndf
.
Registration
.
TlsCertificate
!=
""
{
cert
,
err
=
ioutil
.
ReadFile
(
cl
.
ndf
.
Registration
.
TlsCertificate
)
if
err
!=
nil
{
globals
.
Log
.
ERROR
.
Printf
(
"failed to read certificate from %s: %+v"
,
cl
.
ndf
.
Registration
.
TlsCertificate
,
err
)
}
regCert
=
[]
byte
(
cl
.
ndf
.
Registration
.
TlsCertificate
)
}
addr
:=
io
.
ConnAddr
(
PermissioningAddrID
)
err
=
(
cl
.
comm
)
.
(
*
io
.
Messaging
)
.
Comms
.
ConnectToRegistration
(
addr
,
cl
.
ndf
.
Registration
.
Address
,
c
ert
)
err
=
(
cl
.
comm
)
.
(
*
io
.
Messaging
)
.
Comms
.
ConnectToRegistration
(
addr
,
cl
.
ndf
.
Registration
.
Address
,
regC
ert
)
if
err
!=
nil
{
globals
.
Log
.
ERROR
.
Printf
(
"Failed connecting to permissioning: %+v"
,
err
)
}
...
...
This diff is collapsed.
Click to expand it.
cmd/root.go
+
0
−
7
View file @
52dcb533
...
...
@@ -36,14 +36,12 @@ import (
var
verbose
bool
var
userId
uint64
var
destinationUserId
uint64
var
gwAddresses
[]
string
var
message
string
var
sessionFile
string
var
dummyFrequency
float64
var
noBlockingTransmission
bool
var
rateLimiting
uint32
var
showVer
bool
var
gwCertPath
string
var
registrationCertPath
string
var
registrationCode
string
var
userEmail
string
...
...
@@ -513,11 +511,6 @@ func init() {
rootCmd
.
PersistentFlags
()
.
Uint64VarP
(
&
userId
,
"userid"
,
"i"
,
0
,
"ID to sign in as"
)
rootCmd
.
PersistentFlags
()
.
StringSliceVarP
(
&
gwAddresses
,
"gwaddresses"
,
"g"
,
make
([]
string
,
0
),
"Gateway addresses:port for message sending, "
+
"comma-separated"
)
rootCmd
.
PersistentFlags
()
.
StringVarP
(
&
gwCertPath
,
"gwcertpath"
,
"c"
,
""
,
"Path to the certificate file for connecting to gateway using TLS"
)
rootCmd
.
PersistentFlags
()
.
StringVarP
(
&
registrationCertPath
,
"registrationcertpath"
,
"r"
,
""
,
"Path to the certificate file for connecting to registration server"
+
...
...
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