Deploying application
The deployment of a Cartesi rollups application has two main components: a Cartesi genesis machine, and a smart contract deployed to the base layer of choice.
Cartesi machine
The Cartesi genesis machine is produced by the cartesi build command, and must be installed alongside a Cartesi rollups node. The machine contains a hash that represents the initial state of the application (including the application itself). The hash can be obtained using the cartesi hash
command:
$ cartesi hash
? Cartesi machine templateHash 0xc87999b8a93609268b10de25f2e49d35f80fad92813310edc585ed644a9805d3
Any changes to the application code will result in a different hash, and hence will require a different deployment.
INFO
Upgradability of applications is a research topic and requires further discussions.
Smart contract
The smart contract that represents the application on the base layer can be deployed using the CartesiDAppFactory smart contract.
The following sections will describe two convenience methods to deploy an application:
- Self-hosted deployment: this method allows the developer to deploy the application node using their own infrastructure;
- Third-party service provider: this method allows the developer to select a service provider to run the application node on their behalf.