Testnet
Testnet Deployment Instructions
Last updated
Testnet Deployment Instructions
Last updated
Testnet deployment allows you to launch a Thanos-based appchain using Ethereum Sepolia as the settlement layer and TON as the native gas token. The process consists of three key steps:
Prerequisites – Prepare prerequisites for testnet deployment
L1 Contract Deployment – Deploy and configure smart contracts on the L1 network.
Infrastructure Deployment (AWS) – Set up and configure the network infrastructure.
Each step must be completed successfully before proceeding to the next to ensure a smooth deployment.
Make a note of your L1 RPC URL, as you will need it when using the SDK for deployment. (You can get it from , , etc.) If you want to use L1 endpoint as a free plan, we recommend to use Alchemy. They provide API credits and RPS suitable for testing purpose.
Example : from QuickNode
Beacon URL (Get your endpoint from by logging in, selecting Ethereum Sepolia, and opting for a free plan.)
Example:
Note: While you can use a single QuickNode URL for both L1 RPC and the Beacon URL, it’s not recommended due to potential rate limiting issues. It’s better to use separate URLs for each. ℹ️ We recommend you to use Alchemy for L1 RPC and QuickNode for beacon url.
Prepare AWS credentials & configuration to access AWS EKS.
Follow steps 1 to 9 in this to set up an IAM user with the required privileges and create an access key which will be later used with SDK.
(*Note: This IAM user has to have the following policies)
arn:aws:iam::aws:policy/aws-service-role/AmazonEKSServiceRolePolicy
.
⚠️ The deployment of testnet/mainnet to AWS is not available on AWS free tier.
Prepare a seed phrase for the L1 account.
The SDK will prompt you to provide a 12-word seed phrase to generate EVM accounts for deployment. Prepare a 12-word seed phrase and fund at least the first four EVM accounts with Sepolia ETH.
These accounts will be assigned to different roles: admin, sequencer, batcher, and proposer. While you can use the same account for multiple roles, we recommend using separate accounts to avoid a single point of failure.
Each account requires a minimum ETH balance. Please fund them accordingly based on the information below.
Admin account (minimum ${estimated_cost}
ETH required)
It depends on the L1 network status and automatically estimated before the deployment.
Sequencer account (no need of ETH balance)
Batcher account (minimum 0.3 ETH recommended)
Proposer account (minimum 0.3 ETH recommended)
Make sure you meet the above prerequisites before proceeding to the next step.
Maximum gas price for testing: 20 Gwei (Estimated maximum deployment cost is 1.6 ETH)
Action Required if Gas Price Exceeds 20 Gwei: Pause deployment testing until gas prices return to acceptable levels.
This recommendation aims to prevent excessive expenditure during testing phases due to volatile gas prices. By setting a gas price cap at 20 Gwei, we can maintain predictable and manageable deployment costs.
After completing the prerequisites, the next step is to deploy the L1 contracts to the target network. This process generates the rollup, genesis, and deployment files.
Upon successful deployment, the SDK will also create settings.json
and rollup.json
, which are essential for future infrastructure deployments, allowing you to redeploy the infrastructure anytime without issues.
Create a new root directory for the testnet deployment and run all commands inside it.
Run the following command inside the project directory: trh-sdk deploy-contracts --network ${network} --stack ${stack}
During contract deployment, you will be prompted with the following questions, which you should answer based on your prerequisite setup.
At this step, you will be asked the following question.
This step is to let the users set the advanced chain config parameters:
L2 Block Time (default: 2 seconds): The time it takes to produce a new block on the L2 chain.
Batch Submission Frequency (Default: 120 L1 blocks ≈ 1440 seconds, must be a multiple of 12): The frequency of L2 block batch submission to the L1 chain.
Output Root Frequency (Default: 120 L2 blocks ≈ 240 seconds, must be a multiple of 2): The frequency of L2 output root submission to the L1 chain.
Challenge Period (Default: 12 seconds): The time window during which participants can contest or submit fraud proofs against a posted Layer 2 transaction before it becomes final.
Note: The advanced chain config parameters set above can affect deposits and withdrawals. For example, if you use the default value, you can expect a withdrawal delay of Max(1440, 240) + 12 seconds
, but please note that unexpected delays may occur depending on the L1 network.
Contract deployment usually takes around 15–30 minutes. After completion, the SDK will display a success message.
If the contract deployment is terminated midway due to an error or other reason, you can resume the deployment. Check that the deploy_contract_state
field in settings.json
has a value of 1. (When the deployment is complete, the value will change to 2.)
If you put the deployment command again, you will see the screen below instead of the L1 RPC URL input screen. If you press "Y", contract deployment will resume from the previous state.
After successfully deploying the contracts, the next step is to set up the infrastructure on AWS to run the L2 chain. Follow the steps below to complete the process.
Note : The Thanos bridge will be deployed along with the stack deployment.
Run the following command in the same root directory you used for the L1 contract deployment.
Upon executing the deploy command, you will receive the following prompts from the SDK. You should be able to answer them easily using the information from your prerequisite preparation.
You can check the result of L2 deployment.
If the stack and bridge components are deployed successfully, you will receive the URLs for the L1 RPC and the bridge web app. However, please wait 3–4 minutes before using the bridge, as it takes time for the Kubernetes pods to initialize.
The L2 endpoint can be checked by the l2_rpc_url
field value in settings.json
or by using the trh-sdk info
command.
With the stack and bridge configured, proceed to the Integrations section to add any desired components to your chain.
Please don’t forget to destroy the stack if you think it is not needed anymore to prevent the waste of resource/money.
To terminate network and destroy the AWS infra, you can run the following command in the project root directory:
Like the deploy
command, this command uses the configuration files in the current directory to identify the network and stack to be destroyed.
Success prompt:
⚠️ Gas Price Recommendation for Deployment Testing ()
Double check if the chain is deployed and running properly following this .
ℹ️ After you deploy the L2 testnet successfully, you can operate it by following this guide ()