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 {
//
// Users of this function should delete the storage directory on 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",
err))
}
......
......@@ -597,7 +597,7 @@ func createClient() *xxdk.Cmix {
}
} else {
err = xxdk.NewClient(string(ndfJSON), storeDir,
err = xxdk.NewCmix(string(ndfJSON), storeDir,
pass, regCode)
}
......
......@@ -18,11 +18,11 @@ ndfJson, err := xxdk.DownloadAndVerifySignedNdfWithUrl(url, cert)
Example:
```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.
`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.
Example:
......
......@@ -61,13 +61,13 @@ type Cmix struct {
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
// merely creates a new cryptographic identity for adding such information
// at a later date.
func NewClient(ndfJSON, storageDir string, password []byte,
func NewCmix(ndfJSON, storageDir string, password []byte,
registrationCode string) error {
jww.INFO.Printf("NewClient(dir: %s)", storageDir)
jww.INFO.Printf("NewCmix(dir: %s)", storageDir)
rngStreamGen := fastRNG.NewStreamGenerator(12, 1024,
csprng.NewSystemRNG)
......@@ -566,7 +566,7 @@ func DecodeGroups(ndf *ndf.NetworkDefinition) (cmixGrp, e2eGrp *cyclic.Group) {
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
// creates a new storage for user data
func CheckVersionAndSetupStorage(def *ndf.NetworkDefinition,
......
......@@ -39,7 +39,7 @@ func newTestingClient(face interface{}) (*Cmix, error) {
marshalledDef, _ := def.Marshal()
storageDir := "ignore.1"
password := []byte("hunter2")
err := NewClient(string(marshalledDef), storageDir, password, "AAAA")
err := NewCmix(string(marshalledDef), storageDir, password, "AAAA")
if err != nil {
return nil, errors.Errorf(
"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