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
9ec2d7b0
Commit
9ec2d7b0
authored
4 years ago
by
Jake Taylor
Browse files
Options
Downloads
Patches
Plain Diff
hostpool improvements
parent
2af0c4fd
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
api/client.go
+5
-5
5 additions, 5 deletions
api/client.go
network/gateway/hostPool.go
+2
-1
2 additions, 1 deletion
network/gateway/hostPool.go
network/manager.go
+7
-0
7 additions, 0 deletions
network/manager.go
with
14 additions
and
6 deletions
api/client.go
+
5
−
5
View file @
9ec2d7b0
...
...
@@ -199,7 +199,7 @@ func OpenClient(storageDir string, password []byte, parameters params.Network) (
return
c
,
nil
}
// Login initalizes a client object from existing storage.
// Login init
i
alizes a client object from existing storage.
func
Login
(
storageDir
string
,
password
[]
byte
,
parameters
params
.
Network
)
(
*
Client
,
error
)
{
jww
.
INFO
.
Printf
(
"Login()"
)
...
...
@@ -233,7 +233,7 @@ func Login(storageDir string, password []byte, parameters params.Network) (*Clie
}
}
else
{
jww
.
WARN
.
Printf
(
"Registration with permissioning skipped due to "
+
"blank permissioni
g
n address. Client will not be able to register "
+
"blank permissionin
g
address. Client will not be able to register "
+
"or track network."
)
}
...
...
@@ -342,7 +342,7 @@ func (c *Client) initPermissioning(def *ndf.NetworkDefinition) error {
jww
.
ERROR
.
Printf
(
"Client has failed registration: %s"
,
err
)
return
errors
.
WithMessage
(
err
,
"failed to load client"
)
}
jww
.
INFO
.
Printf
(
"Client suc
sec
fully registered with the network"
)
jww
.
INFO
.
Printf
(
"Client suc
cess
fully registered with the network"
)
}
return
nil
}
...
...
This diff is collapsed.
Click to expand it.
network/gateway/hostPool.go
+
2
−
1
View file @
9ec2d7b0
...
...
@@ -215,7 +215,8 @@ func (h *HostPool) pruneHostPool() error {
// Verify the NDF has at least as many Gateways as needed for the HostPool
ndfLen
:=
uint32
(
len
(
h
.
ndf
.
Gateways
))
if
ndfLen
==
0
||
ndfLen
<
h
.
poolParams
.
PoolSize
{
return
errors
.
Errorf
(
"no gateways available"
)
return
errors
.
Errorf
(
"Unable to pruneHostPool: %d/%d gateways available"
,
len
(
h
.
ndf
.
Gateways
),
h
.
poolParams
.
PoolSize
)
}
for
poolIdx
:=
uint32
(
0
);
poolIdx
<
h
.
poolParams
.
PoolSize
;
{
...
...
This diff is collapsed.
Click to expand it.
network/manager.go
+
7
−
0
View file @
9ec2d7b0
...
...
@@ -91,8 +91,12 @@ func NewManager(session *storage.Session, switchboard *switchboard.Switchboard,
// Set up gateway.Sender
poolParams
:=
gateway
.
DefaultPoolParams
()
poolParams
.
PoolSize
=
10
m
.
sender
,
err
=
gateway
.
NewSender
(
poolParams
,
rng
.
GetStream
(),
ndf
,
comms
,
session
,
m
.
NodeRegistration
)
if
err
!=
nil
{
return
nil
,
err
}
//create sub managers
m
.
message
=
message
.
NewManager
(
m
.
Internal
,
m
.
param
.
Messages
,
m
.
NodeRegistration
,
m
.
sender
)
...
...
@@ -138,6 +142,9 @@ func (m *manager) Follow(report interfaces.ClientErrorReport) (stoppable.Stoppab
// Round processing
multi
.
Add
(
m
.
round
.
StartProcessors
())
// Message sending
multi
.
Add
(
m
.
sender
.
StartHostPool
())
multi
.
Add
(
ephemeral
.
Track
(
m
.
Session
,
m
.
ReceptionID
))
return
multi
,
nil
...
...
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