Skip to main content

The Lightning CLI provides a wide range of capabilities, including running the node, accessing key management utilities, network participation management and printing the loaded configuration.

Its user-friendly interface provides detailed information about each command through the help sub-command, making it easy to navigate and operate efficiently.

tip

A quick reference of frequently used commands are available for native and docker setups.

Commands

The commands are the interface in which users enter specific commands and options for the Fleek Network to process.

Run

The command to run allows you to start the node process in Fleek Network.

Here's a basic example of how to run a node with default settings:

lgtn run

On the other hand, the default setup provided by the get.fleek.network assisted installer is quite verbose and explicitly defines the configuration path.

lgtn -c /home/user/customPath/config.toml -vv run

Keys

Key management utilities to show (print the node's public keys) or generate private keys. For example, to generate new private keys execute:

lgtn keys generate

Two private keys are created in the signer configuration paths defined in the configuration (default ~/.lightning/config.toml).

For example, if the configuration file declares the signer consensus_key_path and node_key_path as follows:

[signer]
consensus_key_path = "/home/<USERNAME>/.lightning/keystore/consensus.pem"
node_key_path = "/home/<USERNAME>/.lightning/keystore/node.pem"

The private keys will be placed in the corresponding locations, as defined for the consensus_key_path (/home/<USERNAME>/.lightning/consensus.pem) and node_key_path (/home/<USERNAME>/.lightning/node.pem) file paths.

warning

The <USERNAME> is a placeholder for the actual system username. So, make sure that you have declared the correct path corresponding to your preferred system username.

Opt

The Opt command allows the user to opt into or out of Network participation.

info

Node participation can be true or false (online or offline) throughout an Epoch. Participation is in a transient state when the operator requests to opt in or out, and the network has yet to end the undergoing Epoch. Once the Epoch ends, the Node participation transitions to true or false. Therefore, a Node Operator can expect a Node state to be online, offline, opted in or out during an Epoch lifetime.

Before starting the service, make sure to opt-in or opt-out of network participation, through the available subcommand opt in the CLI.

The quickest way to find help is to run the help subcommand as follows:

lgtn opt help

To learn more, read the Lightning-CLI section for command opt.

To opt-in, use the subcommand in:

lgtn opt in

Once successful, you will receive a confirmation text message as feedback, notifying you of your inclusion in the next Epoch.

Opt-out of network participation by using out (note that this command should be sent before shutting down the node to avoid reputation penalties). Similarly, should shutdown only after the Epoch ends to mitigate any participation faults.

lgtn opt out
warning

To prevent any negative impact on the node's reputation, it's advisable to wait until the end of the Epoch (~24h) before shutting down the node when opting out. The same applies to nodes that have opted-in but are currently offline.

To learn more, read the Lightning-CLI section for command opt.

tip

Shutting down a Node after an Epoch can be tedious, given the remaining time an Epoch can take to end. Doing it prematurely, will cause reputation penalties, e.g. shutting down before the participation state change to offline. Therefore, a shutdown utility is available in the Tools menu option of get.fleek.network.

To access it, execute the command:

curl https://get.fleek.network | bash

To query the node participation status in the network, use the subcommand status.

lgtn opt status
tip

Network participation control can be carried out regardless of whether the node is started or online.

Print the loaded configuration.

Options

The Options flags allows further control or override default settings:

  • -c, or --config, path to the toml configuration file which defaults to ~/.lightning/config.toml
  • --with-mock-consensus, determines use of mock consensus backend
  • --with-console, enable the Tokio Console asynchronous debugger
  • --with-log-locations, enable code locations when printing logs
  • -v, increases the level of verbosity (the max level is -vvv)

Help

lgtn help
Usage: lgtn [OPTIONS] <COMMAND>

Commands:
run Run the full node
keys Key management utilities
opt Opt into or opt out of network participation
print-config Print the loaded configuration
help Print this message or the help of the given subcommand(s)

Options:
-c, --config <CONFIG> Path to the toml configuration file [default: ~/.lightning/config.toml]
--with-mock-consensus Determines that we should be using the mock consensus backend
--with-console Enable the Tokio Console asynchronous debugger
--with-log-locations Enable code locations when printing logs
-v... Increases the level of verbosity (the max level is -vvv)
-h, --help Print help
-V, --version Print version

Find help for a specific option

Use the subcommand help after the command. Here's an example to find help for the command keys:

lgtn keys help
Key management utilities

Usage: lgtn keys [OPTIONS] <COMMAND>

Commands:
show Print the node's public keys
generate Generate new private keys. This command will fail if the keys already exist
help Print this message or the help of the given subcommand(s)

Options:
-c, --config <CONFIG> Path to the toml configuration file [default: ~/.lightning/config.toml]
--with-mock-consensus Determines that we should be using the mock consensus backend
--with-console Enable the Tokio Console asynchronous debugger
--with-log-locations Enable code locations when printing logs
-v... Increases the level of verbosity (the max level is -vvv)
-h, --help Print help
Helder Oliveira
Helder OliveiraSoftware Developer + DXGot questions? Find us on discord!