Module

dcp/dcp-cli

Provide a standard set of DCP CLI options and related utility functions via yargs.

Author:
  • Eddie Roosenmaallen, eddie@kingsds.network

Methods

# inner base()

Generate a yargs object with some DCP options provided and hidden. To see these options pass --help --show-hidden.

DCP Common Options
--identity, -i               Identity keystore name
--identity-file, -I          Identity keystore file (overrides --identity)
                                        [string] [default: ~/.dcp/id.keystore]
--default-bank-account       Default Bank account keystore name
--default-bank-account-file  Default Bank account keystore file path
                             (overrides --default-bank-account)
                                   [string] [default: ~/.dcp/default.keystore]
--dcpConfig                  Alternate DCP configuration file to load [string]
--scheduler                  Specify scheduler to connect to/fetch dcp-client
                             from
                          [default: "https://scheduler.distributed.computer/"]
Example

Chain yargs commands

 const { start, end } = dcpCli.base('description')
 .options({
   start: {
     describe: 'Positive integer',
     type: 'number',
     default: 1,
   },
   end: {
     describe: 'Positive integer',
     type: 'number',
     default: 2,
   }   
 }).argv;

# async inner getAccountKeystore(hideWarningopt) → {module:dcp/wallet.AuthKeystore}

Default Account keystore as indicated by CLI options/DCP defaults

Parameters:
Name Type Attributes Default Description
hideWarning boolean <optional>
false

suppress the warning about unsafe permissions

The user's configured Account keystore

# async inner getIdentityKeystore() → {module:dcp/wallet.IdKeystore}

Get the Identity keystore indicated by the cli options/DCP defaults.

The user's configured Identity keystore