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
58d33875
Commit
58d33875
authored
3 years ago
by
Jonah Husson
Browse files
Options
Downloads
Patches
Plain Diff
Fixes for command line flags
parent
af37bc6c
Branches
Branches containing commit
Tags
Tags containing commit
6 merge requests
!510
Release
,
!229
Make the payload returned by NewSizedBroadcast include the extra padding so...
,
!221
Xx 3891/symmetric integration
,
!218
Xx 3891/symmetric integration
,
!217
Add asymmetric client
,
!207
WIP: Client Restructure
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
cmd/root.go
+2
-2
2 additions, 2 deletions
cmd/root.go
cmd/symmetric.go
+5
-4
5 additions, 4 deletions
cmd/symmetric.go
with
7 additions
and
6 deletions
cmd/root.go
+
2
−
2
View file @
58d33875
...
@@ -1040,9 +1040,9 @@ func init() {
...
@@ -1040,9 +1040,9 @@ func init() {
"Ensure successful message sending by checking for round completion"
)
"Ensure successful message sending by checking for round completion"
)
viper
.
BindPFlag
(
"verify-sends"
,
rootCmd
.
Flags
()
.
Lookup
(
"verify-sends"
))
viper
.
BindPFlag
(
"verify-sends"
,
rootCmd
.
Flags
()
.
Lookup
(
"verify-sends"
))
rootCmd
.
Flags
()
.
UintP
(
"receiveCount"
,
rootCmd
.
Persistent
Flags
()
.
UintP
(
"receiveCount"
,
""
,
1
,
"How many messages we should wait for before quitting"
)
""
,
1
,
"How many messages we should wait for before quitting"
)
viper
.
BindPFlag
(
"receiveCount"
,
rootCmd
.
Flags
()
.
Lookup
(
"receiveCount"
))
viper
.
BindPFlag
(
"receiveCount"
,
rootCmd
.
Persistent
Flags
()
.
Lookup
(
"receiveCount"
))
rootCmd
.
PersistentFlags
()
.
UintP
(
"waitTimeout"
,
""
,
15
,
rootCmd
.
PersistentFlags
()
.
UintP
(
"waitTimeout"
,
""
,
15
,
"The number of seconds to wait for messages to arrive"
)
"The number of seconds to wait for messages to arrive"
)
viper
.
BindPFlag
(
"waitTimeout"
,
viper
.
BindPFlag
(
"waitTimeout"
,
...
...
This diff is collapsed.
Click to expand it.
cmd/symmetric.go
+
5
−
4
View file @
58d33875
...
@@ -140,18 +140,18 @@ var symmetricCmd = &cobra.Command{
...
@@ -140,18 +140,18 @@ var symmetricCmd = &cobra.Command{
if
message
!=
""
{
if
message
!=
""
{
broadcastMessage
,
err
:=
broadcast
.
NewSizedBroadcast
(
scl
.
MaxPayloadSize
(),
[]
byte
(
message
))
broadcastMessage
,
err
:=
broadcast
.
NewSizedBroadcast
(
scl
.
MaxPayloadSize
(),
[]
byte
(
message
))
if
err
!=
nil
{
if
err
!=
nil
{
jww
.
ERROR
.
Printf
(
"Failed to create sized broadcast: %+v"
,
err
)
}
}
rid
,
eid
,
err
:=
scl
.
Broadcast
(
broadcastMessage
,
cmix
.
GetDefaultCMIXParams
())
rid
,
eid
,
err
:=
scl
.
Broadcast
(
broadcastMessage
,
cmix
.
GetDefaultCMIXParams
())
if
err
!=
nil
{
if
err
!=
nil
{
jww
.
ERROR
.
Printf
(
"Failed to send symme
n
tric broadcast message: %+v"
,
err
)
jww
.
ERROR
.
Printf
(
"Failed to send symmetric broadcast message: %+v"
,
err
)
}
}
jww
.
INFO
.
Printf
(
"Sent symmetric broadcast message to %s over round %d"
,
eid
,
rid
)
jww
.
INFO
.
Printf
(
"Sent symmetric broadcast message to %s over round %d"
,
eid
,
rid
)
}
}
// Receive messages over the channel
// Receive messages over the channel
expectedCnt
:=
viper
.
GetUint
(
"receiveCount"
)
waitSecs
:=
viper
.
GetUint
(
"waitTimeout"
)
waitSecs
:=
viper
.
GetUint
(
"waitTimeout"
)
expectedCnt
:=
viper
.
GetUint
(
"receiveCount"
)
waitTimeout
:=
time
.
Duration
(
waitSecs
)
*
time
.
Second
waitTimeout
:=
time
.
Duration
(
waitSecs
)
*
time
.
Second
receivedCount
:=
uint
(
0
)
receivedCount
:=
uint
(
0
)
done
:=
false
done
:=
false
...
@@ -165,7 +165,7 @@ var symmetricCmd = &cobra.Command{
...
@@ -165,7 +165,7 @@ var symmetricCmd = &cobra.Command{
jww
.
ERROR
.
Printf
(
"Failed to decode sized broadcast: %+v"
,
err
)
jww
.
ERROR
.
Printf
(
"Failed to decode sized broadcast: %+v"
,
err
)
continue
continue
}
}
fmt
.
Printf
(
"Symmetric broadcast message received: %s
\n
"
,
string
(
receivedBroadcast
))
fmt
.
Printf
(
"Symmetric broadcast message
%d/%d
received: %s
\n
"
,
receivedCount
,
expectedCnt
,
string
(
receivedBroadcast
))
if
receivedCount
==
expectedCnt
{
if
receivedCount
==
expectedCnt
{
done
=
true
done
=
true
}
}
...
@@ -177,6 +177,7 @@ var symmetricCmd = &cobra.Command{
...
@@ -177,6 +177,7 @@ var symmetricCmd = &cobra.Command{
}
}
jww
.
INFO
.
Printf
(
"Received %d/%d Messages!"
,
receivedCount
,
expectedCnt
)
jww
.
INFO
.
Printf
(
"Received %d/%d Messages!"
,
receivedCount
,
expectedCnt
)
scl
.
Stop
()
err
=
client
.
StopNetworkFollower
()
err
=
client
.
StopNetworkFollower
()
if
err
!=
nil
{
if
err
!=
nil
{
jww
.
WARN
.
Printf
(
jww
.
WARN
.
Printf
(
...
...
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