Command Line Interface
Command line (CLI) arguments are arguments specified after the RSK start class. See Config Options
New entry points (Java classes with static public main method) have been included from the RSK Hop Release v4.3.0.
The CLI arguments have two forms; the parameter and the flag:
- Parameter
- Has a name and an associated value, separated by a space
- Starts with a dash
- Flag
- It's a single text, without spaces
- Starts with a double dash
Find below a list of CLI flags and parameters available:
Parameters and Flags
Network related
The following CLI flags determine which network the Rootstock (RSK) node will connect to.
--main: This indicates that the configuration for the Rootstock Mainnet (public network) should be used.--testnet: This indicates that the configuration for the Rootstock Testnet (public network) should be used.--regtest: This indicates that the configuration for the Rootstock Regtest (localhost network) should be used.- Example:
java -cp rsk-core-<VERSION>.jar co.rsk.start --regtest
- Example:
- Only one of these three CLI flags should be specified.
- When none of these are specified, Rootstock Mainnet is used by default.
Database related
The Rootstock (RSK) node stores transactions, blocks, and other blockchain state on disk. This is known as the Blockchain Database.
-
--reset: This indicates that the block database should be erased, and should start from scratch, i.e. from genesis block. This is typically expected to be used when connecting to Rootstock Regtest, or in select debugging scenarios. It is also used when switching between different databases, e.g. betweenleveldbandrocksdb. -
--import: This indicates that the block database should be imported from an external source. This is typically expected to be used when connecting to Rootstock Testnet or Rootstock Mainnet, and when a reduction in "initial sync time" is desired. It is also used when switching between different databases, e.g. betweenleveldbandrocksdb.
Configuration related
--verify-config: This indicates that the configuration file used by this run of the Rootstock node should be validated. By default this step is always performed.--print-system-info: This indicates that the system information of the computer that the Rootstock node is running on should be output. By default, this is always output.--skip-java-check: This indicates that the detection of the version of the Java Virtual Machine that the Rootstock node is running in is supported. By default, this check is always performed, to ensure that the Rootstock node is running in a compatible environment.-base-path: This specifies the value ofdatabase.dir, where the blockchain database is stored.
Example:
java -cp rsk-core-<VERSION>.jar co.rsk.start -base-path home/rsk/data
-rpccorsThis specifies the value ofrpc.providers.web.corsto controlcors configuration.
Example:
java -cp rsk-core-<VERSION>.jar co.rsk.start -rpccors *
Command Line Tools
It worth highlight that for some commands below that interacts with the database, you might and should set the network flag desired, like
--regtest, --testnet or --main. Otherwise, the default network will be used, which is the Rootstock Mainnet (public network).