Files
nym/tools/nym-cli
Mark Sinclair 9874daa061 Release v1.1.0: bump versions and update CHANGELOGs (#1746)
* Bump version of nym-cli to 1.1.0 and move CHANGELOG to standalone file

* Bump version of nym-connect to v1.1.0 and update CHANGELOG

* Bump version of nym-wallet to v1.1.0 and update CHANGELOG

* Bump version of explorer-api to v1.1.0

* Bump versions of binaries (native-client, socks5-client, mixnode, gateway, network-requester) to v1.1.0

* Bump version of validator-api to v1.1.0

* Bump version of mixnet contract to v1.1.0 (vesting contract already v1.1.0 from #1472)

* Bump Nym Platform version to v1.1.0 and update CHANGELOG

* Update CHANGELOG.md

* Update CHANGELOG.md

* Updated changelog with v2-related changes

* Update CHANGELOG.md

Co-authored-by: Mark Sinclair <mmsinclair@users.noreply.github.com>
Co-authored-by: Fouad <fmtabbara@hotmail.co.uk>
Co-authored-by: Pierre Dommerc <dommerc.pierre@gmail.com>
Co-authored-by: Jędrzej Stuczyński <jedrzej.stuczynski@gmail.com>
Co-authored-by: Jess <31625607+jessgess@users.noreply.github.com>
2022-11-09 15:04:41 +00:00
..
2022-09-05 12:06:35 +01:00
2022-09-05 12:06:35 +01:00
2022-09-05 12:06:35 +01:00

Nym CLI

This is a CLI tool for interacting with:

  • the Nyx blockchain
  • the smart contracts for the Mixnet

It provides a convenient wrapper around the nymd client with similar functionality to thenyxd binary for querying the chain or executing smart contract methods.

And in the future it will provide an easy way to interact with Coconut, to issue and verify Coconut credenitals.

It DOES NOT do these things:

The infrastructure components that run a gateway, mixnode or Service Provider have their own binaries.

The socks5 client also has its own binary, or use NymConnect.

Installing

Download the CLI binary for your platform from https://nymtech.net/downloads or get a specific version from GitHub releases.

Configuration

The Nym CLI runs against mainnet by default.

If you want to use another environment, you can do this by:

  • providing a .env file
  • setting environment variables (see here for options)
  • passing named arguments

.env File

There are two ways to provide this:

  1. A file called .env in the same directory as the binary
  2. Pass the --config-env-file along with a command

Passing named arguments

You will need to pass the following with every command as an argument:

--mnemonic <MNEMONIC>                    
--nymd-url <NYMD_URL>                    
--mixnet-contract <MIXNET_CONTRACT_ADDRESS>      
--vesting-contract <VESTING_CONTRACT_ADDRESS>

How do I use it?

The simplest way to find out how to use the CLI is to explore the built-in help:

nym-cli --help

Features

🏦 Account

  • create a new account with a random mnemonic
  • query the account balance
  • query the account public key (needed to verify signatures)
  • query for transactions originating from the account
  • send tokens to another account

⛓ Block

  • query for the current block height
  • query for a block at a height
  • query for a block at a timestamp

🪐 cosmwasm

  • upload a smart contract
  • instantiate a smart contract
  • upgrade a smart contract
  • execute a smart contract method

𐄳 Mixnet

📒 Directory

  • query for mixnodes
  • query for gateways

🧑‍🔧 Operators

  • bond/unbond a mixnode or gateway
  • query for waiting rewards
  • withdraw rewards
  • manage mixnode settings

🥩 Delegators

  • delegate/undelegate to a mixnode
  • query for waiting rewards
  • withdraw rewards

✍ Sign

  • create a signature for string data (UTF-8)
  • verify a signature for an account

🕓 Vesting

  • create a vesting schedule
  • query for a vesting schedule

🥥 Coconut

Coming soon, including:

  • issue credential
  • verify credential

Building

Build the tool locally by running the following in this directory:

cargo build --release

Generating user docs

There is a Makefile with a target to build the user docs:

make generate-user-docs

Build the tool and run the generate command:

cargo build --release
../../target/release/nym-cli generate-fig > user-docs/fig-spec.ts

See https://github.com/withfig/autocomplete-tools/tree/main/types.