| Last Updated | Version | Verified Against | Test Sources | Implementation |
|---|---|---|---|---|
2025-06-26 |
Latest (main branch) |
crates/cli/src/project/config.rs:16-33 |
crates/cli/src/templates/collector.rs:154-200 |
crates/cli/src/project/config.rs, crates/cli/src/cli/config.rs |
This document provides a complete reference for configuring Tari CLI projects.
Every Tari project requires a tari.config.toml file in the project root for deployment and network settings.
[network]
wallet-daemon-jrpc-address = "http://127.0.0.1:9000/"Required Fields:
wallet-daemon-jrpc-address(string): JSON-RPC URL of the running Tari Wallet Daemon- Default:
http://127.0.0.1:9000/ - Format: Full HTTP/HTTPS URL with port
- Example:
http://127.0.0.1:9000/for local development
- Default:
The CLI itself can be configured via command-line arguments or environment variables.
Templates are discovered via template.toml descriptor files in template repositories.
name = "basic-template"
description = "A basic Tari template for smart contract development"
# Optional: Custom template directory
[extra]
templates_dir = "templates"Required Fields:
name(string): Template identifier (converted to snake_case)description(string): Human-readable template description
Optional Fields:
[extra]section: Additional template metadatatemplates_dir(string): Subdirectory containing template fileswasm_templates(string): Directory for WASM-specific templates
Templates can be organized in two ways:
- Root-level templates:
template.tomlin repository root - Subdirectory templates:
template.tomlin dedicatedtemplates/folder
Example repository structure:
template-repo/
├── template.toml # Root template
├── templates/ # Alternative: subdirectory templates
│ ├── basic/
│ │ └── template.toml
│ └── advanced/
│ └── template.toml
└── src/ # Template source files
tari create [OPTIONS] <NAME>
Arguments:
<NAME> Name of the project
Options:
-t, --template <TEMPLATE> Selected project template (ID)
--output <PATH> Output folder [default: current directory]
-h, --help Print helptari generate [OPTIONS] <NAME>
Arguments:
<NAME> Name of the template
Options:
-t, --template <TEMPLATE> Selected WASM template (ID)
--output <PATH> Output folder [default: current directory]
-h, --help Print helptari deploy [OPTIONS] <TEMPLATE>
Arguments:
<TEMPLATE> Template project to deploy
Options:
-a, --account <ACCOUNT> Account for deployment fees
-c, --custom-network <NETWORK> Custom network name
-y, --yes Confirm deployment without prompt
-f, --max-fee <MAX_FEE> Maximum deployment fee
--project-folder <PATH> Project folder [default: current directory]
-h, --help Print help-
Tari Wallet Daemon: Must be running and accessible
- Download from: https://github.com/tari-project/tari-dan
- Default address:
http://127.0.0.1:9000/ - Requires authentication with Admin permissions
-
Rust Toolchain: Required for template compilation
- Install:
rustup target add wasm32-unknown-unknown - WASM target is essential for smart contract compilation
- Install:
-
Project Structure: Projects must contain:
tari.config.toml: Network configurationCargo.toml: Rust workspace configuration- Template directories with
template.tomlfiles
[network]
wallet-daemon-jrpc-address = "http://127.0.0.1:9000/"For custom Tari networks, ensure the wallet daemon is configured for the target network:
[network]
wallet-daemon-jrpc-address = "http://custom-network-host:9000/"Use the --custom-network flag when deploying:
tari deploy --account myaccount --custom-network testnet my_templateWhen creating templates in existing Cargo workspaces, the CLI automatically:
- Detects workspace structure
- Updates
Cargo.tomlworkspace members - Maintains workspace dependencies and configuration
Templates are compiled to WASM using:
cargo build --target wasm32-unknown-unknown --releaseThe CLI automatically handles this compilation during deployment.
-
Wallet Daemon Connection Failed
- Verify
wallet-daemon-jrpc-addressintari.config.toml - Ensure wallet daemon is running and accessible
- Check network firewall settings
- Verify
-
Template Not Found
- Verify
template.tomlexists in template repository - Check template name matches exactly (case-sensitive)
- Ensure git repository is accessible
- Verify
-
WASM Compilation Errors
- Install WASM target:
rustup target add wasm32-unknown-unknown - Check Rust toolchain version compatibility
- Verify template dependencies support WASM
- Install WASM target:
-
Deployment Insufficient Funds
- Check account balance in wallet daemon
- Verify account name/address is correct
- Consider using
--max-feeto limit deployment costs
Test your configuration:
# Verify wallet daemon connection
curl -X POST http://127.0.0.1:9000/ \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"wallet.get_info", "params":{}}'
# Test template compilation
cd your_template_directory
cargo check --target wasm32-unknown-unknown