Skip to main content

=nil; CLI: getting started

Overview

The =nil; CLI is a tool for interacting with the cluster inside a terminal.

Initial setup

Install the =nil; CLI

The CLI is distributed as a standalone binary. To install it:

curl -fsSL https://github.com/NilFoundation/nil_cli/raw/master/install.sh | bash

Create a new config file

To create a config file for the =nil; CLI:

nil config init

Set the RPC endpoint

Initially, the =nil; CLI is unaware of the RPC endpoint for interacting with the cluster.

To set the RPC endpoint:

nil config set rpc_endpoint RPC_ENDPOINT
info

The testnet RPC endpoint provides access to the cluster and all related services including the faucet service and the Cometa service.

When running the cluster, the faucet service and the Cometa service locally, their endpoints will be different. This will require setting separate endpoints in the =nil; CLI config file:

cometa_endpoint: COMETA_ENDPOINT
faucet_endpoint: FAUCET_ENDPOINT
  • To learn more about running the faucet service locally, click here.
  • To learn more about running the Cometa service locally, click here.

Create a new private key

Creating a new private key is the next logical step before creating a new smart account.

nil keygen new

Create a new smart account

At this point, the only remaining action is to create a new smart account:

nil smart-account new

After running this command, the =nil; CLI should be fully ready to interact with the cluster.

tip

The smart account can be 'topped up' by using the smart-account top-up AMOUNT command.

info

The smart-account new and the smart-account top-up commands only work in the =nil; testnet. The process for attaining tokens and 'topping up' an address will be different in the production network.