Tutorial: Using the Ethereum Alarm Clock CLI

Logan Saether
ChronoLogicNetwork
Published in
4 min readAug 30, 2018

--

Example of the CLI on the author’s computer

Many people from the community are interested in running their own TimeNode. ChronoLogic has created a DApp which provides a natural and intuitive graphical interface for running a TimeNode. However, there is also a lesser-known CLI (commandline interface) which we have built as well. The following tutorial will guide those who are interested in running a TimeNode on the command line in how to set up their environment and get started.

Pro-tip: A TimeNode is an off-chain execution agent that acts as the counterparty to transactions that are scheduled on the Ethereum Alarm Clock. When someone schedules a transaction, it will later be executed by a TimeNode for profit.

For this tutorial, I assume that you are running either a Linux or OSX environment. If you are using Windows as your home operating system, consider creating an AWS micro instance or the smallest droplet on Digital Ocean to follow along. Even if you use Linux as your home operating system, it still may be a good idea to create a small Ubuntu instance on AWS or Digital Ocean. That way, you don’t need to worry about always keeping your computer on and connected to the internet. (Consult here if you don’t know how to set up a Digital Ocean droplet).

The first thing to do is set-up NodeJS and NPM environment on your OS. The recommended way to do this is by using nvm. You can look over the README for the best way to install it on your own OS, but the simplest way that will work almost anywhere is with curl.

curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash

Follow the instructions that print on your terminal if you want to use nvm right away. Otherwise, exit and re-enter your terminal and run nvm install v10.9.0 (or whatever version you want). You can run nvm ls-remote to view all possible versions. It doesn’t really matter which version you use, just try to use a recent one over v8.0.0.

Next, you will use npm to install the Ethereum Alarm Clock CLI.

npm i -g @ethereum-alarm-clock/cli

Protip: Make sure you include the -g flag which is the short version of --global so that the CLI is available to you globally.

The installation should take a few minutes. Once it completes test out that it works correctly by running eac --help which will print some output onto the terminal. If you get the help message when executing the command above, then you’ve correctly set up your environment and installed the CLI!

Good work so far!

The next step is creating a wallet which will host your TimeNode accounts. There are multiple ways to do this, the important part is that it has to be a v3 wallet (this is the keystore standard used by Geth and MyCrypto, among others, as the default). The CLI provides an easy command to do this:

eac createWallet

Follow the steps to create a new keystore file containing 1–10 different accounts. I recommend somewhere in between 3 -5 since you will need to fund each of these individually.

Once you follow the steps the list of addresses will print to your terminal. You will now need to fund these accounts. Ropsten is now the default network for the CLI, so if you intend to use the default testnet please make sure you ONLY SEND ROPSTEN ETHER to these addresses. If you need Ropsten ether, please contact @Saetherlogan on Telegram or use this faucet. You will only need about .15 eth for each account which will be sufficient to start claiming / executing transactions.

Your TimeNode is waiting to be funded

Once you’ve funded your TimeNode, you’re ready to start the CLI and begin claiming and executing transactions.

To start your TimeNode you will enter this command with the following flags (replace <…> with your information):

eac timenode --wallet <your_wallet> --password <your_password> --maxDeposit 0.1 --autostart --claiming

This will start your TimeNode with claiming enabled.

The logs will be in the same directory as the one in which your started your TimeNode process. Keep your TimeNode screen open and open a new terminal and enter the command:

tail -f .eac.log

You will see the stream of new logs for your TimeNode.

Your TimeNode also opened a REPL for which you to type commands. You can enter . and press Tab to see the full list of commands. (Some of the commands are general to the REPL and not TimeNode specific, feel free to explore).

One command you may be interested in is .logLevel <num> . If you would like to see all of the logs including DEBUG logs, use .logLevel 1 to enable them.

This should be good enough to get you started running the CLI TimeNode! If you have any questions please visit our Telegram channel.

--

--