Something went wrong on our end
Select Git revision
-
Jake Taylor authoredJake Taylor authored
README.md 3.49 KiB
Server Initialization
These steps must first be performed in order to begin creating server objects of any variety.
Make an xxdk.Cmix Object
The xxdk.Cmix object created here will be used for all types of xxdk.Identity and server initialization.
- Obtain the NDF
ndfJson, err := xxdk.DownloadAndVerifySignedNdfWithUrl(url, cert)
- If not done in previous runs, create a new xxdk.Cmix object in storage using ndfJson.
storageDir
andpassword
may be customized.
Example:
err := xxdk.NewCmix(ndfJson, "/clientStorage", []byte("testPassword"), "")
- LoadCmix in order to obtain the xxdk.Cmix object.
storageDir
andpassword
may be customized, but must match the values provided toNewCmix()
. The result ofxxdk.GetDefaultParams()
may also be freely modified according to your needs.
Example:
client, err := xxdk.LoadCmix("/clientStorage", []byte("testPassword"), xxdk.GetDefaultParams())
- Start the network follower. Timeout may be modified as needed.
Example:
err := client.StartNetworkFollower(10*time.Second)
Make an xxdk.Identity Object
The xxdk.Identity object created here will be used for all types of server initialization. It requires an xxdk.Cmix object.
Example:
identity, err := xxdk.MakeIdentity(client.GetRng(), client.GetStorage().GetE2EGroup())
Building Servers
Creating Connect-backed Servers
receptionId
: the client ID that will be used for all incoming requests.
Derived from xxdk.Identity object
privKey
: the private key belonging to the receptionId.
Derived from xxdk.Identity object
rng
: from xxdk.Cmix object
grp
: from xxdk.Cmix storage object
net
: from xxdk.Cmix object
p
: customizable parameters for the server
Obtained and mutable via connect.GetDefaultParams()
Example:
server, err := connect.NewServer(myIdentity.ID, myIdentity.DHKeyPrivate, client.GetRng(),
client.GetStorage().GetE2EGroup(), client.GetCmix(), connect.GetDefaultParams())