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.
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 │
│ --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/hello.gtv
chr node start --blockchain-config build/hello.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
andbar
:
chr node start --name foo --name bar
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 │
│ -n, --preemption=INT Update the configuration at a height this many blocks into the future (default: 2) │
│ -h, --help Show this message and exit │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯