near CLI is a command line utility for working with the Near Protocol blockchain.
- ru Русский
In general, it is difficult for a beginner to immediately understand how commands work.
For example, I consider having the following command to do a transfer:
near tokens \
'volodymyr.testnet' \
send-near \
'fro_volod.testnet' \
'1 NEAR' \
network testnet \
sign-with-keychain \
send
This is the complete version of the command. The result of this command will be as follows:
Successful transaction
<volodymyr.testnet> has transferred 1 NEAR to <fro_volod.testnet> successfully.
Transaction ID: G4t6Sgz2FjnNpruYjPP1ZJAKfRmBffVaqmj8Nup2TaAg
To see the transaction in the transaction explorer, please open this url in your browser:
https://explorer.testnet.near.org/transactions/G4t6Sgz2FjnNpruYjPP1ZJAKfRmBffVaqmj8Nup2TaAg
Typing this or another command manually, you can make a mistake or forget the sequence of the command.
It is not a problem. --help
will tell you how to build a command properly.
However, using near CLI, you can press Enter anywhere in the command line and the interactive mode of the program will continue to compose the command from the place where you finished entering the necessary parameters.
At this stage of the development of the utility, installation of the program is not required.
It is enough to download the archive file suitable for your operating system installed on the computer and unzip it.
The resulting directory contains the executable file near CLI, which is accompanied by detailed user guide.
Detailed user guide is available in the file GUIDE.en.md.
The directory with access keys and available connection networks are defined in the configuration file (near-cli/config.toml
), which is located depending on the operating system in the following places:
- macOS:
$HOME/Library/Application Support
(e.g./Users/Alice/Library/Application Support
) - Linux:
$XDG_CONFIG_HOME
or$HOME/.config
(e.g./home/alice/.config
) - Windows:
{FOLDERID*RoamingAppData}
(e.g.C:\Users\Alice\AppData\Roaming
)
You can learn more about working with the configuration file here.
Prerequisites:
- near CLI is written in Rust, so you'll need to install Rust in order to compile it. near CLI compiles with Rust 1.80.0 (stable) or newer. In general, near CLI tracks the latest stable release of the Rust compiler.
- libudev-dev (Debian/Ubuntu:
apt install libudev-dev
)
To build near CLI:
$ git clone https://github.com/near/near-cli-rs.git
$ cd near-cli-rs
$ cargo build --release
$ ./target/release/near --version
near 0.17.0