Skip to main content

deployment

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

Create and maintain deployments

Options:
-h, --help Show this message and exit

Commands:
create Deploy blockchain into container
info Information about a deployed blockchain
inspect Inspect the API of a deployed blockchain
update Update configuration of a deployed blockchain
resume Starts a paused blockchain in a container
pause Pauses a blockchain in a container
remove Removes a blockchain in a container (This action is permanent)

You can use the deployment command (chr deployment) to deploy your dapp to a network.

To deploy your dapp in a container, you use (chr deployment create):

Usage: chr deployment create [OPTIONS]

Deploy blockchain into container

Options:
-s, --settings SETTINGS Alternate path for the project settings file
(default: config.yml)
--secret PATH Path to secret file (pubkey/privkey)
-d, --network TEXT Specify which deployment target to use
-bc, --blockchain TEXT Name of blockchain to deploy
-h, --help Show this message and exit

The chr deployment create command reads the deployments key in the project config file. For the first deployment towards a target, the Chromia CLI prompts you with the chains config you need to add to the project config file. An example of such a prompt looks something like this:

Add the following to your project settings file
deployments:
testnet:
chains:
hello: x"<BlockchainRID>" #Dapp Blockchain RID
note

This prompt is your genesis Blockchain RID; you must save this in the config file. This is the identifier for all your following deployments to the chain.

If you already have a deployment and have not added the chain identifier in your Project Settings file, the command chr deployment overrides any previous deployment to the network. That's why saving the genesis Blockchain RID prompted after the first deployment is important.

note

If you want to override the state, ignore the chain identifier.

When you deploy, you create a snapshot build in the build/ folder with a timestamp by default. You can change this in the project config file in compile:target if you want a different target.

  • To deploy a dapp, you can run the following command when being in the working directory where the config.yml file presides:
chr deployment create --network testnet --secret .secret
  • Otherwise, you can set a path for the config.yml file or specify a different Project Settings file:
chr deployment create --settings config.yml --network testnet --secret .secret
  • If you have multiple chains and only want to deploy a specific one, you can write the command like this:
chr deployment create --settings config.yml --network testnet --blockchain hello --secret .secret

To get information about your dapp, you use (chr deployment create):

Usage: chr deployment info [OPTIONS]

Information about a deployed blockchain

Configured:

Information about a deployed blockchain

-d, --network TEXT Specify which deployment target to use
-bc, --blockchain TEXT Name of blockchain to deploy

Manual:

Information about a deployed blockchain that is not in the settings file

-brid, --blockchain-rid TEXT Target Blockchain RID
--url TEXT Target url

Options:
-s, --settings SETTINGS Alternate path for the project settings file
--verbose Show verbose information about nodes
-h, --help Show this message and exit

To inspect the API of your dapp, you use (chr deployment inspect):

Usage: chr deployment inspect [OPTIONS]

Inspect the API of a deployed blockchain

Configured:

Information about a deployed blockchain

-d, --network TEXT Specify which deployment target to use
-bc, --blockchain TEXT Name of blockchain to deploy

Manual:

Information about a deployed blockchain that is not in the settings file

-brid, --blockchain-rid TEXT Target Blockchain RID
--url TEXT Target url

Options:
-s, --settings SETTINGS Alternate path for the project settings file
-m, --modules MODULES Explicitly state which module to inspect (Comma
separated)
-h, --help Show this message and exit

To update your dapp, you use (chr deployment update):

Usage: chr deployment update [OPTIONS]

Update configuration of a deployed blockchain

Options:
-s, --settings SETTINGS Alternate path for the project settings file
(default: config.yml)
--secret PATH Path to secret file (pubkey/privkey)
-d, --network TEXT Specify which deployment target to use
-bc, --blockchain TEXT Name of blockchain to deploy
--height INT Deploy configuration at a specific height
-h, --help Show this message and exit

To pause your dapp, you use (chr deployment pause):

Usage: chr deployment pause [OPTIONS]

Pauses a blockchain in a container

Options:
-s, --settings SETTINGS Alternate path for the project settings file
(default: config.yml)
--secret PATH Path to secret file (pubkey/privkey)
-d, --network TEXT Specify which deployment target to use
-bc, --blockchain TEXT Name of blockchain to deploy
--description TEXT Description on why the blockchain is being acted on
-h, --help Show this message and exit

To start your paused dapp, you use (chr deployment resume):

Usage: chr deployment resume [OPTIONS]

Starts a paused blockchain in a container

Options:
-s, --settings SETTINGS Alternate path for the project settings file
(default: config.yml)
--secret PATH Path to secret file (pubkey/privkey)
-d, --network TEXT Specify which deployment target to use
-bc, --blockchain TEXT Name of blockchain to deploy
--description TEXT Description on why the blockchain is being acted on
-h, --help Show this message and exit

To remove your dapp, you use (chr deployment remove):

Usage: chr deployment remove [OPTIONS]

Removes a blockchain in a container (This action is permanent)

Options:
-s, --settings SETTINGS Alternate path for the project settings file
(default: config.yml)
--secret PATH Path to secret file (pubkey/privkey)
-d, --network TEXT Specify which deployment target to use
-bc, --blockchain TEXT Name of blockchain to deploy
--description TEXT Description on why the blockchain is being acted on
-h, --help Show this message and exit