The Darknode CLI is a command-line interface for managing Darknodes on Ren. It is installed on your local workspace, and will automatically create and update machines for you. Currently it supports macOS, Linux and Window(see Windows Instructions).
To jump straight into running your first Darknode on AWS, checkout our Getting Started on AWS tutorial.
Checkout the instructions for Creating a Personal Access Token on Digital Ocean.
To download and install the Darknode CLI, open a terminal and run:
curl https://www.github.com/renproject/darknode-cli/releases/latest/download/install.sh -sSfL | shThis will download the required binaries and install them to the $HOME/.darknode directory. Open a new terminal to begin using the Darknode CLI.
Before updating the Darknode CLI, please make sure you do not have the CLI running in any terminal.
To update your Darknode CLI, open a terminal and run:
curl https://www.github.com/renproject/darknode-cli/releases/latest/download/update.sh -sSfL | shNote: make sure you are using Terraform version 0.12! To upgrade Terraform, download the executable for your operating system from https://www.terraform.io/downloads.html and copy it to
$HOME/.darknode/bin/terraform.
This will update your Darknode CLI to the latest version without affecting any of your deployed nodes.
Here there be dragons!
These guidelines are for advanced users. If you just want to see what deploying a Testnet Darknode is like, checkout our Getting Started on AWS tutorial.
To deploy a Darknode on AWS, open a terminal and run:
darknode up --name my-first-darknode --aws --aws-access-key YOUR-AWS-ACCESS-KEY --aws-secret-key YOUR-AWS-SECRET-KEYThe Darknode CLI will automatically use the credentials available at $HOME/.aws/credentials if you do not explicitly set the --access-key and --secret-key arguments.
By default it will use the credentials of default profile,but you can specify which profile you want to use for deployment by:
darknode up --name my-first-darknode --aws --aws-profile PROFILE-NAMEYou can also specify the region and instance type you want to use for the Darknode:
darknode up --name my-first-darknode --aws --aws-access-key YOUR-AWS-ACCESS-KEY --aws-secret-key YOUR-AWS-SECRET-KEY --aws-region eu-west-1 --aws-instance t2.smallThe default instance type is t3.micro and region will be random.
You can find all available regions and instance types at AWS.
Follow the steps in the tutorial to create a API token. To deploy a Darknode on Digital Ocean, open a terminal and run:
darknode up --name my-first-darknode --do --do-token YOUR-API-TOKENYou can also specify the region and droplet size you want to use for the Darknode:
darknode up --name my-first-darknode --do --do-token YOUR-API-TOKEN --do-region nyc1 --do-droplet s-2vcpu-2gbThe default droplet size is s-1vcpu-1gb and region will be random.
Be aware some region and droplet size are not available to all users.
You can find all available regions and droplet size slug by using the digital ocean API.
The darknode-cli will show a link for registering your darknode after finish deploying. Don't panic if you lose the url. Simply run
darknode register YOUR-DARKNODE-NAMEwhich prints the registering link in the terminal and tries to open the url using your default browser.
WARNING: Before destroying a Darknode make sure you have de-registered it, and withdrawn all fees earned! You will not be able to destroy your darknode if it's not fully deregistered. The CLI will guide you to the page where you can deregister your node
Destroying a Darknode will turn it off and tear down all resources allocated by the cloud provider. To destroy a Darknode, open a terminal and run:
darknode destroy my-first-darknodeTo avoid the command-line prompt confirming the destruction, use the --force argument:
darknode destroy my-first-darknode --forceWe do not recommend using the --force argument unless you are developing custom tools that manage your Darknodes automatically.
To resize the instance type your Darknode is using, open a terminal and run:
darknode resize YOUR-DARKNODE-NAME NEW_INSTANCE_TYPEIf you are using AWS, you will need to replace the NEW_INSTANCE_TYPE field with the AWS EC2 instance type you wish to use, e.g. t3.micro or t2.medium."
darknode resize YOUR-DARKNODE-NAME t3.smallYou can find all available instance types at AWS.
If you are using DigitalOcean, you will need to replace the NEW_INSTANCE_TYPE field with the DigitalOcean droplet slug you wish to use, e.g. s-1vcpu-2gb or s-1vcpu-1gb.
darknode resize YOUR-DARKNODE-NAME s-1vcpu-2gbChanging droplet size will not change the storage volume of the instance, this allows user to resize down to a lower plan in the future. You can find all available droplet slugs at Digital Ocean Standard plans and DigitalOcean API Slugs
If you accidentally try to resize to a invalid instance, the darknode will be stopped. You need to run the command again with a valid instance type to restart the darknode.
The Darknode CLI supports deploying multiple Darknodes. To list all available Darknodes, open a terminal and run:
darknode listTo turn off your darknode, open a terminal and run:
darknode stop my-first-darknode
Note this won't shut down the cloud instance so you will still be charged by your cloud provider.
If it is already off, stop will do nothing.
To turn on your darknode, open a terminal and run:
darknode start my-first-darknodeIf it is already on, start will do nothing.
To restart your darknode, open a terminal and run:
darknode restart my-first-darknodeTo access your Darknode using SSH, open a terminal and run:
darknode ssh my-first-darknodeTo update your Darknode to the latest stable version, open a terminal and run:
darknode update YOUR-DARKNODE-NAMETo update the configuration of your darknode, first edit the local version of config, by running:
nano $HOME/.darknode/darknodes/YOUR-DARKNODE-NAME/config.jsonand now run:
darknode update my-first-darknode --configTo withdraw any ETH left in the darknode address, open a terminal and run:
darknode withdraw YOUR-DARKNODE-NAME --address RECEIVER-ETHEREUM-ADDRESSNote: This will also withdraw any REN in the darknode address. Keep in mind this will only withdraw the ETH and REN the address holds directly, not the rewards it receives by matching orders.
If you want to run a specific command on your darknode. open a terminal and run:
darknode exec YOUR-DARKNODE-NAME --script "whoami"or a script file
darknode exec YOUR-DARKNODE-NAME --file test.shYou can set the GITHUB_TOKEN environment variable to increase your github rate limit.
