Skip to content

Deploy your ContainerChain via the Tanssi DApp

Introduction

Tanssi aims to lower the barrier to entry for building within the Polkadot ecosystem by streamlining the onboarding process and abstracting away the technical details of launching an Appchain. The Tanssi dApp allows you to spin up an Appchain in just minutes. This guide will walk you through the steps required to launch an Appchain on Tanssi's TestNet, Dancebox, via the Tanssi dApp.

Snap Appchains vs. Dedicated Appchains

The Tanssi dApp supports the creation of two different types of Appchains, namely:

  • Snap Appchain - a temporary Appchain that self-destructs after 48 hours
  • Dedicated Appchain - a long-lasting Appchain for Tanssi ecosystem builders

Both types of Appchains behave identically, with the only difference being the ephemeral nature of the Snap Appchains. Generally speaking, Snap Appchains are best for most builders who want to test the power of a Tanssi-powered Appchain. However, if you require a long-lasting test environment, the Tanssi team will happily assist you with setting up a dedicated Appchain.

The screenshots and content in this guide will showcase Snap Appchains, but you can follow the same process to configure a dedicated Appchain.

A screenshot showing the initial dashboard of apps.tanssi.network.

Overview

Deploying an Appchain via the Tanssi dApp is accomplished as a single, streamlined flow consisting of five distinct steps:

  1. Select a template and configure it
  2. Satisfy the required minimum token balances
  3. Reserve your Appchain ID on the relay chain
  4. Generate your custom Appchain files
  5. Register your Appchain on Tanssi, and the relay chain

A diagram mapping out the steps for deploying an Appchain with the Tanssi dApp.

For Snap Appchains and Dedicated Appchains on the Tanssi Dancebox Testnet, the Tanssi team will manually complete verification. After verification, it typically takes about ten minutes for your Snap Appchain to be ready and about two hours for a dedicated Appchain. For Tanssi MainNet, the process will be fully decentralized and permissionless.

Prerequisites

Supported Wallets

Since Tanssi is built with Substrate, you'll need to use a Substrate-supported wallet to deploy and manage your ContainerChain. Supported wallets include:

If you deploy an EVM ContainerChain, your users won't need a Substrate wallet. They can interact with your ContainerChain using Ethereum-compatible wallets like MetaMask.

Connection screen for various Substrate wallets

Connect Your Wallet to the DApp

To connect your wallet to the Tanssi dApp, click Connect Wallet in the upper-right corner. Select the desired wallet type. Then, take the following steps:

  1. Choose your account from the dropdown
  2. You'll be prompted to sign a message to log you into the Tanssi dApp. Go ahead and sign the message

Click on the Connect Wallet button to connect your wallet to the Tanssi dApp.

Once connected, you'll see your address in the top-right corner. If you've connected multiple accounts and want to switch accounts, you can click on your address and choose an account from the dropdown menu.

Configure Your Appchain

From the Dashboard or the Deploy Appchain tab, you can immediately start configuring your Appchain. To start, choose Deploy a Snap Appchain or Deploy a Dedicated Appchain. You can read more about the differences between the two types of Appchains on the Tanssi Testnet.

A screenshot showing the initial dashboard of apps.tanssi.network.

Next, select a template that best fits your use case and configure your Appchain's properties accordingly. You can choose from the EVM or Substrate template or upload a raw specification file. Please refer to the Templates documentation to learn more about the available templates.

EVM Template

The EVM template provides all the necessary components to add an Ethereum compatibility layer to your Appchain. As part of the setup process, you'll need a unique EVM chain ID that is distinct from all other EVM chains. You can verify that another chain does not already use your EVM chain ID on chainid.network. Before launching your Appchain in production, it's critical that you open a PR to reserve your chain ID on the ethereum-lists/chains GitHub repository. It would be best if you did this before you continued the deployment process of your Appchain to avoid chain ID collisions.

Note

A registered EVM chain ID is only necessary for Appchains deployed on the MainNet. When testing or deploying on the TestNet, you can choose any available ID and move forward.

To get started, select the EVM template from the left-side menu. Then take the following steps:

  1. In the Project Details section, provide your project's name, your contact email, and your Telegram
  2. In the Properties section, enter the symbol of your Appchain's native token and your unique EVM chain ID. Decimal places are fixed to 18 digits, the same as Ether, to preserve compatibility across EVM tooling
  3. Provide the Ethereum-style address of the account you want to use as the sudo account and its corresponding initial balance. This account will be able to dispatch privileged functions that require Root permissions. There can only be one sudo account at a time. The sudo account can be changed at any time to a new one by the current sudo account. Once the Appchain is launched, you can easily migrate to a fully decentralized system using specific democracy-related modules
  4. (Optional) Press Add to add genesis accounts and balances. If you choose to skip this step, you can use the sudo account to create accounts and transfer funds at a later time
  5. (Optional) Press Add to add genesis smart contracts by providing an address to use and the bytecode for the smart contract. When providing the bytecode, you'll need to remove the 0x from the beginning of the bytecode
  6. (Optional) You can adjust the gas configurations in the Advanced settings. You can choose to change the Minimum Gas Price, Base fee per gas, Multiplier, and Elasticity
  7. Once you have configured the template for your Appchain, select Continue and proceed to the Check Balances section

Create an EVM ContainerChain with the Tanssi dApp.

Substrate Template

The Substrate template includes all the configurations for seamless integration with Tanssi and the Polkadot ecosystem. It can be used as the baseline specification to build a custom Appchain that is compatible with both Polkadot and Tanssi.

To get started, select the Substrate template from the left-side menu. Then take the following steps:

  1. In the Project Details section, provide your project's name, your contact email, and your Telegram
  2. Enter the token decimals and symbol for your native token and the SS58 address format
  3. Provide the Substrate-style address of the account you want to use as the sudo account and its initial balance. This account will be able to dispatch privileged functions that require Root permissions. There can only be one sudo account at a time. The sudo account can be changed at any time to a new one by the current sudo account. Once the Appchain is launched, you can easily migrate to a fully decentralized system using specific democracy-related modules
  4. (Optional) You can add genesis accounts and balances. If you choose to skip this step, you can use the sudo account to create accounts and transfer funds at a later time
  5. Once you have configured the template for your Appchain, you can select Continue to proceed to the Check Balances section

Create a baseline Substrate ContainerChain with the Tanssi dApp.

Custom

If you already have a Substrate runtime built and have chosen to upload your own custom specification file, there are some requirements to be aware of that are necessary to ensure the runtime can evolve into a ContainerChain on Tanssi and run properly within the Polkadot ecosystem.

Your runtime must implement the following:

Other required changes in the runtime include:

  • To verify the author's eligibility to produce a block, set the following type as shown in the snippet, in the timestamp module configuration section of the runtime:

    type OnTimestampSet = tp_consensus::OnTimestampSet<
        <Self as pallet_author_inherent::Config>::SlotBeacon,
        ConstU64<{ SLOT_DURATION }>,
    >;
    
  • Remove all the modules related to block production and consensus (such as Aura and Grandpa), leaving Tanssi to take over the burden. If the starting point for your project was the parachain template, the following modules are included by default in the runtime and must be removed:

    Authorship: pallet_authorship = 20,
    CollatorSelection: pallet_collator_selection = 21,
    Session: pallet_session = 22,
    Aura: pallet_aura = 23,
    AuraExt: cumulus_pallet_aura_ext = 24,
    

Finally, generate and edit the chain specification paying special attention to:

  • para_id - within this custom flow, a pre-registered parachain id is required
  • is_ethereum - to true if exposing Ethereum compatible RPC endpoints is needed

And, depending on whether you are deploying a Snap Appchain or a dedicated one, also adjust these attributes:

{
    ...
    "relay_chain": "rococo_flashbox_relay_testnet",
    "chainType": "Live",
    "genesis": {
        "runtime": {
            ...
            "authoritiesNoting": {
                "orchestratorParaId": 1000
            },
            ...
        }
    }
    ...
}
{
    ...
    "relay_chain": "westend_moonbase_relay_testnet",
    "chainType": "Live",
    "genesis": {
        "runtime": {
            ...
            "authoritiesNoting": {
                "orchestratorParaId": 3000
            },
            ...
        }
    }
    ...
}

Now, you can upload your custom raw specification file by selecting the Custom template and adding your JSON specification file.

Upload a custom raw specification file to the Tanssi dApp.

Note

The size of a raw chain specifications file should not exceed 2MB.

Check Balances

Next, you'll need to verify that you have sufficient balances of DANCE and TANGO tokens. If you don't, you can press Request Tokens and complete the following login with GitHub or Google. You'll need to complete a few quick onboarding questions, and then you'll be able to press Request Tokens again, and they will be delivered to your connected wallet.

Request tokens

If you're setting up a dedicated Appchain, you'll need to manually request the necessary tokens via a form on the Tanssi network website, and you'll receive the necessary tokens within one business day. The required minimum balances to launch an Appchain are as follows:

Chain Balance Required
Flashbox Relay Chain Balance 70 TANGO
Flashbox Balance (Tanssi) 100 DANCE
Chain Balance Required
Moonbase Relay Chain Balance 110 TANGO
Dancebox Balance (Tanssi) 100 DANCE

Reserve your Appchain ID

If you haven't already done so, you'll need to reserve your Appchain ID, which will be required to register your Appchain on the relay chain and function within the Polkadot ecosystem.

To reserve your Appchain ID, you'll need to submit a transaction. Please make sure to use the account you plan to launch your Appchain with when submitting the transaction.

  1. To initiate the transaction, click on Reserve Appchain ID
  2. Your wallet will pop up, and you'll need to submit the transaction

Reserve your Appchain ID via the Tanssi dApp.

Once the transaction has successfully gone through, your Appchain ID will be displayed on the dApp, and you'll be able to click Continue to proceed to the next step. You'll notice that on your Alphanet relay chain account, 20 TANGO tokens have been removed from your transferrable balance and are now reserved.

Successfully reserved your Appchain ID via the Tanssi dApp.

Generate Your Appchain Files

Before you can deploy your Appchain, you'll need to generate four configuration files:

  • The raw chain specification - a compact version of the JSON specification file, which defines the initial settings and state that all nodes participating in the network must agree on to reach consensus and produce blocks
  • The genesis state header - defines the initial state upon which all transactions and state transitions are executed
  • The genesis Wasm - a WebAssembly (Wasm) blob that defines the runtime logic

These files will automatically be generated for you based on your Appchain ID and your customized template configurations. All you need to do is click Generate, and the dApp will generate the required files for you.

Generate your Appchain files with the click of a button on the Tanssi dApp.

Once the files have been generated, please click Continue to go on to the final step.

Deploy Your Appchain

You're finally ready to take your last step towards preparing your Appchain as it evolves into a ContainerChain deployed through Tanssi! For this final step, you'll need to submit two transactions: one to register your Appchain on the relay chain and another to register your Appchain on Tanssi.

To register your Appchain on the relay chain, take the following steps:

  1. Click Register under the Register Appchain in Relay section
  2. Confirm the transaction in your wallet

Register your Appchain on the relay chain.

Once the transaction has gone through successfully, the dApp will update to show that you have successfully registered your Appchain under the Register Appchain in Relay section.

Lastly, to register your Appchain on Tanssi, take the following steps:

  1. Click Register under the Register Appchain in Tanssi section
  2. Confirm the transaction in your wallet

Register your Appchain on Tanssi.

Once the transaction has gone through successfully, the dApp will update to show that you have registered your Appchain. Congratulations! On the dashboard, you can check the status of your deployment and view relevant information, such as the latest block information, RPC and WS endpoints, and more.

The ContainerChain dashboard on the Tanssi dApp.

And that's it! You've successfully registered your Appchain! The launch process will automatically begin once the Tanssi team has verified your Appchain. Once your Appchain is live, you can return to the Dashboard to view the RPC URL and other pertinent chain information.

Last update: February 16, 2024
| Created: September 12, 2023