6.5 DGT CLI and base transaction families
Each node has a CLI (Command Line Interface) service as a component. To run the CLI, you need to access the bash shell inside the container:
Inside, it is possible to enter commands regarding the node’s status and the testing families of transactions. Different families of commands may have some differences in options; here is a general view based on the dgt transaction family:
# | Command | Description | Example |
1 | dgt Family | A set of commands that provide basic information about the node and its environment, as well as a way to access the most important common functions. | |
1.1 | dgt settings list | Displays a list of settings for the node and current network. Since multiple nodes can be running in a container, a clarification in the form of a url flag is needed |
|
1.2 | dgt batch list | Displays a list of transaction batches: BATCH_ID, the number of transactions in a batch and signatures. Information can be exported to a file with the -F option and output redirection |
|
1.3 | dgt batch status | Status of the given batch with BATCH_ID shown (obtained, for example, from the dgt batch list command) |
|
1.4 | dgt batch submit | The command sends one or several batches to the validator. A batch is a binary file, coded in BatchList protobuf, represented by a FILENAME file. |
|
1.5 | dgt block list | Output of packed blocks as a list in NUM format: BLOCK_ID; BATS; TXNS; SIGNER |
|
1.6 | dgt block show | Shows the contents of a block, displayed on command dgt block show [-h] [--url URL] block_id |
|
1.7 | dgt keygen | Key pair generation (private and public). As a result, files are created in the specified directory: <key_dir>/<key_name>.priv and <key_dir>/<key_name>.pub Command format: dgt keygen [-h] [--key-dir KEY_DIR] [--force] [-q] [key_name]
-q – don’t display output --key-dir KEY_DIR – directory where keys are generated --force – files are overwritten |
|
1.8 | dgt peer list | List of addresses of connected validators. If there are no connected nodes, an empty string is displayed. |
|
1.9 | dgt state list | Printing entries in the ledger, returns the corresponding addresses in the format ADDRESS; SIZE;DATA |
|
1.10 | dgt state show | The command outputs a specific ledger entry for the given address: dgt state list [-h] [--url URL[-F {csv,json,yaml,default}] [--head HEAD][subtree]
Here: address – address in DAG; --head HEAD - specify the id of the block to set as the chain head |
|
1.11 | dgt transaction list | Returns a list of transactions for the given node. Command format: transaction list [-h] [--url URL] [-u USERNAME[:PASSWORD]] [-F {csv,json,yaml,default}] Default information output: Transaction_ID; Family; Vers,Size;Payload |
|
1.12 | dgt transaction show | Displays information about a specific transaction, requires TRANSACTION_ID: dgt transaction show [-h] [--url URL] [-k KEY] [-F {yaml,json}] transaction_id
--url URL identify the URL of the validator's REST API
-k KEY, --key KEY displays a single property from the block or header
|
|
1.13 | dgt dag show integrity | dag integrity check. dgt dag show integrity –url URL |
|
1.14 | dgt dag show val | List of vertices to join dgt dag show val –url URL
The number of the block: the block’s ID fragment (leaves for new blocks to join). For example, 0:30450221 112:30440220 |
|
2 | xcert Family | Management of node certificates. Several scenarios for joining a node to the network may require the creation of a relevant certificate. | |
2.1 | xcert set | Creation of a new certificate: Edit the PROJECT-FOLDER/etc/certificate.json file Generate a certificate with the command: xcert --user USER --url URL --keyfile KEYFILE --wait [WAIT] --before BEFORE --after AFTER –cb CRYPTO_BACK, here:
|
|
2.2 | xcert list | Output of previously generated certificates. Command format: xcert list --url URL --keyfile KEYFILE --cb CRYPTO_BACK |
|
2.3 | xcert show | Prints the specified certificate to the screen. Format: xcert show name The public key is used as the name (also accessible in the output of the xcert list command) |
|
2.4 | xcert upd | Certificate renewal, specified in the format: xcert upd VALUE --url URL --keyfile KEYFILE --before BEFOREDAYS --after AFTERDAYS Here: VALUE – link to the JSON – file with parameters; --url – node URL --keyfile – link to a certificate with a private key --before – the number of days before today’s date that allow the certificate to be considered valid --after – the link to the number of days after, which allow the certificate to be considered valid |
|
3 | dgtset | Topology transaction family | |
3.1 | dgtset genesis | Performed automatically when launching a node with a -G parameter, does not require repetition | ⚠ NOT RECOMMENDED FOR USE OUTSIDE OF DEVELOPMENT |
3.2 | dgtset proposal | This command is used only when launching a node and creates a command file (batch) for recording the genesis block – including the topology | ⚠ NOT RECOMMENDED FOR USE OUTSIDE OF DEVELOPMENT |
3.3 | dgtset topology | Displays the current topology: dgtset topology list –url URL The statistic topology is given in the CORE/etc/dgt.net.static file. It is loaded into the genesis block during the network initialization and is modified by topology commands |
|
4 | bgt Family | Test family of transactions; provides the creation of wallets and the transfer of abstract bgt tokens to them | |
4.1 | bgt set | Creation of a new wallet with a command format of: bgt set name value –url URL –keyfile KEYFILE –wait [WAIT] |
|
4.2 | bgt inc | Increasing the volume of tokens in the wallet: bgt inc name value --url URL --keyfile KEYFILE –wait [WAIT] |
|
4.3 | bgt dec | Reducing the number of tokens in the wallet: bgt inc name value --url URL --keyfile KEYFILE –wait [WAIT] |
|
4.4 | bgt trans | Transferring tokens from wallet to wallet: bgt trans name value to --url URL --keyfile KEYFILE --wait [WAIT] |
|
4.5 | bgt show | Shows the value of BGT Tokens for a given wallet: bgt show --url URL |
|
4.6 | bgt list | Displays all available wallets. bgt list --url URL |
|
Last updated