sozo migrate
The migrate
command handles the deployment and updating process for your World, including contract declaration and deployment. It automatically manages the migration of your local World changes to remote environments.
World Address Configuration
To update an existing World, configure the world address in your profile configuration (e.g., dojo_dev.toml
):
[env]
world_address = "0x06171ed98331e849d6084bf2b3e3186a7ddf35574dd68cab4691053ee8ab69d7"
When sozo migrate is executed, it:
- Detects the world_address from your profile configuration
- Compares local and remote World states
- Generates migration strategy
- Deploys necessary updates upstream
USAGE
Usage: sozo migrate [OPTIONS] <COMMAND>
Commands:
help Print this message or the help of the given subcommand(s)
OPTIONS
World Options
--world
WORLD_ADDRESS
The address of the World contract.
ENV: DOJO_WORLD_ADDRESS
Starknet Options
--rpc-url
URL
The Starknet RPC endpoint. [default: http://localhost:5050]
ENV: STARKNET_RPC_URL
Account Options
--account-address
ACCOUNT_ADDRESS
The Starknet account address.
ENV: DOJO_ACCOUNT_ADDRESS
IPFS Options
If you provide your IPFS credentials, sozo
can automatically upload metadata
of the world and its resources to IPFS, and register IPFS URIs to the ResourceMetadata
model of the world.
You can either provide these credentials through command-line arguments, through environment variables
or through your dojo_<profile>.toml
.
--ipfs-url
URL
The URL of the IPFS client to use.
or DOJO_IPFS_URL
environment variable, or ipfs_url
in your profile configuration file.
--ipfs-username
USERNAME
The username to use for the IPFS client.
or DOJO_IPFS_USERNAME
environment variable, or ipfs_username
in your profile configuration file.
--ipfs-password
PASSWORD
The password to use for the IPFS client.
or DOJO_IPFS_PASSWORD
environment variable, or ipfs_password
in your profile configuration file.
Signer Options - Raw
--private-key
PRIVATE_KEY
The raw private key associated with the account contract.
ENV: DOJO_PRIVATE_KEY
Signer Options - Keystore
--keystore
PATH
Use the keystore in the given folder or file.
--password
PASSWORD
The keystore password. Used with --keystore.
ENV: DOJO_KEYSTORE_PASSWORD
EXAMPLES
- Deploying your World for the first time to a local Katana node
sozo migrate
- Updating existing World (requires world_address in profile):
[env]
world_address = "0x123456..."
sozo migrate
- Deploying your World using profile options, where configuration like
rpc-url
are set in the profile.
sozo --profile my_profile migrate
MANIFESTS
The migrate
command will generate the manifests in manifest_<profile_name>.json
at your project root.
This file contains essential information about the contracts at compile time.
- It shows the state of the world onchain.
- It's designed to be consumed by SDKs.
- It maintains declarative information about the world, tracked in Git to monitor changes.