Skip to content
Snippets Groups Projects
Commit 72ec36a6 authored by Jake Taylor's avatar Jake Taylor
Browse files

update restlike readme

parent 4ffce8b0
No related branches found
No related tags found
1 merge request!510Release
...@@ -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.NewClient(network, storageDir, password, regCode); err != nil { if err := xxdk.NewCmix(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))
} }
......
...@@ -597,7 +597,7 @@ func createClient() *xxdk.Cmix { ...@@ -597,7 +597,7 @@ func createClient() *xxdk.Cmix {
} }
} else { } else {
err = xxdk.NewClient(string(ndfJSON), storeDir, err = xxdk.NewCmix(string(ndfJSON), storeDir,
pass, regCode) pass, regCode)
} }
......
...@@ -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.NewClient(ndfJson, "/clientStorage", []byte("testPassword"), "") err := xxdk.NewCmix(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 `NewClient()`. `storageDir` and `password` may be customized, but must match the values provided to `NewCmix()`.
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:
......
...@@ -61,13 +61,13 @@ type Cmix struct { ...@@ -61,13 +61,13 @@ type Cmix struct {
events *event.Manager events *event.Manager
} }
// NewClient creates client storage, generates keys, connects, and registers // NewCmix 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 NewClient(ndfJSON, storageDir string, password []byte, func NewCmix(ndfJSON, storageDir string, password []byte,
registrationCode string) error { registrationCode string) error {
jww.INFO.Printf("NewClient(dir: %s)", storageDir) jww.INFO.Printf("NewCmix(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 NewClient, // CheckVersionAndSetupStorage is common code shared by NewCmix,
// 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,
......
...@@ -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 := NewClient(string(marshalledDef), storageDir, password, "AAAA") err := NewCmix(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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment