Setup your Environment
Shell variables will be used throughout these guides to make the instructions so that the CLI commands in the documentation can be copied and pasted easily without editing at all. Below is a list of variables used and how to populate them.
Note it is important to type the commands into a terminal where the variables have been defined. Closing or changing terminals will mean that you have to re-define your shell variables.
Environment Variables
NEXQLOUD_NET
Nexqloud network configuration base URL.
NEXQLOUD_VERSION
Nexqloud version to install for your network.
NEXQLOUD_CHAIN_ID
Chain ID of the Nexqloud network for IBC.
NEXQLOUD_NODE
Nexqloud RPC endpoint URL and port number.
NEXQLOUD_KEY_NAME
Key name of your choosing. This documentation uses a value of "alice".
NEXQLOUD_KEYRING_BACKEND
Keyring backend to use for local keys. One of os (default), file, test.
Environment Variables and flags
Generally, every parameter set by CLI flag used by nexqloud can be also set via environment variable. Use following rule of binding flag to the corresponding environment variable
every dash
-must be replaced with underscore_.--prefix must not be accounted!make all characters capital case
add prefix
NEXQLOUD_to the result
for example flag --keyring-backend binds to NEXQLOUD_KEYRING_BACKEND environment variable
The precedence is defined in the table below. 0 means highest priority
0
Environment variable
1
Flag
2
Config file
3
Default value
Example below shows value precedence for --keyring-backend parameter.
use default value set to
os
provider-services tx deployment create ...
#keyring-backend=os is useduse value set by flag
--keyring-backend=file
provider-services tx deployment create --keyring-backend=file ...
#keyring-backend=file is used use value set by environment variable
NEXQLOUD_KEYRING_BACKEND=test
export NEXQLOUD_KEYRING_BACKEND=test
provider-services tx deployment create --keyring-backend=file ...
#keyring-backend=test is used Key Name
First, configure the name of your key. The command below will set the name of your key to alice, run the below command and replace alice with a name of your choice:
NEXQLOUD_KEY_NAME=aliceKey Ring Backend
Set the Key Ring Backend that you will use to store your key locally. The default is os and will store the key in your operating system, protected by your login password. You can change this to file or test.
NEXQLOUD_KEYRING_BACKEND=osNetwork
First, configure the base URL ($NEXQLOUD_NET) for the Nexqloud Network; copy and paste the command below:
NEXQLOUD_NET="https://raw.githubusercontent.com/nexqloud-network/net/main/mainnet"Version
Next, configure the version of the Nexqloud Network NEXQLOUD_VERSION; copy and paste the command below:
NEXQLOUD_VERSION="$(curl -s "$NEXQLOUD_NET/version.txt")"Chain ID
The nexqloud CLI will recognize NEXQLOUD_CHAIN_ID environment variable when exported to the shell.
export NEXQLOUD_CHAIN_ID="$(curl -s "$NEXQLOUD_NET/chain-id.txt")"RPC Endpoint
Print a random RPC endpoint. The nexqloud CLI will recognize NEXQLOUD_NODE environment variable when exported to the shell.
export NEXQLOUD_NODE="$(curl -s "$NEXQLOUD_NET/rpc-nodes.txt" | shuf -n 1)"
echo $NEXQLOUD_NODEAPI Endpoint
Print a random API endpoint.
curl -s "$NEXQLOUD_NET/api-nodes.txt" | shuf -n 1Last updated