Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

54 changes: 54 additions & 0 deletions applications/tari_app_utilities/src/genesis_resources.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
// Copyright 2025 The Tari Project
// SPDX-License-Identifier: BSD-3-Clause

use tari_engine_types::resource::Resource;
use tari_ootle_common_types::Network;
use tari_template_lib::{
auth::{OwnerRule, ResourceAccessRules},
constants::PUBLIC_IDENTITY_RESOURCE_ADDRESS,
models::{Metadata, ResourceAddress},
prelude::{ResourceType, STEALTH_TARI_RESOURCE_ADDRESS},
resource::TOKEN_SYMBOL,
rule,
};

pub fn get_public_identity_resource() -> (ResourceAddress, Resource) {
let value = Resource::new(
ResourceType::NonFungible,
None,
OwnerRule::None,
ResourceAccessRules::new(),
Metadata::from([(TOKEN_SYMBOL, "ID".to_string())]),
None,
None,
0,
false,
);
(PUBLIC_IDENTITY_RESOURCE_ADDRESS, value)
}

pub fn get_stealth_tari_resource(network: Network) -> (ResourceAddress, Resource) {
let symbol = if network.is_testnet() { "tXTR" } else { "XTR" };
let xtr_resource = Resource::new(
ResourceType::Stealth,
None,
OwnerRule::None,
ResourceAccessRules::new()
// These are defaults, but just for explicitness
.mintable(rule!(deny_all))
.burnable(rule!(deny_all))
.recallable(rule!(deny_all))
.freezable(rule!(deny_all))
.update_access_rules(rule!(deny_all)),
Metadata::from([(TOKEN_SYMBOL, symbol)]),
None,
None,
6,
// Disable total supply tracking for XTR. This is because it is not feasible to include "the fee exhaust" in
// the tracking (as that would require mutating the resource on every transaction). Tracking supply can
// be done by summing up the total burn claims (ClaimedOutputTombstone) and subtracting the total exhaust in
// fee receipts.
false,
);
(STEALTH_TARI_RESOURCE_ADDRESS, xtr_resource)
}
1 change: 1 addition & 0 deletions applications/tari_app_utilities/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ pub mod common;
pub mod configuration;
pub mod epoch_oracle_config;
pub mod fee_tables;
pub mod genesis_resources;
pub mod keypair;
pub mod p2p_config;
pub mod seed_peer;
Expand Down

This file was deleted.

45 changes: 8 additions & 37 deletions applications/tari_validator_node/src/genesis_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ use tari_engine_types::{
substate::{SubstateId, SubstateValue},
vault::Vault,
};
use tari_ootle_app_utilities::shared_consts::TXTR_FAUCET_INITIAL_SUPPLY;
use tari_ootle_app_utilities::{
genesis_resources::{get_public_identity_resource, get_stealth_tari_resource},
shared_consts::TXTR_FAUCET_INITIAL_SUPPLY,
};
use tari_ootle_common_types::{
Epoch,
Network,
Expand Down Expand Up @@ -69,41 +72,11 @@ where
return Ok(());
}

let value = Resource::new(
ResourceType::NonFungible,
None,
OwnerRule::None,
ResourceAccessRules::new(),
Metadata::from([(TOKEN_SYMBOL, "ID".to_string())]),
None,
None,
0,
false,
);
create_substate(tx, num_preshards, PUBLIC_IDENTITY_RESOURCE_ADDRESS, value)?;
let (public_identity_address, resource) = get_public_identity_resource();
create_substate(tx, num_preshards, public_identity_address, resource)?;

let symbol = if network.is_testnet() { "tXTR" } else { "XTR" };
let xtr_resource = Resource::new(
ResourceType::Stealth,
None,
OwnerRule::None,
ResourceAccessRules::new()
// These are defaults, but just for explicitness
.mintable(rule!(deny_all))
.burnable(rule!(deny_all))
.recallable(rule!(deny_all))
.freezable(rule!(deny_all))
.update_access_rules(rule!(deny_all)),
Metadata::from([(TOKEN_SYMBOL, symbol)]),
None,
None,
6,
// Disable total supply tracking for XTR. This is because it is not feasible to include "the fee exhaust" in
// the tracking (as that would require mutating the resource on every transaction). Tracking supply can
// be done by summing up the total burn claims (ClaimedOutputTombstone) and subtracting the total exhaust in
// fee receipts.
false,
);
let (xtr_address, xtr_resource) = get_stealth_tari_resource(network);
create_substate(tx, num_preshards, xtr_address, xtr_resource)?;

if network.is_testnet() {
// Create tXTR faucet
Expand All @@ -112,8 +85,6 @@ where
create_nft_faucet(tx, num_preshards)?;
}

create_substate(tx, num_preshards, STEALTH_TARI_RESOURCE_ADDRESS, xtr_resource)?;

Ok(())
}

Expand Down
7 changes: 0 additions & 7 deletions applications/tari_validator_node/web_ui/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import ValidatorNode from "./routes/VN/ValidatorNode";
import Connections from "./routes/Connections/Connections";
import Fees from "./routes/Fees/Fees";
import Blocks from "./routes/Blocks/Blocks";
import Templates from "./routes/Templates/Templates";
import ValidatorNodes from "./routes/ValidatorNodes/ValidatorNodes";
import ErrorPage from "./routes/ErrorPage";
import TemplateFunctions from "./routes/VN/Components/TemplateFunctions";
Expand Down Expand Up @@ -89,11 +88,6 @@ export const breadcrumbRoutes = [
path: "/blocks/:blockId",
dynamic: true,
},
{
label: "Templates",
path: "/templates",
dynamic: false,
},
{
label: "Validator Nodes",
path: "/vns",
Expand Down Expand Up @@ -182,7 +176,6 @@ export default function App() {
<Route path="connections" element={<Connections />} />
<Route path="fees" element={<Fees />} />
<Route path="blocks" element={<Blocks />} />
<Route path="templates" element={<Templates />} />
<Route path="vns" element={<ValidatorNodes />} />
<Route path="mempool" element={<Mempool />} />
<Route path="transactions/:transactionHash" element={<TransactionDetails />} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,6 @@ const mainItems = [
activeIcon: <IoLayers style={activeIconStyle} />,
link: "mempool",
},
{
title: "Templates",
icon: <IoCodeDownloadOutline style={iconStyle} />,
activeIcon: <IoCodeDownload style={activeIconStyle} />,
link: "templates",
},
{
title: "Validator Nodes",
icon: <IoCheckmarkCircleOutline style={iconStyle} />,
Expand Down
5 changes: 0 additions & 5 deletions applications/tari_validator_node/web_ui/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import Connections from "./routes/Connections/Connections";
import Fees from "./routes/Fees/Fees";
import Mempool from "./routes/Mempool/Mempool";
import Blocks from "./routes/Blocks/Blocks";
import Templates from "./routes/Templates/Templates";
import ValidatorNodes from "./routes/ValidatorNodes/ValidatorNodes";
import ErrorPage from "./routes/ErrorPage";
import TemplateFunctions from "./routes/VN/Components/TemplateFunctions";
Expand Down Expand Up @@ -60,10 +59,6 @@ const router = createBrowserRouter([
path: "blocks/:blockId",
element: <BlockDetails />,
},
{
path: "templates",
element: <Templates />,
},
{
path: "vns",
element: <ValidatorNodes />,
Expand Down

This file was deleted.

Loading
Loading