Files
nym/tools/nym-cli
Jędrzej Stuczyński 51b511b27e Rebased the branch one more time
WIP; rebasing

Another branch squash

Squashing the v3 branch

changing min pledge amounts

logic for adding new nymnode into the contract

converting mixnode/gateway bonding into nym-node bonding

logic for migrating gateways into nymnodes

ibid for mixnodes

further nym-node work + fixed most existing unit tests

forbid nymnode migration with pending cost params changes

preassign nodeid for gateways

changing role assignment and epoch progression

changing role assignment and epoch progression

optional custom http port

logic for unbonding a nym-node

updating Delegation struct

logic for increasing pledge of either mixnode or nymnode

logic for decreasing pledge of either mixnode or a nym node

logic for changing cost params of either mixnode or a nym node

wip

initialise nymnodes storage

fixing transaction tests

fixed naive family tests

reward-compatibility related works

resolving delegation events

introduced rewarded set metadata

another iteration of restoring old tests

updated rewarding part of nym-api

parking the branch

unparking the branch

wip

purged families

added 'ExitGateway' role

passing explicit work factor for rewarding function

remove legacy layers storage

wip: node description queries

added announced ports to self-described api

step1 in gruelling journey of adding node_id to gateways

ensure epoch work never goes above 1.0

changed active set to contain role distribution

[theoretically] sending rewarding messages for the new rewarded set

[theoretically] assigning new rewarded set

reimplementing more nym-api features

remove legacy types

re-implement legacy network monitor

restoring further routes + minor refactor of NodeStatusCache

skimmed routes now return legacy nodes alongside nym-nodes

seemingly restored all functionalities in nym-api

removing more legacy things from the contract

initial contract cleanup

added nym-api endpoints to return generic annotations regardless of type

updated simulator to use new rewarding parameters

more contract cleanup

made existing mixnet contract tests compile

extra validation of nym-node bonding parameters

fixed additional compilation issues

fixed nym-api v3 database migration failure

added additional nym-node contract queries

updated the schema

made additional delegation/rewards queries compatible with both legacy mixnodes and nym-nodes

fixing existing unit tests in mixnet contract

wip

resolved first batch of 500 compiler errors

re-deprecating routes

making wallet's rust backend compile

fixed non-determinism in contract + nym-api build

fixes to the build

populating cotracts-cache with nym-nodes data

more missing nymnodes queries

temp mixnet contract methods + restored result submission in nym-api

allow deprecated routes

submitting correct results for mixnode results

removed deprecated re-export of AxumAppState and removed smurf naming

moved axum modules into support::http

cleaning up nym-api warnings

determine entry gateways before exits

exposed transaction to update nym-node config

missing memo for updating node config

 new routes

added routes to swagger and fixed relative paths

fixed some macro derivations

added nym-node commands to nym-cli
2024-10-10 13:27:05 +01:00
..
2024-10-10 13:27:05 +01:00
2023-03-10 17:10:27 +01:00
2024-09-23 10:00:20 +02:00
2022-09-05 12:06:35 +01:00
2023-03-23 16:36:10 +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 nyxd 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 most commands as arguments:

--mnemonic <MNEMONIC>                    
--nyxd-url <nyxd_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
  • create payload for family creation signature
  • create family

🥩 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.