CLI
Learn how to use the Ethernal CLI
The CLI serves two purposes:
  • Synchronizing blocks & transactions with your dashboard
  • Synchronizing contract's artifact data for Truffle projects
Artifact data for Hardhat projects are synchronized with a plugin

Installation

Install the CLI globally with the following command:
1
npm install -g ethernal
Copied!

Logging In

If you haven't done so already, this is the first thing to do after installing. Your email is stored in ~/.config/configstore/ethernal.email.json. Your password is stored in your local keychain. You only need to login once. If you need to log in with another account, you can just run the command again.
1
ethernal login
Copied!
You can also skip the login command and use env variables:
1
ETHERNAL_EMAIL=[email protected] ETHERNAL_PASSWORD=yourpwd ethernal listen
Copied!

Listening to transactions

To listen to transactions, the CLI will pull the server address of the latest used workspace. If you want to specify a different workspace you can use the -w flag.
1
ethernal listen
Copied!
Or for a different workspace:
1
ethernal listen -w staging
Copied!
If the passed workspace name is not found, it will default to the latest used.
When starting the CLI, it will automatically synchronize all blocks & transactions that are missing (if some happened when the CLI wasn't running for example).

Watching contracts artifacts (Truffle projects only)

If you are using Hardhat, head to this section.
The CLI will also watch by default your artifacts if you have run it in a Truffle project (there needs to be a truffle-config.js file in the directory).
If you are looking to set up a Truffle project:
If your chain is not running locally and you don't want to listen to transactions, but only synchronize artifacts, you can run
1
ethernal listen -s
Copied!
And if you are on a remote server hosting the chain, and you don't want to watch for contracts, you can run:
1
ethernal listen -l
Copied!

Parameters

Parameter
Alias
Description
Default
-w
workspace
Specify the workspace to connect to
Latest used / First Created
-d
dir
Specify the directory to watch for artifact change. You can pass multiple parameters by using a comma as a separator.
. (current directory)
-s
server
Do not watch for artifact change - only listen for transactions
false
-l
local
Do not listen for transactions - only watch for contract changes
false

Resetting a workspace

This will delete all accounts/blocks/transactions/contracts from a specific workspace
1
ethernal reset [workspace]
Copied!
Last modified 15d ago