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
d4de7265
Commit
d4de7265
authored
3 years ago
by
Benjamin Wenger
Browse files
Options
Downloads
Patches
Plain Diff
increased number of buffered streams
parent
95d50cdd
No related branches found
No related tags found
1 merge request
!53
Release
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
api/client.go
+4
-4
4 additions, 4 deletions
api/client.go
api/mnemonic.go
+1
-1
1 addition, 1 deletion
api/mnemonic.go
network/node/register.go
+4
-3
4 additions, 3 deletions
network/node/register.go
with
9 additions
and
8 deletions
api/client.go
+
4
−
4
View file @
d4de7265
...
@@ -75,7 +75,7 @@ type Client struct {
...
@@ -75,7 +75,7 @@ type Client struct {
func
NewClient
(
ndfJSON
,
storageDir
string
,
password
[]
byte
,
registrationCode
string
)
error
{
func
NewClient
(
ndfJSON
,
storageDir
string
,
password
[]
byte
,
registrationCode
string
)
error
{
jww
.
INFO
.
Printf
(
"NewClient(dir: %s)"
,
storageDir
)
jww
.
INFO
.
Printf
(
"NewClient(dir: %s)"
,
storageDir
)
// Use fastRNG for RNG ops (AES fortuna based RNG using system RNG)
// Use fastRNG for RNG ops (AES fortuna based RNG using system RNG)
rngStreamGen
:=
fastRNG
.
NewStreamGenerator
(
12
,
3
,
csprng
.
NewSystemRNG
)
rngStreamGen
:=
fastRNG
.
NewStreamGenerator
(
12
,
1024
,
csprng
.
NewSystemRNG
)
// Parse the NDF
// Parse the NDF
def
,
err
:=
parseNDF
(
ndfJSON
)
def
,
err
:=
parseNDF
(
ndfJSON
)
...
@@ -106,7 +106,7 @@ func NewClient(ndfJSON, storageDir string, password []byte, registrationCode str
...
@@ -106,7 +106,7 @@ func NewClient(ndfJSON, storageDir string, password []byte, registrationCode str
func
NewPrecannedClient
(
precannedID
uint
,
defJSON
,
storageDir
string
,
password
[]
byte
)
error
{
func
NewPrecannedClient
(
precannedID
uint
,
defJSON
,
storageDir
string
,
password
[]
byte
)
error
{
jww
.
INFO
.
Printf
(
"NewPrecannedClient()"
)
jww
.
INFO
.
Printf
(
"NewPrecannedClient()"
)
// Use fastRNG for RNG ops (AES fortuna based RNG using system RNG)
// Use fastRNG for RNG ops (AES fortuna based RNG using system RNG)
rngStreamGen
:=
fastRNG
.
NewStreamGenerator
(
12
,
3
,
csprng
.
NewSystemRNG
)
rngStreamGen
:=
fastRNG
.
NewStreamGenerator
(
12
,
1024
,
csprng
.
NewSystemRNG
)
rngStream
:=
rngStreamGen
.
GetStream
()
rngStream
:=
rngStreamGen
.
GetStream
()
// Parse the NDF
// Parse the NDF
...
@@ -135,7 +135,7 @@ func NewPrecannedClient(precannedID uint, defJSON, storageDir string, password [
...
@@ -135,7 +135,7 @@ func NewPrecannedClient(precannedID uint, defJSON, storageDir string, password [
func
NewVanityClient
(
ndfJSON
,
storageDir
string
,
password
[]
byte
,
registrationCode
string
,
userIdPrefix
string
)
error
{
func
NewVanityClient
(
ndfJSON
,
storageDir
string
,
password
[]
byte
,
registrationCode
string
,
userIdPrefix
string
)
error
{
jww
.
INFO
.
Printf
(
"NewVanityClient()"
)
jww
.
INFO
.
Printf
(
"NewVanityClient()"
)
// Use fastRNG for RNG ops (AES fortuna based RNG using system RNG)
// Use fastRNG for RNG ops (AES fortuna based RNG using system RNG)
rngStreamGen
:=
fastRNG
.
NewStreamGenerator
(
12
,
3
,
csprng
.
NewSystemRNG
)
rngStreamGen
:=
fastRNG
.
NewStreamGenerator
(
12
,
1024
,
csprng
.
NewSystemRNG
)
rngStream
:=
rngStreamGen
.
GetStream
()
rngStream
:=
rngStreamGen
.
GetStream
()
// Parse the NDF
// Parse the NDF
...
@@ -161,7 +161,7 @@ func NewVanityClient(ndfJSON, storageDir string, password []byte, registrationCo
...
@@ -161,7 +161,7 @@ func NewVanityClient(ndfJSON, storageDir string, password []byte, registrationCo
func
OpenClient
(
storageDir
string
,
password
[]
byte
,
parameters
params
.
Network
)
(
*
Client
,
error
)
{
func
OpenClient
(
storageDir
string
,
password
[]
byte
,
parameters
params
.
Network
)
(
*
Client
,
error
)
{
jww
.
INFO
.
Printf
(
"OpenClient()"
)
jww
.
INFO
.
Printf
(
"OpenClient()"
)
// Use fastRNG for RNG ops (AES fortuna based RNG using system RNG)
// Use fastRNG for RNG ops (AES fortuna based RNG using system RNG)
rngStreamGen
:=
fastRNG
.
NewStreamGenerator
(
12
,
3
,
csprng
.
NewSystemRNG
)
rngStreamGen
:=
fastRNG
.
NewStreamGenerator
(
12
,
1024
,
csprng
.
NewSystemRNG
)
// Get current client version
// Get current client version
currentVersion
,
err
:=
version
.
ParseVersion
(
SEMVER
)
currentVersion
,
err
:=
version
.
ParseVersion
(
SEMVER
)
...
...
This diff is collapsed.
Click to expand it.
api/mnemonic.go
+
1
−
1
View file @
d4de7265
...
@@ -24,7 +24,7 @@ const mnemonicFile = ".recovery"
...
@@ -24,7 +24,7 @@ const mnemonicFile = ".recovery"
// This encrypted data saved in storage.
// This encrypted data saved in storage.
func
StoreSecretWithMnemonic
(
secret
[]
byte
,
path
string
)
(
string
,
error
)
{
func
StoreSecretWithMnemonic
(
secret
[]
byte
,
path
string
)
(
string
,
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)
rng
:=
fastRNG
.
NewStreamGenerator
(
12
,
3
,
csprng
.
NewSystemRNG
)
.
GetStream
()
rng
:=
fastRNG
.
NewStreamGenerator
(
12
,
1024
,
csprng
.
NewSystemRNG
)
.
GetStream
()
// Ensure path is appended by filepath separator "/"
// Ensure path is appended by filepath separator "/"
if
!
strings
.
HasSuffix
(
path
,
string
(
filepath
.
Separator
))
{
if
!
strings
.
HasSuffix
(
path
,
string
(
filepath
.
Separator
))
{
...
...
This diff is collapsed.
Click to expand it.
network/node/register.go
+
4
−
3
View file @
d4de7265
...
@@ -43,7 +43,7 @@ type RegisterNodeCommsInterface interface {
...
@@ -43,7 +43,7 @@ type RegisterNodeCommsInterface interface {
}
}
func
StartRegistration
(
sender
*
gateway
.
Sender
,
session
*
storage
.
Session
,
rngGen
*
fastRNG
.
StreamGenerator
,
comms
RegisterNodeCommsInterface
,
func
StartRegistration
(
sender
*
gateway
.
Sender
,
session
*
storage
.
Session
,
rngGen
*
fastRNG
.
StreamGenerator
,
comms
RegisterNodeCommsInterface
,
c
chan
network
.
NodeGateway
,
numParallel
uint
)
stoppable
.
Stoppable
{
c
chan
network
.
NodeGateway
,
numParallel
uint
,
networkInstance
*
network
.
Instance
)
stoppable
.
Stoppable
{
multi
:=
stoppable
.
NewMulti
(
"NodeRegistrations"
)
multi
:=
stoppable
.
NewMulti
(
"NodeRegistrations"
)
...
@@ -52,7 +52,7 @@ func StartRegistration(sender *gateway.Sender, session *storage.Session, rngGen
...
@@ -52,7 +52,7 @@ func StartRegistration(sender *gateway.Sender, session *storage.Session, rngGen
for
i
:=
uint
(
0
);
i
<
numParallel
;
i
++
{
for
i
:=
uint
(
0
);
i
<
numParallel
;
i
++
{
stop
:=
stoppable
.
NewSingle
(
fmt
.
Sprintf
(
"NodeRegistration %d"
,
i
))
stop
:=
stoppable
.
NewSingle
(
fmt
.
Sprintf
(
"NodeRegistration %d"
,
i
))
go
registerNodes
(
sender
,
session
,
rngGen
,
comms
,
stop
,
c
,
inProgess
)
go
registerNodes
(
sender
,
session
,
rngGen
,
comms
,
stop
,
c
,
inProgess
,
networkInstance
)
multi
.
Add
(
stop
)
multi
.
Add
(
stop
)
}
}
...
@@ -61,7 +61,8 @@ func StartRegistration(sender *gateway.Sender, session *storage.Session, rngGen
...
@@ -61,7 +61,8 @@ func StartRegistration(sender *gateway.Sender, session *storage.Session, rngGen
func
registerNodes
(
sender
*
gateway
.
Sender
,
session
*
storage
.
Session
,
func
registerNodes
(
sender
*
gateway
.
Sender
,
session
*
storage
.
Session
,
rngGen
*
fastRNG
.
StreamGenerator
,
comms
RegisterNodeCommsInterface
,
rngGen
*
fastRNG
.
StreamGenerator
,
comms
RegisterNodeCommsInterface
,
stop
*
stoppable
.
Single
,
c
chan
network
.
NodeGateway
,
inProgress
*
sync
.
Map
)
{
stop
*
stoppable
.
Single
,
c
chan
network
.
NodeGateway
,
inProgress
*
sync
.
Map
,
networkInstance
*
network
.
Instance
)
{
u
:=
session
.
User
()
u
:=
session
.
User
()
regSignature
:=
u
.
GetTransmissionRegistrationValidationSignature
()
regSignature
:=
u
.
GetTransmissionRegistrationValidationSignature
()
// Timestamp in which user has registered with registration
// Timestamp in which user has registered with registration
...
...
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