Skip to content
Snippets Groups Projects
Select Git revision
20 results

README.md

Blame
  • 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.

    1. Obtain the NDF
    ndfJson, err := xxdk.DownloadAndVerifySignedNdfWithUrl(url, cert)
    1. If not done in previous runs, create a new xxdk.Cmix object in storage using ndfJson. storageDir and password may be customized.

    Example:

    err := xxdk.NewCmix(ndfJson, "/clientStorage", []byte("testPassword"), "")
    1. LoadCmix in order to obtain the xxdk.Cmix object. 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:

    client, err := xxdk.LoadCmix("/clientStorage", []byte("testPassword"), xxdk.GetDefaultParams())
    1. 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())

    Creating Single-backed Servers