POST /apiv2/time/infinitystart
启用主机模式下TRON地址的无限能量委托周期。
概述
时间无限启动端点会为已处于主机模式的TRON地址激活无限循环模式。启用后,该地址将持续收到131,000能量委托,无需循环限制,确保高频操作或需要持续能量供应的智能合约不间断的能量供应。
端点 URL
POST https://netts.io/apiv2/time/infinitystart
身份验证
此端点使用JSON主体身份验证(而非标头)。您的API密钥和目标地址在请求主体中提供。
身份验证流程
- API Key Validation: System verifies the API key exists and is active
- IP Whitelist Check: Request IP must match configured whitelist
- Ownership Verification: API key must own the specified address
- Balance Check: Account must have sufficient balance for infinity mode
- Status Verification: Address must already be in Host Mode
请求头
Header | Required | Description |
---|---|---|
Content-Type | Yes | application/json |
请求体
json
{
"api_key": "your_api_key",
"address": "TQn9Y2khEsLJW1ChVWFMSMeRDow5KcbLSE"
}
参数
Parameter | Type | Required | Validation | Description |
---|---|---|---|---|
api_key | string | Yes | Must exist in system | Your API key for authentication and billing |
address | string | Yes | TRC-20 format | TRON address to enable infinity mode (must start with 'T' and be 34 characters) |
参数验证
api_key:
- Must be a valid 32-character hexadecimal string
- Must be associated with an active account
- Must have ownership of the specified address
- Account must have infinity mode permissions
- Account balance must support infinity mode billing
address:
- Must match TRC-20 format
^T[1-9A-HJ-NP-Za-km-z]{33}$
- Must be currently in Host Mode under your account
- Cannot already be in infinity mode
- Must have completed at least one standard cycle
- Cannot have pending transactions
- Must match TRC-20 format
IP Address:
- Your request IP must be in the whitelist associated with your API key
- Maximum 5 IP addresses per API key
- IPv4 and IPv6 supported
示例请求
cURL
bash
curl -X POST https://netts.io/apiv2/time/infinitystart \
-H "Content-Type: application/json" \
-d '{
"api_key": "YOUR_API_KEY_HERE",
"address": "TQn9Y2khEsLJW1ChVWFMSMeRDow5KcbLSE"
}'
Python
python
import requests
import json
from typing import Dict, Optional
def enable_infinity_mode(api_key: str, address: str) -> Dict:
"""
Enable unlimited cycles for a TRON address in Host Mode.
Args:
api_key: Your API authentication key
address: TRON address to enable infinity mode
Returns:
API response dictionary
"""
url = "https://netts.io/apiv2/time/infinitystart"
# Validate address format
if not address.startswith('T') or len(address) != 34:
raise ValueError(f"Invalid TRON address format: {address}")
data = {
"api_key": api_key,
"address": address
}
try:
response = requests.post(url, json=data, verify=True, timeout=30)
response.raise_for_status()
result = response.json()
if result['code'] == 0:
print(f"✅ Infinity mode enabled for: {result['data']['address']}")
print(f"Mode: {result['data']['mode']}")
print(f"Daily cost: {result['data'].get('daily_cost', 'N/A')} TRX")
print(f"Energy per cycle: {result['data'].get('energy_per_cycle', 131000)}")
else:
print(f"❌ Error: {result['msg']}")
return result
except requests.exceptions.RequestException as e:
print(f"❌ Request failed: {str(e)}")
raise
except json.JSONDecodeError as e:
print(f"❌ Invalid JSON response: {str(e)}")
raise
# Example usage
if __name__ == "__main__":
API_KEY = "YOUR_API_KEY_HERE"
ADDRESS = "TQn9Y2khEsLJW1ChVWFMSMeRDow5KcbLSE"
result = enable_infinity_mode(API_KEY, ADDRESS)
Node.js
javascript
const axios = require('axios');
/**
* Enable unlimited cycles for a TRON address in Host Mode
* @param {string} apiKey - Your API authentication key
* @param {string} address - TRON address to enable infinity mode
* @returns {Promise<Object>} API response
*/
async function enableInfinityMode(apiKey, address) {
const url = 'https://netts.io/apiv2/time/infinitystart';
// Validate address format
if (!address.startsWith('T') || address.length !== 34) {
throw new Error(`Invalid TRON address format: ${address}`);
}
const data = {
api_key: apiKey,
address: address
};
try {
const response = await axios.post(url, data, {
headers: {
'Content-Type': 'application/json'
},
timeout: 30000
});
const result = response.data;
if (result.code === 0) {
console.log(`✅ Infinity mode enabled for: ${result.data.address}`);
console.log(`Mode: ${result.data.mode}`);
console.log(`Daily cost: ${result.data.daily_cost || 'N/A'} TRX`);
console.log(`Energy per cycle: ${result.data.energy_per_cycle || 131000}`);
} else {
console.error(`❌ Error: ${result.msg}`);
}
return result;
} catch (error) {
if (error.response) {
console.error(`❌ API Error: ${error.response.status} - ${error.response.data?.msg || error.message}`);
} else if (error.request) {
console.error('❌ No response from server');
} else {
console.error(`❌ Request failed: ${error.message}`);
}
throw error;
}
}
// Example usage
(async () => {
const API_KEY = 'YOUR_API_KEY_HERE';
const ADDRESS = 'TQn9Y2khEsLJW1ChVWFMSMeRDow5KcbLSE';
try {
const result = await enableInfinityMode(API_KEY, ADDRESS);
console.log('Result:', result);
} catch (error) {
console.error('Failed to enable infinity mode:', error.message);
}
})();
PHP
php
<?php
/**
* Enable unlimited cycles for a TRON address in Host Mode
*
* @param string $apiKey Your API authentication key
* @param string $address TRON address to enable infinity mode
* @return array API response
*/
function enableInfinityMode($apiKey, $address) {
$url = 'https://netts.io/apiv2/time/infinitystart';
// Validate address format
if (!preg_match('/^T[1-9A-HJ-NP-Za-km-z]{33}$/', $address)) {
throw new InvalidArgumentException("Invalid TRON address format: $address");
}
$data = [
'api_key' => $apiKey,
'address' => $address
];
$options = [
'http' => [
'header' => "Content-Type: application/json\r\n",
'method' => 'POST',
'content' => json_encode($data),
'timeout' => 30
]
];
$context = stream_context_create($options);
$response = @file_get_contents($url, false, $context);
if ($response === false) {
$error = error_get_last();
throw new RuntimeException('Request failed: ' . $error['message']);
}
$result = json_decode($response, true);
if ($result['code'] == 0) {
echo "✅ Infinity mode enabled for: {$result['data']['address']}\n";
echo "Mode: {$result['data']['mode']}\n";
echo "Daily cost: " . ($result['data']['daily_cost'] ?? 'N/A') . " TRX\n";
echo "Energy per cycle: " . ($result['data']['energy_per_cycle'] ?? 131000) . "\n";
} else {
echo "❌ Error: {$result['msg']}\n";
}
return $result;
}
// Example usage
$API_KEY = 'YOUR_API_KEY_HERE';
$ADDRESS = 'TQn9Y2khEsLJW1ChVWFMSMeRDow5KcbLSE';
try {
$result = enableInfinityMode($API_KEY, $ADDRESS);
print_r($result);
} catch (Exception $e) {
echo "Failed to enable infinity mode: " . $e->getMessage() . "\n";
}
?>
Java
java
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.net.URI;
import java.time.Duration;
import com.google.gson.Gson;
import com.google.gson.JsonObject;
public class InfinityModeExample {
private static final String API_URL = "https://netts.io/apiv2/time/infinitystart";
private static final HttpClient httpClient = HttpClient.newBuilder()
.connectTimeout(Duration.ofSeconds(10))
.build();
private static final Gson gson = new Gson();
/**
* Enable unlimited cycles for a TRON address in Host Mode
* @param apiKey Your API authentication key
* @param address TRON address to enable infinity mode
* @return API response as JsonObject
*/
public static JsonObject enableInfinityMode(String apiKey, String address) throws Exception {
// Validate address format
if (!address.startsWith("T") || address.length() != 34) {
throw new IllegalArgumentException("Invalid TRON address format: " + address);
}
// Create request body
JsonObject requestBody = new JsonObject();
requestBody.addProperty("api_key", apiKey);
requestBody.addProperty("address", address);
// Build HTTP request
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create(API_URL))
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(gson.toJson(requestBody)))
.timeout(Duration.ofSeconds(30))
.build();
// Send request and get response
HttpResponse<String> response = httpClient.send(request, HttpResponse.BodyHandlers.ofString());
// Parse response
JsonObject result = gson.fromJson(response.body(), JsonObject.class);
if (result.get("code").getAsInt() == 0) {
JsonObject data = result.getAsJsonObject("data");
System.out.println("✅ Infinity mode enabled for: " + data.get("address").getAsString());
System.out.println("Mode: " + data.get("mode").getAsString());
if (data.has("daily_cost")) {
System.out.println("Daily cost: " + data.get("daily_cost").getAsString() + " TRX");
}
} else {
System.err.println("❌ Error: " + result.get("msg").getAsString());
}
return result;
}
public static void main(String[] args) {
String API_KEY = "YOUR_API_KEY_HERE";
String ADDRESS = "TQn9Y2khEsLJW1ChVWFMSMeRDow5KcbLSE";
try {
JsonObject result = enableInfinityMode(API_KEY, ADDRESS);
System.out.println("Result: " + result);
} catch (Exception e) {
System.err.println("Failed to enable infinity mode: " + e.getMessage());
}
}
}
响应
成功响应 (200 OK)
json
{
"code": 0,
"msg": "Infinity mode successfully enabled",
"data": {
"address": "TQn9Y2khEsLJW1ChVWFMSMeRDow5KcbLSE",
"mode": "infinity",
"status": "active",
"energy_per_cycle": 131000,
"cycle_duration": 86400,
"daily_cost": 30,
"billing_cycle": "daily",
"activated_at": 1699528800,
"next_billing": 1699615200,
"auto_renew": true,
"transaction_hash": "a7c9f2b3d8e1a5c7f9b3d5e7a1c3e5f7b9d1f3a5c7e9b1d3f5a7c9e1b3d5f7a9"
}
}
响应字段
Field | Type | Description |
---|---|---|
code | integer | Status code (0 for success, -1 for error) |
msg | string | Human-readable status message |
data | object | Response data object |
data.address | string | The TRON address with infinity mode enabled |
data.mode | string | Current mode ("infinity") |
data.status | string | Current status ("active", "pending", "processing") |
data.energy_per_cycle | integer | Energy amount per delegation cycle (131,000) |
data.cycle_duration | integer | Duration of each cycle in seconds (86,400 = 24 hours) |
data.daily_cost | number | Daily cost in TRX for infinity mode |
data.billing_cycle | string | Billing period ("daily", "weekly", "monthly") |
data.activated_at | integer | Unix timestamp when infinity mode was activated |
data.next_billing | integer | Unix timestamp for next billing cycle |
data.auto_renew | boolean | Whether infinity mode auto-renews |
data.transaction_hash | string | TRON blockchain transaction hash for the activation |
错误响应
身份验证错误 (401)
json
{
"code": -1,
"msg": "Invalid API key",
"data": null
}
Causes:
- Invalid or expired API key
- API key not found in system
- Account suspended or terminated
Resolution:
- Verify API key is correct
- Check account status in dashboard
- Contact support if key should be valid
地址未找到 (404)
json
{
"code": -1,
"msg": "Address not found in Host Mode",
"data": {
"address": "TQn9Y2khEsLJW1ChVWFMSMeRDow5KcbLSE",
"suggestion": "Use /time/add to add this address to Host Mode first"
}
}
Causes:
- Address not in Host Mode
- Address was deleted from Host Mode
- Address belongs to different API key
Resolution:
- Add address to Host Mode using
/time/add
first - Verify address ownership
- Check address status with
/time/status
已进入无限模式 (409)
json
{
"code": -1,
"msg": "Address already in infinity mode",
"data": {
"address": "TQn9Y2khEsLJW1ChVWFMSMeRDow5KcbLSE",
"mode": "infinity",
"activated_at": 1699442400,
"daily_cost": 30
}
}
Causes:
- Address already has infinity mode enabled
- Previous activation still active
- Duplicate request
Resolution:
- Check current status with
/time/status
- No action needed if already active
- Use
/time/stop
to disable if needed
余额不足 (402)
json
{
"code": -1,
"msg": "Insufficient balance for infinity mode",
"data": {
"required_balance": 300,
"current_balance": 50,
"deficit": 250,
"billing_cycle": "daily",
"daily_cost": 30
}
}
Causes:
- Account balance too low for infinity mode
- Minimum balance requirement not met
- Credit limit exceeded
Resolution:
- Add funds to your account
- Check minimum balance requirements
- Contact support for credit limit increase
- Consider standard cycle mode instead
无效地址格式 (400)
json
{
"code": -1,
"msg": "Invalid TRON address format",
"data": {
"address": "invalid_address",
"format": "Address must start with 'T' and be 34 characters long"
}
}
Causes:
- Address doesn't match TRC-20 format
- Address contains invalid characters
- Address wrong length
Resolution:
- Verify address starts with 'T'
- Ensure address is exactly 34 characters
- Check for typos or copy/paste errors
权限被拒绝 (403)
json
{
"code": -1,
"msg": "Infinity mode not enabled for this account",
"data": {
"account_type": "basic",
"required_type": "premium",
"upgrade_url": "https://netts.io/upgrade"
}
}
Causes:
- Account type doesn't support infinity mode
- Feature not enabled for account
- Trial account limitations
Resolution:
- Upgrade account to premium tier
- Contact support to enable feature
- Check account permissions in dashboard
待处理操作 (409)
json
{
"code": -1,
"msg": "Cannot enable infinity mode with pending operations",
"data": {
"address": "TQn9Y2khEsLJW1ChVWFMSMeRDow5KcbLSE",
"pending_operation": "cycle_purchase",
"retry_after": 300
}
}
Causes:
- Address has pending cycle purchases
- Active delegation in progress
- Previous mode change not completed
Resolution:
- Wait for pending operations to complete
- Retry after specified time
- Check operation status with
/time/status
速率限制
Period | Limit | Description |
---|---|---|
1 minute | 6 requests | Maximum 6 requests per minute per API key |
1 hour | 100 requests | Maximum 100 requests per hour per API key |
1 day | 1000 requests | Maximum 1000 requests per day per API key |
速率限制报头
http
X-RateLimit-Limit-Minute: 6
X-RateLimit-Remaining-Minute: 5
X-RateLimit-Reset-Minute: 1699528860
X-RateLimit-Limit-Hour: 100
X-RateLimit-Remaining-Hour: 98
X-RateLimit-Reset-Hour: 1699532400
X-RateLimit-Limit-Day: 1000
X-RateLimit-Remaining-Day: 995
X-RateLimit-Reset-Day: 1699574400
速率限制超出响应 (429)
json
{
"code": -1,
"msg": "API rate limit exceeded",
"data": {
"retry_after": 45,
"limit": "6 per minute",
"reset_at": 1699528860
}
}
什么是无限模式?
关键特性
无限循环
- No cycle count limitations
- Continuous energy delegation
- Never runs out of energy
- Automatic renewal every 24 hours
可预测的计费
- Fixed daily cost
- No per-cycle charges
- Simplified accounting
- Volume discounts available
优先处理
- Higher priority in delegation queue
- Faster energy allocation
- Guaranteed availability
- Premium support
工作原理
激活流程
- Address must be in Host Mode first
- Infinity mode enabled via this endpoint
- Initial billing cycle starts immediately
- Energy delegation continues uninterrupted
能量管理
- 131,000 energy delegated every 24 hours
- Automatic renewal at cycle end
- No manual intervention required
- Smart usage optimization
计费周期
- Daily charges at fixed rate
- Automatic deduction from balance
- Email notifications before renewal
- Can be cancelled anytime
与标准模式的比较
Feature | Standard Mode | Infinity Mode |
---|---|---|
Cycles | Limited (purchased) | Unlimited |
Billing | Per cycle | Daily flat rate |
Priority | Standard | High |
Auto-renewal | No | Yes |
Energy Amount | 131,000 | 131,000 |
Minimum Balance | None | Required |
Best For | Occasional use | Continuous operations |
主机模式的影响
Infinity模式之前
- Limited number of purchased cycles
- Manual cycle purchases required
- Risk of running out of energy
- Variable monthly costs
- Standard processing priority
Infinity模式之后
- Unlimited energy cycles
- Automatic daily renewals
- Never runs out of energy
- Fixed predictable costs
- Priority processing queue
- Premium support access
##计费和成本
成本结构
- Daily Rate: 30 TRX per day (example rate)
- Weekly Rate: 200 TRX per week (discounted)
- Monthly Rate: 750 TRX per month (best value)
- Annual Rate: 8,000 TRX per year (maximum discount)
计费流程
初始充值
- First billing cycle charged immediately
- Prorated if activated mid-cycle
- Receipt sent via email
循环收费
- Automatic daily deduction
- Processed at UTC midnight
- Failed payments retry 3 times
余额要求
- Minimum balance: 10x daily rate
- Low balance warnings at 5 days remaining
- Auto-suspend if balance insufficient
支付方式
- Account balance (primary)
- Auto-recharge from card
- Cryptocurrency payments
- Wire transfers (enterprise)
安全注意事项
身份验证安全
- API Key Storage: Never expose API keys in client-side code
- HTTPS Only: All requests must use HTTPS
- IP Whitelist: Configure IP whitelist for production use
- Key Rotation: Rotate API keys regularly
验证检查
API 密钥验证
- Key exists and is active
- Account has infinity mode permissions
- Sufficient balance available
地址验证
- Address in Host Mode
- Owned by API key account
- No conflicting operations
请求完整性
- Valid JSON format
- Required fields present
- No injection attempts
- Rate limits enforced
审计追踪
所有无限模式激活都记录有:
- Timestamp
- API key used
- IP address
- Address activated
- Billing details
- Transaction hash
技术架构
服务组件
API 网关
- Request validation and routing
- Rate limiting enforcement
- IP whitelist checking
身份验证服务
- API key validation
- Permission checking
- Balance verification
无限模式管理器
- Mode activation logic
- Billing cycle management
- Auto-renewal processing
能量调度器
- Continuous delegation scheduling
- Priority queue management
- Resource optimization
计费服务
- Payment processing
- Balance management
- Invoice generation
数据库层
- PostgreSQL for persistent data
- Redis for caching and sessions
- Time-series data for usage analytics
请求流程
- Client sends POST request with API key and address
- API Gateway validates request format and rate limits
- Authentication Service verifies API key and permissions
- Balance check ensures sufficient funds
- Infinity Mode Manager activates unlimited cycles
- Energy Scheduler updates delegation queue
- Billing Service processes initial payment
- Response sent to client with activation details
高可用性
- Multi-region deployment
- Automatic failover
- 99.99% uptime SLA
- Real-time monitoring
- Incident response team
相关端点
- POST /apiv2/time/add - Add address to Host Mode (required first)
- POST /apiv2/time/stop - Pause infinity mode temporarily
- POST /apiv2/time/delete - Remove from Host Mode completely
- POST /apiv2/time/status - Check infinity mode status
- POST /apiv2/time/order - Not used with infinity mode
最佳实践
何时使用无限模式
- High-Frequency Operations: Smart contracts with constant activity
- Production Systems: Critical applications needing guaranteed energy
- Cost Predictability: When fixed costs are preferred
- Convenience: Eliminate manual cycle management
启用前
- Calculate Usage: Estimate daily energy needs
- Compare Costs: Infinity vs. standard cycles
- Fund Account: Ensure sufficient balance
- Test First: Try standard mode initially
启用后
- Monitor Usage: Track energy consumption patterns
- Set Alerts: Configure low balance notifications
- Review Billing: Check invoices regularly
- Optimize: Adjust based on actual usage
成本优化
- Annual Plans: Maximum discount for long-term commitment
- Multiple Addresses: Bundle for volume discounts
- Off-Peak Usage: Some operations can be scheduled
- Regular Review: Disable for inactive addresses
故障排除
常见问题
“主机模式下找不到地址”
问题: 启用无限模式前,地址必须处于主机模式
Solutions:
- Add address using
/time/add
endpoint first - Verify address is active with
/time/status
- Check correct API key is being used
“余额不足以启用无限模式”
问题: 账户余额不足以激活
Solutions:
- Add funds to account (minimum 10x daily rate)
- Check current balance in dashboard
- Consider weekly/monthly billing for lower minimum
- Contact support for payment arrangements
“已进入无限模式”
问题: 尝试两次启用无限模式
Solutions:
- Check current status with
/time/status
- No action needed if already active
- Use
/time/stop
to pause if needed - Contact support to modify settings
“权限被拒绝”
问题: 账户没有无限模式访问权限
Solutions:
- Upgrade to premium account tier
- Contact support to enable feature
- Check account permissions in dashboard
- Verify using correct API key
性能问题
激活缓慢
症状: 无限模式激活时间过长
Solutions:
- Check TRON network congestion
- Verify blockchain transaction status
- Retry if timeout occurs
- Contact support if persists
能量未委托
症状: 无限模式已激活但未收到能量
Solutions:
- Wait for next delegation cycle (up to 24 hours)
- Check address has sufficient bandwidth
- Verify no blockchain issues
- Contact support with transaction details
获取帮助
如果您遇到此处未涵盖的问题:
- Check Documentation: Review this guide and related endpoints
- API Status: Check https://status.netts.io for service status
- Dashboard: Review account settings and logs
- Support Ticket: Submit ticket with full details
- Emergency: Use priority support for infinity mode accounts
备注
- Prerequisites: Address must be in Host Mode via
/time/add
first - Immediate Activation: Infinity mode starts immediately upon success
- No Partial Mode: Address is either in standard or infinity mode, not both
- Cancellation: Use
/time/stop
to pause or/time/delete
to remove completely - Refunds: Unused daily balance not refunded if cancelled mid-cycle
- Upgrade Path: Can upgrade from standard to infinity mode anytime
- Downgrade: Can return to standard mode after current billing cycle
- Multiple Addresses: Each address requires separate infinity mode activation
- API Versioning: This is v2 API; v1 does not support infinity mode
- Maintenance: Infinity mode continues during maintenance windows
- SLA Guarantee: 99.99% uptime for infinity mode addresses
- Priority Support: Infinity mode accounts get priority support queue
- Bulk Activation: Contact support for bulk infinity mode activation
- Enterprise Plans: Custom rates available for high-volume users
- Monitoring: Real-time usage dashboard available for infinity mode accounts