Skip to content

Latest commit

 

History

History
77 lines (46 loc) · 3.59 KB

getting-started-on-gcp.md

File metadata and controls

77 lines (46 loc) · 3.59 KB

Getting Started on Google Cloud Platform

Before installing and using the Darknode CLI, make sure that you have created a Google Account and configured billing for Google Cloud Platform, and created a Project.

Enabling the APIs

You need to enable both the Cloud Resource Manager API and the Compute Engine API. Make sure your project is selected and you're using the correct google account.

You should be able to see something like these if you successfully enable the APIs.

Visual representation of a block Visual representation of a block

Create a Service Account

Create a Service Account in your project. During creating, grant it the role of Project > Editor, and download a key in JSON format. You will have to pass this JSON Key file path to the Darknode-CLI

Creating a Service account

Creating a service account

Assigning a role

Creating a service account

Creating a service account

Generating a JSON Key

Creating a service account

Save the key to a secure place and remember the path where you save it. You'll use it for deploying darknodes.

Installing the Darknode CLI

To install the Darknode CLI, open a terminal and run:

curl https://www.github.com/renproject/darknode-cli/releases/latest/download/install.sh -sSfL | sh

Once this has finished, close the terminal and open a new one.

Deploying a Darknode

Now, you can deploy a Darknode. Think of a catchy name, and run:

darknode up --name my-first-darknode --gcp --gcp-credentials PATH_TO_YOUR_DOWNLOADED_JSON_FILE

Once this has finished, it will give you a link that you can use to register your Darknode and send it ETH.

Congratulations! You have deployed your first Darknode. You can deploy as many as you like, distinguishing between them by their names. If you forget what you called them, you can list all available Darknodes by running:

darknode list

Choosing a compute zone

You can specify in which Compute Engine Zone you deploy your node with the --gcp-zone flag. If omitted, a random zone is selected.

darknode up --name my-first-darknode --gcp --gcp-credentials PATH_TO_YOUR_DOWNLOADED_JSON_FILE --gcp-zone europe-west1-b

Choosing a machine type

You can specify with which Machine Type you deploy your node with the --gcp-machine-type flag. If omitted, n1-standard-1 is selected.

darknode up --name my-first-darknode --gcp --gcp-credentials PATH_TO_YOUR_DOWNLOADED_JSON_FILE --gcp-machine-type f1-micro

How to fix a faulty installation/deploy or reinstall

You can use the configuration file to fix a registered node that didn't deploy right or doesn't connect. Simply deploy another node without registering, then copy the config.json file from the faulty installation to the new node installation both locally and remote. Locally the file will be located on ~/.darknode/darknodes/YourNodeName/config.json and remotely /home/darknode/config.json. Once copied, the node and CLI should automatically connect.