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
72ec36a6
Commit
72ec36a6
authored
2 years ago
by
Jake Taylor
Browse files
Options
Downloads
Patches
Plain Diff
update restlike readme
parent
4ffce8b0
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!510
Release
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
bindings/cmix.go
+1
-1
1 addition, 1 deletion
bindings/cmix.go
cmd/root.go
+1
-1
1 addition, 1 deletion
cmd/root.go
restlike/README.md
+2
-2
2 additions, 2 deletions
restlike/README.md
xxdk/cmix.go
+4
-4
4 additions, 4 deletions
xxdk/cmix.go
xxdk/utils_test.go
+1
-1
1 addition, 1 deletion
xxdk/utils_test.go
with
9 additions
and
9 deletions
bindings/cmix.go
+
1
−
1
View file @
72ec36a6
...
@@ -34,7 +34,7 @@ type Cmix struct {
...
@@ -34,7 +34,7 @@ type Cmix struct {
//
//
// Users of this function should delete the storage directory on error.
// Users of this function should delete the storage directory on error.
func
NewKeystore
(
network
,
storageDir
string
,
password
[]
byte
,
regCode
string
)
error
{
func
NewKeystore
(
network
,
storageDir
string
,
password
[]
byte
,
regCode
string
)
error
{
if
err
:=
xxdk
.
NewC
lient
(
network
,
storageDir
,
password
,
regCode
);
err
!=
nil
{
if
err
:=
xxdk
.
NewC
mix
(
network
,
storageDir
,
password
,
regCode
);
err
!=
nil
{
return
errors
.
New
(
fmt
.
Sprintf
(
"Failed to create new client: %+v"
,
return
errors
.
New
(
fmt
.
Sprintf
(
"Failed to create new client: %+v"
,
err
))
err
))
}
}
...
...
This diff is collapsed.
Click to expand it.
cmd/root.go
+
1
−
1
View file @
72ec36a6
...
@@ -597,7 +597,7 @@ func createClient() *xxdk.Cmix {
...
@@ -597,7 +597,7 @@ func createClient() *xxdk.Cmix {
}
}
}
else
{
}
else
{
err
=
xxdk
.
NewC
lient
(
string
(
ndfJSON
),
storeDir
,
err
=
xxdk
.
NewC
mix
(
string
(
ndfJSON
),
storeDir
,
pass
,
regCode
)
pass
,
regCode
)
}
}
...
...
This diff is collapsed.
Click to expand it.
restlike/README.md
+
2
−
2
View file @
72ec36a6
...
@@ -18,11 +18,11 @@ ndfJson, err := xxdk.DownloadAndVerifySignedNdfWithUrl(url, cert)
...
@@ -18,11 +18,11 @@ ndfJson, err := xxdk.DownloadAndVerifySignedNdfWithUrl(url, cert)
Example:
Example:
```
go
```
go
err
:=
xxdk
.
NewC
lient
(
ndfJson
,
"/clientStorage"
,
[]
byte
(
"testPassword"
),
""
)
err
:=
xxdk
.
NewC
mix
(
ndfJson
,
"/clientStorage"
,
[]
byte
(
"testPassword"
),
""
)
```
```
3.
LoadCmix in order to obtain the xxdk.Cmix object.
3.
LoadCmix in order to obtain the xxdk.Cmix object.
`storageDir`
and
`password`
may be customized, but must match the values provided to
`NewC
lient
()`
.
`storageDir`
and
`password`
may be customized, but must match the values provided to
`NewC
mix
()`
.
The result of
`xxdk.GetDefaultParams()`
may also be freely modified according to your needs.
The result of
`xxdk.GetDefaultParams()`
may also be freely modified according to your needs.
Example:
Example:
...
...
This diff is collapsed.
Click to expand it.
xxdk/cmix.go
+
4
−
4
View file @
72ec36a6
...
@@ -61,13 +61,13 @@ type Cmix struct {
...
@@ -61,13 +61,13 @@ type Cmix struct {
events
*
event
.
Manager
events
*
event
.
Manager
}
}
// NewC
lient
creates client storage, generates keys, connects, and registers
// NewC
mix
creates client storage, generates keys, connects, and registers
// with the network. Note that this does not register a username/identity, but
// with the network. Note that this does not register a username/identity, but
// merely creates a new cryptographic identity for adding such information
// merely creates a new cryptographic identity for adding such information
// at a later date.
// at a later date.
func
NewC
lient
(
ndfJSON
,
storageDir
string
,
password
[]
byte
,
func
NewC
mix
(
ndfJSON
,
storageDir
string
,
password
[]
byte
,
registrationCode
string
)
error
{
registrationCode
string
)
error
{
jww
.
INFO
.
Printf
(
"NewC
lient
(dir: %s)"
,
storageDir
)
jww
.
INFO
.
Printf
(
"NewC
mix
(dir: %s)"
,
storageDir
)
rngStreamGen
:=
fastRNG
.
NewStreamGenerator
(
12
,
1024
,
rngStreamGen
:=
fastRNG
.
NewStreamGenerator
(
12
,
1024
,
csprng
.
NewSystemRNG
)
csprng
.
NewSystemRNG
)
...
@@ -566,7 +566,7 @@ func DecodeGroups(ndf *ndf.NetworkDefinition) (cmixGrp, e2eGrp *cyclic.Group) {
...
@@ -566,7 +566,7 @@ func DecodeGroups(ndf *ndf.NetworkDefinition) (cmixGrp, e2eGrp *cyclic.Group) {
return
cmixGrp
,
e2eGrp
return
cmixGrp
,
e2eGrp
}
}
// CheckVersionAndSetupStorage is common code shared by NewC
lient
,
// CheckVersionAndSetupStorage is common code shared by NewC
mix
,
// NewPrecannedClient and NewVanityClient it checks client version and
// NewPrecannedClient and NewVanityClient it checks client version and
// creates a new storage for user data
// creates a new storage for user data
func
CheckVersionAndSetupStorage
(
def
*
ndf
.
NetworkDefinition
,
func
CheckVersionAndSetupStorage
(
def
*
ndf
.
NetworkDefinition
,
...
...
This diff is collapsed.
Click to expand it.
xxdk/utils_test.go
+
1
−
1
View file @
72ec36a6
...
@@ -39,7 +39,7 @@ func newTestingClient(face interface{}) (*Cmix, error) {
...
@@ -39,7 +39,7 @@ func newTestingClient(face interface{}) (*Cmix, error) {
marshalledDef
,
_
:=
def
.
Marshal
()
marshalledDef
,
_
:=
def
.
Marshal
()
storageDir
:=
"ignore.1"
storageDir
:=
"ignore.1"
password
:=
[]
byte
(
"hunter2"
)
password
:=
[]
byte
(
"hunter2"
)
err
:=
NewC
lient
(
string
(
marshalledDef
),
storageDir
,
password
,
"AAAA"
)
err
:=
NewC
mix
(
string
(
marshalledDef
),
storageDir
,
password
,
"AAAA"
)
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
errors
.
Errorf
(
return
nil
,
errors
.
Errorf
(
"Could not construct a mock client: %v"
,
err
)
"Could not construct a mock client: %v"
,
err
)
...
...
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