TemplateNet is a testnet network for Tari Ootle that focuses on deploying and testing Ootle templates (smart contracts). The network is backed by 2 validator nodes running on a private L1 network (igor) and a single indexer.
-
Download the wallet daemon binary for your platform: https://github.com/tari-project/tari-ootle/releases/tag/v0.10.4
-
Run the wallet on the igor network. Note that the wallet is preconfigured to connect to the TemplateNet indexer.
tari_ootle_walletd --network igor
- Open the Ootle walletd web interface typically found at http://127.0.0.1:5100.
Tip: use tari_ootle_walletd --help
to learn about more about the available cli options.
- Create an account with testnet coins.
- Open the wallet daemon web ui and create an account - for testnet the wallet automatically adds faucet coins to your account
- Send some private and non-private coins
- Either create another account and send coins, or exchange public key addresses with others
- Build and publish your first template
- See [Creating a template] below.
- Publish the template using the "Publish template" button/dialog in the wallet web UI. Bonus: Call functions on your template
- This is a little trickier than it needs to be at the moment. Improvements coming soon.
- You can use tari.js to connect to your wallet, build transactions that call your template and submit transactions to the network.
- You can use the advanced "manifest" feature in the wallet web UI. This feature is not well documented and will be replaced by a visual flow editor in future. See [manifest] for some tips.
The easiest way to get started is to use tari-cli.
As mentioned this is an advanced and undocumented feature. However, at the time of writing your options are manually coding an application for your template using tari.js or using the manifest builder.
Instantiating a component from your template
use template_deadbeaf... as MyTemplate;
fn main() {
MyTemplate::create_my_component();
}
Calling the component
Add your new component address and (if applicable) your account address to the manifest variables
fn main() {
// Bring the component into scope
let my_component = var!["component"];
let my_account = var!["account"];
// Call the component - let's say that it returns a bucket with some custom NFTs/or your own confidential tokens
let bucket = my_component.my_method("some", "args", 1000);
// Deposit the bucket into your account
account.deposit(bucket);
}
Documentation is a work on progress and these links are subject to change.