Ootle / Guides / Publish the Guessing Game
Publish the Guessing Game
Covered in this guide
In this guide, you will:
- Compile your Rust template into a WebAssembly (WASM) binary.
- Understand the process of publishing templates to the Tari Ootle network.
- Learn how to use the Tari Ootle Walletd to publish your template.
This guide assumes you have already read Templates Overview.
Compiling Your Template
To publish your template, you first need to compile it to WebAssembly (WASM).
Run the following command in your terminal:
cargo build --target wasm32-unknown-unknown --release
Tip
The compiled WASM file will be located at target/wasm32-unknown-unknown/release/your_template_name.wasm. This is the
file you will publish to the Tari Ootle network.
Publishing Your Template
To publish your template, you need to create a transaction that includes the PublishTemplate instruction.
This transaction will publish your compiled WASM template to the Tari Ootle network.
Using the Tari Ootle Wallet Web UI
See Set up a Wallet if you have not already set one up. Ensure it is running before starting.
Tip
You’ll need some TTARI in your wallet to pay for transaction fees when publishing your template.
If you don’t have any TTARI, you can claim testnet funds using the built-in faucet in the wallet. Simply click on
“Claim Testnet Funds” in the wallet UI.
Click on “Publish Template” in the top right corner of the wallet web UI on the “Home” page.
You should see a dialogue like the one below:
In this dialogue:
- Select the fee account containing
TTARIto pay for the transaction fees. - Upload the compiled WASM file of your template. You can find this file in the
target/wasm32-unknown-unknown/release/{name}.wasmdirectory of your crate project after running the build command. - Click “Estimate Fee” to calculate the estimated transaction fee. This will automatically fill in the fee field with the amount of
TTARIrequired to publish your template. - Click “Publish Template” to submit the transaction and publish your template to the network.
After the transaction is confirmed, your template will be published and available for use on the Tari Ootle network. You can view your published templates, including the addresses which we’ll need later, by navigating to “Templates” in the left sidebar of the wallet web UI.
What we did:
- We compiled our Rust template to WebAssembly (WASM) using Cargo.
- We used the Tari Ootle Wallet web UI to publish our compiled template to the Tari Ootle testnet
Now that your template is published, it’s ready to be used in transactions!
Next Steps
- Learn some basics about Ootle transactions.
- Learn how to programmatically interact with the guessing game template.