salt-sdk - v0.0.45
    Preparing search index...

    Class RoboHostProvisioningAbstract Sealed

    Provisioning for a robo host: producing what runs on the machine that hosts its guardians, as a setup script or an AWS CloudFormation quick-create URL.

    RoboHostSetup is the one kind, returned by RoboHost.setup. Everything after provisioning lives on host: follow progress with RoboHost.listenToSetup, wait with RoboHost.waitUntilOnline, then RoboHost.activate with the owner's wallet.

    async function provision(provisioning: RoboHostProvisioning, ownerWallet: WalletClient) {
    fs.writeFileSync('robos.sh', provisioning.generateScript(), { mode: 0o600 });
    // Run it as root on the Ubuntu/Debian machine, then delete it.
    const online = await provisioning.host.waitUntilOnline();
    return online.activate(ownerWallet);
    }

    await provision(host.setup({ publicKey: ownerPublicKey }), ownerWallet);

    Hierarchy (View Summary)

    Index
    host: RoboHost

    The host being provisioned. Its OTP authorises the provisioning, and RoboHost.activate consumes it.

    • Build an AWS CloudFormation quick-create console URL that provisions the machine on a new EC2 instance from Salt's launch template. Opening it in a browser signed in to AWS launches the stack, which runs the same provisioning as generateScript.

      Parameters

      • params: { stackName: string }

        The stack name

      Returns string

      The CloudFormation quick-create URL

      ValidationError if the host record no longer carries an OTP, i.e. it was already activated

      const url = provisioning.generateCloudFormationUrl({ stackName: 'my-org-robos' });
      console.log(`Open to launch: ${url}`);
    • Build the script that provisions the machine. Run it as root on an Ubuntu/Debian host: it installs Docker, generates the guardians' seed, uploads its encrypted backup to Salt, and starts the robo container with an automatic updater, reporting progress to RoboHost.listenToSetup as it goes.

      Returns string

      The script contents

      ValidationError if the host record no longer carries an OTP, i.e. it was already activated

      fs.writeFileSync('robos.sh', provisioning.generateScript(), { mode: 0o600 });