Testing & Debugging
Short guide on how to test and debug Tetra smart contracts using @ton/sandbox with a custom executor and on‑chain network config.
1. Prerequisites
npm install -D @ton-api/client @tychosdk/emulator2. Initializing Blockchain with Tycho
import { TonApiClient } from '@ton-api/client';
import { TychoExecutor } from '@tychosdk/emulator';
beforeEach(async () => {
const tonapi = new TonApiClient({ baseUrl: 'https://tetra.tonapi.io/' });
// Get real blockchain config from system contract
const configAccount = await tonapi.blockchain.getBlockchainRawAccount(
Address.parse('-1:5555555555555555555555555555555555555555555555555555555555555555'),
);
const config = configAccount.data!.asSlice().loadRef();
// Create local tycho executor with tetra config
blockchain = await Blockchain.create({
executor: await TychoExecutor.create(),
config,
});
});3. Simple contract and test
4. Running tests and debugging
5. Full testing documentation
Last updated