Skip to main content

node

Usage: chr node [OPTIONS] COMMAND [ARGS]...

Interact with a test node

╭─ Options ───────────────────────────────────────────────────────────────────╮
│ -h, --help Show this message and exit
╰─────────────────────────────────────────────────────────────────────────────╯
╭─ Commands ──────────────────────────────────────────────────────────────────╮
│ start Starts a test node
│ update Updates a running test node
╰─────────────────────────────────────────────────────────────────────────────╯

You can use the node command (chr node) to start or update a node with your applications running on it.

node start

To start your node, you use (chr node start).

Usage: chr node start [<options>]

Starts a test node

If a blockchain has already been started on the configured database schema,
the configuration will be added to the next height such that the node will be
started with the new config. Use --wipe to wipe the database schema upon
startup and thus enforce starting the chain from height=0.

Configuration Properties:
-s, --settings=<settings> Alternate path for project settings file

Options:
-bc, --blockchain-config=<path>
Manually specify which blockchain-configs to
run
--name=<name> Only start specified blockchains (multiple)
-p=<key=value> Override any property value (usage: -p
key=value)
-np, --node-properties=<path> Full path to override node properties file
--directory-chain-mock Adds a blockchain on ID 0 that responds to the
cluster management api and anchoring api. Used
together with integration tests involving
frontend clients. Can be used with node
discovery features, ICCF and cross-chain
transfers using the FT-protocol
--sql-log Log sql expressions
--wipe / --no-wipe If a database should be wiped before startup
-h, --help Show this message and exit

By default, it starts each blockchain under the blockchains key in your project config file (chromia.yml).

  • If you are in the working directory where the chromia.yml presides:
chr node start
  • You can set a path for the Project Settings file or specify a different file:
chr node start --settings chromia.yml
  • If you instead want to start a node from a build, you can refer to the blockchain config file:
chr node start --blockchain-config build/my_rell_dapp.xml

You can use the --wipe option to reset the database before execution and use the -np or --node-properties if you want to override the default node settings.

You can use the --name option to specify which blockchain to start from the blockchains set in chromia.yml. If you have specified multiple blockchains, you can chain them to start multiple blockchains at once.

#chromia.yml

blockchains:
foo:
module: main
bar:
module: main
...
  • Start one blockchain named foo:
chr node start --name foo
  • Start two blockchains named foo and bar:
chr node start --name foo --name bar

node update

To make updates to a local running node, you use (chr node update):

Usage: chr node update [<options>]

Updates a running test node

Will add a configuration to a block height 5 higher that current height for
the running blockchain. Make sure this command is executed with exactly the
same chromia.yml and arguments as was used when starting the node using chr
node start to make sure configurations are added to the correct chain ids.

Configuration Properties:
-s, --settings=<settings> Alternate path for project settings file

Options:
-bc, --blockchain-config=<path>
Manually specify which blockchain-configs to
run
--name=<name> Only start specified blockchains (multiple)
-p=<key=value> Override any property value (usage: -p
key=value)
-np, --node-properties=<path> Full path to override node properties file
--directory-chain-mock Adds a blockchain on ID 0 that responds to the
cluster management api and anchoring api. Used
together with integration tests involving
frontend clients. Can be used with node
discovery features, ICCF and cross-chain
transfers using the FT-protocol
-n, --preemption=<int> Update the configuration at a height this many
blocks into the future
-h, --help Show this message and exit