Links
Comment on page

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:
npm install -g ethernal

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.
ethernal login
You can also skip the login command and use env variables:
ETHERNAL_EMAIL=[email protected] ETHERNAL_PASSWORD=yourpwd ethernal listen

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.
ethernal listen
Or for a different workspace:
ethernal listen -w staging
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
ethernal listen -l
And if you are on a remote server hosting the chain, and you don't want to watch for contracts, you can run:
ethernal listen -s
By default, only the name and the ABI of the contract are going to be uploaded. If you want to use the "Storage" tab of contracts page, you'll need to have the AST uploaded as well. To do so, pass the --astUpload flag as a parameter (this will upload the ast field, as well as the source field).
ethernal listen --astUpload

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
-a
astUpload
Upload AST to decode storage
true
-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
ethernal reset [workspace]