Tutorial

First Dev Keystores

During our First Developers release, you will require two types of API keys (called 'keystores') in order to deploy your work to the network;

  • An Identity Keystore: This keystore acts as your personal credentials for using DCP. They may also be called Identity Keys, ID Keys, etc.
  • An Account Keystore: This keystore is used to keep track of the amount of value (called 'credits') that you have available. Note: Don't worry! Every First Developer is given a lot of credits, and we'll let you know how to get more for free when you need them.

Downloading Keystores

Both keystores can be downloaded from the Portal, which is also where you can check the amount of value left in your Account Keystore(s), and more.

Identity Keystores

Identity Keystores can be provisioned, downloaded, and revoked all from the First Devs tab in the Portal, once you have made an account.

Download Identity Keystore

Provisioning

New Identity Keystores can be provisioned by clicking the green "+" in the top-right of the table on this page. This will prompt you to enter a label and then the generated key will appear in the table.

Downloading

Identity Keystores can be downloaded by clicking on the green download button. This will prompt you to enter an optional passphrase to encrypt the keystore with (hit 'Continue' without entering anything in the passphrase field to leave them unencrypted), and will then prompt you to save the keystore file with the default name id.keystore.

We recommend saving your id.keystore file in your home directory at /home/<YOUR_USER_NAME>/.dcp/id.keystore (Linux & macOS), or C:\Users\<YOUR_USER_NAME>\.dcp\id.keystore (Windows). This is the default location where our APIs will look to find your identity keystore, which is needed to deploy a job.

Note: We recommend not changing the name of the id.keystore when you save it

Revoking

Identity Keystores can be revoked by clicking the red "-" to the right of the download button. This will immediately revoke the key's association to your account, so any keystore files that you have downloaded will stop working.

Account Keystores

Your Account Keystores are listed in the Accounts page on the portal. Your portal account will come with a 'default' Account Keystore, which has a balance of 0 credits if you did not register for our First Developers beta. If you did register, First Developers beta, your default keystore should show a balance of 10 credits soon afterward.

Accounts Tab UI

If you do not see 10 credits in your default keystore on the Accounts page, please sign up for the First Developers beta. If you have done this and still don't see 10 credits after logging out, logging back in, and waiting for up to 10 minutes, please send us a message on Slack or email us at info@distributed.computer. We'll get it sorted out right away!

You can use any Account Keystore to earn credits using the Portal's in-built Worker tab. All you have to do is go to the Worker tab and click the green "Start" button. This will start using your computer's processing power to complete computational jobs in exchange for credits that you can use to deploy your own work. You can stop this at any time by clicking "Stop" or exiting the browser tab. You can earn credits in more ways for free, which we'll be sharing by email once you're running low.

Downloading

Your Account Keystores can be downloaded from the Accounts page by clicking the arrow at the bottom of the keystore card, and then clicking "Download". We recommend saving this keystore file in your home directory at /home/<YOUR_USER_NAME>/.dcp/default.keystore (Linux & macOS), or C:\Users\<YOUR_USER_NAME>\.dcp\default.keystore (Windows). This is the default location where our APIs will look to find your Account Keystore, which is needed to deploy a job.

Download Account Keystore

Note: We recommend not changing the name of the default.keystore when you save it

Using Keystores From Web Apps That Use DCP

Providing the Account Keystore for deploying jobs from your browser is easy - the dcp-client APIs will automatically prompt you with a modal to upload your Account Keystore when you start deploying the job.

⚠️Warning The following is a temporary solution. It exposes your (revocable) Identity Keystore to the public. It will be replaced very soon with a long-term solution, and all First Developer Identity Keystores (but not Account Keystores!) will be revoked. ⚠️

To provide your Identity Keystore to launch a job (which is required alongside your Account Keystore), you must include your Identity Keystore in the web directory where your HTML is located. The dcp-client APIs will look for it when deploying your job, and warn you in the console if it could not be located.

Here is an example directory structure for how your app might be set up:

www/
  index.html
  id.keystore

Note: Most of our 'vanilla web' HTML examples in this documentation have already indicated this Identity Keystore. Therefore, when an example asks you to upload your 'keystore' to launch a job, it is asking only for your Account Keystore. This is not the case for vanilla web jobs that you build yourself, which should follow the example directory structure provided above.

Using Keystores from DCP for Node.js Apps

Using dcp-client APIs to build NodeJS apps is even easier - the APIs will look for your keystores in the default location: ~/.dcp. This is what your .dcp folder should look like:

.dcp/
  id.keystore
  default.keystore

If the keystores could not be found, the APIs will throw an error containing information about where they were searching for the files. You will have to move them into the appropriate file locations described above in order to launch a job without error.

Get Started

You are now ready to start deploying DCP jobs! Follow or continue through the rest of our getting started guide

FAQ

When Deploying A Job, The Error Says "Role DEPLOY is required"

This error most likely means your account has not been approved for the "First Developers" program. If you haven't yet, please sign up. If you have already done this and the issue is not resolved after a few minutes, please contact us on Slack or by email (info@distributed.computer).

If this error persists once your account is approved, this error could indicate that the Identity Keystore you are using is not associated with your Portal account. Check the Identity Keystore section of the First Devs tab in the Portal to confirm that the Identity Keystore you are trying to use is one of the ones listed in the table. If it is not, try creating and downloading a new Identity Keystores following the instructions above, and upload it when prompted instead of the one that caused the error.