Testing Your Integration
Before you deploy your application or trading bot to the live Mainnet environment, it is crucial to test your integration safely. xRocket provides a complete Testnet environment that mirrors the functionality of the production system but uses simulated funds and separate accounts.
The Difference Between Testnet and Mainnet
The Testnet is a sandbox. You can place orders, manage balances, and generate errors without any financial risk.
Here are the key differences:
| Feature | Mainnet (Live) | Testnet (Sandbox) |
|---|---|---|
| API Base URL | | |
| Telegram Bot | @xRocket | @xrocket_testnet_bot |
| Funds | Real cryptocurrency | Simulated test funds (Testnet TON, Testnet USDT) |
| API Tokens | Production Bearer Tokens | Testnet Bearer Tokens |
How to Access the Testnet
You cannot use your Mainnet credentials on the Testnet, and vice-versa. You need a separate Testnet account and token.
1. Create a Testnet Account
- Start our Testnet bot in Telegram https://t.me/xrocket_testnet_bot?start.
- Starting the bot automatically creates your linked Testnet wallet/account.
2. Generate a Testnet Bearer Token
- Within the Testnet bot, navigate to Menu > Settings > Exchange settings > API token.
- Generate your unique Testnet Bearer Token. This is the token you will use with the Testnet Base URL.
3. Get Testnet Funds
Obtain free simulated funds to test your strategies:
- Use @testgiver_ton_bot Bot to get Testnet coins.
- Use web faucet to get Testnet coins.
What to Test
Once configured, you can simulate your entire workflow:
- Fetching Market Data: Ensure you can correctly read the order book and ticker from the Testnet API.
- Placing Orders: Test placing various order types (market, limit), canceling open orders, and checking order history.
- Wallet Management: Verify you can deposit and withdraw.
Thorough testing on the Testnet ensures your code is robust and ready for the live market environment. Test all edge cases, including error handling and rate limits, before switching to Mainnet.