POST /apiv2/time/status
检查您帐户下主机模式下所有TRON地址的综合状态。
概述
时间状态端点提供在主机模式下您 API 密钥管理的所有地址的完整概述。它返回有关每个地址的能量委托、周期计数、当前模式、计费状态和使用统计的详细信息。此端点对于监控您的能量分配、跟踪消耗和高效管理多个地址至关重要。
端点 URL
POST https://netts.io/apiv2/time/status
身份验证
此端点使用JSON主体身份验证(而非标头)。仅需在请求主体中提供您的API密钥即可检索所有关联地址的状态。
身份验证流程
- API Key Validation: System verifies the API key exists and is active
- IP Whitelist Check: Request IP must match configured whitelist
- Account Status Check: Verifies account is active and in good standing
- Data Aggregation: Collects status for all addresses under the API key
请求头
Header | Required | Description |
---|---|---|
Content-Type | Yes | application/json |
请求体
json
{
"api_key": "your_api_key"
}
参数
Parameter | Type | Required | Validation | Description |
---|---|---|---|---|
api_key | string | Yes | Must exist in system | Your API key for authentication |
参数验证
api_key:
- Must be a valid 32-character hexadecimal string
- Must be associated with an active account
- Account must not be suspended or restricted
- Must have at least read permissions
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/status \
-H "Content-Type: application/json" \
-d '{
"api_key": "YOUR_API_KEY_HERE"
}'
Python
python
import requests
import json
from typing import Dict, List
from datetime import datetime
def get_host_mode_status(api_key: str) -> Dict:
"""
Get comprehensive status of all addresses in Host Mode.
Args:
api_key: Your API authentication key
Returns:
API response dictionary with status for all addresses
"""
url = "https://netts.io/apiv2/time/status"
data = {
"api_key": api_key
}
try:
response = requests.post(url, json=data, verify=True, timeout=30)
response.raise_for_status()
result = response.json()
if result['code'] == 0:
print(f"✅ Status retrieved for {result['data']['total_addresses']} addresses")
print(f"Account balance: {result['data']['account_balance']} TRX")
print(f"Total energy delegated: {result['data']['total_energy_delegated']}")
# Display each address status
for addr in result['data']['addresses']:
print(f"\n📍 Address: {addr['address']}")
print(f" Mode: {addr['mode']}")
print(f" Status: {addr['status']}")
print(f" Cycles: {addr['cycles_remaining']}")
print(f" Energy: {addr['current_energy']}")
if addr['next_delegation_time']:
next_time = datetime.fromtimestamp(addr['next_delegation_time'])
print(f" Next delegation: {next_time.strftime('%Y-%m-%d %H:%M:%S')}")
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 with filtering
def display_active_addresses(api_key: str):
"""Display only active addresses with remaining cycles."""
result = get_host_mode_status(api_key)
if result['code'] == 0:
active = [a for a in result['data']['addresses']
if a['status'] == 'active' and a['cycles_remaining'] > 0]
print(f"\n🟢 Active Addresses: {len(active)}")
for addr in active:
print(f" - {addr['address']}: {addr['cycles_remaining']} cycles")
if __name__ == "__main__":
API_KEY = "YOUR_API_KEY_HERE"
# Get full status
result = get_host_mode_status(API_KEY)
# Show only active addresses
display_active_addresses(API_KEY)
Node.js
javascript
const axios = require('axios');
/**
* Get comprehensive status of all addresses in Host Mode
* @param {string} apiKey - Your API authentication key
* @returns {Promise<Object>} API response with status data
*/
async function getHostModeStatus(apiKey) {
const url = 'https://netts.io/apiv2/time/status';
const data = {
api_key: apiKey
};
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(`✅ Status retrieved for ${result.data.total_addresses} addresses`);
console.log(`Account balance: ${result.data.account_balance} TRX`);
console.log(`Total energy delegated: ${result.data.total_energy_delegated}`);
// Display each address status
result.data.addresses.forEach(addr => {
console.log(`\n📍 Address: ${addr.address}`);
console.log(` Mode: ${addr.mode}`);
console.log(` Status: ${addr.status}`);
console.log(` Cycles: ${addr.cycles_remaining}`);
console.log(` Energy: ${addr.current_energy}`);
if (addr.next_delegation_time) {
const nextTime = new Date(addr.next_delegation_time * 1000);
console.log(` Next delegation: ${nextTime.toLocaleString()}`);
}
});
} 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;
}
}
/**
* Get summary statistics from status data
* @param {Object} statusData - Status response data
* @returns {Object} Summary statistics
*/
function getStatusSummary(statusData) {
if (!statusData || !statusData.addresses) return null;
const summary = {
totalAddresses: statusData.total_addresses,
activeAddresses: 0,
pausedAddresses: 0,
infinityModeAddresses: 0,
totalCycles: 0,
totalEnergyAllocated: 0
};
statusData.addresses.forEach(addr => {
if (addr.status === 'active') summary.activeAddresses++;
if (addr.status === 'paused') summary.pausedAddresses++;
if (addr.mode === 'infinity') summary.infinityModeAddresses++;
summary.totalCycles += addr.cycles_remaining || 0;
summary.totalEnergyAllocated += addr.current_energy || 0;
});
return summary;
}
// Example usage
(async () => {
const API_KEY = 'YOUR_API_KEY_HERE';
try {
const result = await getHostModeStatus(API_KEY);
if (result.code === 0) {
const summary = getStatusSummary(result.data);
console.log('\n📊 Summary Statistics:');
console.log(summary);
}
} catch (error) {
console.error('Failed to get status:', error.message);
}
})();
PHP
php
<?php
/**
* Get comprehensive status of all addresses in Host Mode
*
* @param string $apiKey Your API authentication key
* @return array API response with status data
*/
function getHostModeStatus($apiKey) {
$url = 'https://netts.io/apiv2/time/status';
$data = [
'api_key' => $apiKey
];
$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 "✅ Status retrieved for {$result['data']['total_addresses']} addresses\n";
echo "Account balance: {$result['data']['account_balance']} TRX\n";
echo "Total energy delegated: {$result['data']['total_energy_delegated']}\n\n";
// Display each address status
foreach ($result['data']['addresses'] as $addr) {
echo "📍 Address: {$addr['address']}\n";
echo " Mode: {$addr['mode']}\n";
echo " Status: {$addr['status']}\n";
echo " Cycles: {$addr['cycles_remaining']}\n";
echo " Energy: {$addr['current_energy']}\n";
if ($addr['next_delegation_time']) {
$nextTime = date('Y-m-d H:i:s', $addr['next_delegation_time']);
echo " Next delegation: $nextTime\n";
}
echo "\n";
}
} else {
echo "❌ Error: {$result['msg']}\n";
}
return $result;
}
/**
* Filter addresses by status
*
* @param array $addresses List of addresses from status response
* @param string $status Status to filter by ('active', 'paused', 'stopped')
* @return array Filtered addresses
*/
function filterAddressesByStatus($addresses, $status) {
return array_filter($addresses, function($addr) use ($status) {
return $addr['status'] === $status;
});
}
/**
* Calculate total cycles across all addresses
*
* @param array $addresses List of addresses from status response
* @return int Total cycles
*/
function calculateTotalCycles($addresses) {
$total = 0;
foreach ($addresses as $addr) {
$total += $addr['cycles_remaining'] ?? 0;
}
return $total;
}
// Example usage
$API_KEY = 'YOUR_API_KEY_HERE';
try {
$result = getHostModeStatus($API_KEY);
if ($result['code'] == 0) {
// Get active addresses
$activeAddresses = filterAddressesByStatus($result['data']['addresses'], 'active');
echo "Active addresses: " . count($activeAddresses) . "\n";
// Calculate total cycles
$totalCycles = calculateTotalCycles($result['data']['addresses']);
echo "Total cycles remaining: $totalCycles\n";
}
} catch (Exception $e) {
echo "Failed to get status: " . $e->getMessage() . "\n";
}
?>
Ruby
ruby
require 'net/http'
require 'json'
require 'uri'
class HostModeStatus
API_URL = 'https://netts.io/apiv2/time/status'
def initialize(api_key)
@api_key = api_key
end
# Get comprehensive status of all addresses in Host Mode
def get_status
uri = URI.parse(API_URL)
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
http.read_timeout = 30
request = Net::HTTP::Post.new(uri.path)
request['Content-Type'] = 'application/json'
request.body = { api_key: @api_key }.to_json
begin
response = http.request(request)
result = JSON.parse(response.body)
if result['code'] == 0
puts "✅ Status retrieved for #{result['data']['total_addresses']} addresses"
puts "Account balance: #{result['data']['account_balance']} TRX"
puts "Total energy delegated: #{result['data']['total_energy_delegated']}"
display_addresses(result['data']['addresses'])
else
puts "❌ Error: #{result['msg']}"
end
result
rescue => e
puts "❌ Request failed: #{e.message}"
raise
end
end
private
# Display address details
def display_addresses(addresses)
addresses.each do |addr|
puts "\n📍 Address: #{addr['address']}"
puts " Mode: #{addr['mode']}"
puts " Status: #{addr['status']}"
puts " Cycles: #{addr['cycles_remaining']}"
puts " Energy: #{addr['current_energy']}"
if addr['next_delegation_time']
next_time = Time.at(addr['next_delegation_time'])
puts " Next delegation: #{next_time.strftime('%Y-%m-%d %H:%M:%S')}"
end
end
end
# Get addresses that need attention
def get_addresses_needing_attention(addresses)
addresses.select do |addr|
addr['cycles_remaining'] < 5 || addr['status'] == 'error'
end
end
# Calculate statistics
def calculate_statistics(addresses)
stats = {
total: addresses.length,
active: 0,
paused: 0,
infinity: 0,
total_cycles: 0,
total_energy: 0
}
addresses.each do |addr|
stats[:active] += 1 if addr['status'] == 'active'
stats[:paused] += 1 if addr['status'] == 'paused'
stats[:infinity] += 1 if addr['mode'] == 'infinity'
stats[:total_cycles] += addr['cycles_remaining'] || 0
stats[:total_energy] += addr['current_energy'] || 0
end
stats
end
end
# Example usage
api_key = 'YOUR_API_KEY_HERE'
status_checker = HostModeStatus.new(api_key)
begin
result = status_checker.get_status
if result['code'] == 0
stats = status_checker.calculate_statistics(result['data']['addresses'])
puts "\n📊 Statistics:"
puts stats
end
rescue => e
puts "Failed: #{e.message}"
end
响应
成功响应 (200 OK)
json
{
"code": 0,
"msg": "Status retrieved successfully",
"data": {
"total_addresses": 3,
"account_balance": 500.50,
"total_energy_delegated": 393000,
"total_cycles_remaining": 45,
"account_status": "active",
"api_key_status": "active",
"addresses": [
{
"address": "TQn9Y2khEsLJW1ChVWFMSMeRDow5KcbLSE",
"mode": "standard",
"status": "active",
"cycles_remaining": 15,
"cycles_used": 10,
"current_energy": 131000,
"energy_usage_24h": 95000,
"delegation_active": true,
"next_delegation_time": 1699615200,
"last_delegation_time": 1699528800,
"added_at": 1699442400,
"last_activity": 1699528000,
"transaction_count_24h": 42,
"average_energy_per_tx": 2261,
"delegation_history": [
{
"timestamp": 1699528800,
"energy": 131000,
"tx_hash": "abc123..."
}
]
},
{
"address": "TYn8Y3khEsLJW2ChVWFMSMeRDow6KcbMTF",
"mode": "infinity",
"status": "active",
"cycles_remaining": -1,
"cycles_used": 0,
"current_energy": 131000,
"energy_usage_24h": 120000,
"delegation_active": true,
"next_delegation_time": 1699615200,
"last_delegation_time": 1699528800,
"infinity_start_date": 1699200000,
"daily_cost": 30,
"next_billing_date": 1699615200,
"added_at": 1699200000,
"last_activity": 1699528500,
"transaction_count_24h": 156,
"average_energy_per_tx": 769
},
{
"address": "TZn9Y4khEsLJW3ChVWFMSMeRDow7KcbNUG",
"mode": "standard",
"status": "paused",
"cycles_remaining": 30,
"cycles_used": 5,
"current_energy": 0,
"energy_usage_24h": 0,
"delegation_active": false,
"next_delegation_time": null,
"last_delegation_time": 1699356000,
"paused_at": 1699442400,
"pause_reason": "user_requested",
"added_at": 1699100000,
"last_activity": 1699442400,
"transaction_count_24h": 0,
"average_energy_per_tx": 0
}
],
"summary": {
"active_addresses": 2,
"paused_addresses": 1,
"stopped_addresses": 0,
"infinity_mode_addresses": 1,
"standard_mode_addresses": 2,
"addresses_low_cycles": 0,
"addresses_no_cycles": 0,
"total_energy_capacity": 393000,
"total_energy_used_24h": 215000,
"energy_utilization_rate": 54.7
},
"billing": {
"current_period_charges": 45.00,
"pending_charges": 0,
"last_payment_date": 1699442400,
"next_billing_date": 1699615200,
"payment_method": "account_balance",
"auto_recharge_enabled": true,
"auto_recharge_threshold": 100,
"auto_recharge_amount": 500
},
"limits": {
"max_addresses": 100,
"max_cycles_per_address": 10000,
"max_daily_spend": 1000,
"current_daily_spend": 45.00
}
}
}
响应字段
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.total_addresses | integer | Total number of addresses in Host Mode |
data.account_balance | number | Current account balance in TRX |
data.total_energy_delegated | integer | Total energy currently delegated across all addresses |
data.total_cycles_remaining | integer | Sum of all remaining cycles (excluding infinity mode) |
data.account_status | string | Account status ("active", "suspended", "limited") |
data.api_key_status | string | API key status ("active", "expired", "revoked") |
data.addresses | array | Array of address objects with detailed status |
data.summary | object | Summary statistics across all addresses |
data.billing | object | Billing information and payment details |
data.limits | object | Account limits and current usage |
地址对象字段
Field | Type | Description |
---|---|---|
address | string | TRON address |
mode | string | Current mode ("standard", "infinity") |
status | string | Current status ("active", "paused", "stopped", "error") |
cycles_remaining | integer | Number of cycles remaining (-1 for infinity mode) |
cycles_used | integer | Number of cycles consumed |
current_energy | integer | Currently delegated energy amount |
energy_usage_24h | integer | Energy consumed in last 24 hours |
delegation_active | boolean | Whether delegation is currently active |
next_delegation_time | integer|null | Unix timestamp for next delegation |
last_delegation_time | integer|null | Unix timestamp of last delegation |
added_at | integer | Unix timestamp when added to Host Mode |
last_activity | integer | Unix timestamp of last activity |
transaction_count_24h | integer | Number of transactions in last 24 hours |
average_energy_per_tx | number | Average energy per transaction |
delegation_history | array | Recent delegation history (last 5) |
Infinity模式的附加字段
Field | Type | Description |
---|---|---|
infinity_start_date | integer | Unix timestamp when infinity mode started |
daily_cost | number | Daily cost in TRX for infinity mode |
next_billing_date | integer | Unix timestamp for next billing |
已暂停状态的附加字段
Field | Type | Description |
---|---|---|
paused_at | integer | Unix timestamp when paused |
pause_reason | string | Reason for pause ("user_requested", "insufficient_balance", "error") |
错误响应
身份验证错误 (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": "No addresses found in Host Mode",
"data": {
"suggestion": "Use /time/add to add addresses to Host Mode",
"api_key": "248f***4a"
}
}
Causes:
- No addresses added to Host Mode yet
- All addresses have been deleted
- Wrong API key being used
Resolution:
- Add addresses using
/time/add
endpoint - Verify using correct API key
- Check if addresses were deleted
IP 未列入白名单 (403)
json
{
"code": -1,
"msg": "IP address not whitelisted",
"data": {
"ip": "192.168.1.100",
"suggestion": "Add this IP to whitelist in dashboard"
}
}
Causes:
- Request IP not in API key whitelist
- IP address changed since configuration
- Using proxy or VPN
Resolution:
- Add IP to whitelist in dashboard
- Verify not using proxy/VPN
- Contact support to update whitelist
账户已暂停 (403)
json
{
"code": -1,
"msg": "Account suspended",
"data": {
"reason": "payment_failure",
"suspended_at": 1699442400,
"contact": "[email protected]"
}
}
Causes:
- Failed payments
- Terms of service violation
- Suspicious activity detected
Resolution:
- Resolve payment issues
- Contact support for reinstatement
- Review account activity
速率限制
Period | Limit | Description |
---|---|---|
1 minute | 60 requests | Higher limit for status checks |
1 hour | 1000 requests | Maximum 1000 requests per hour |
1 day | 10000 requests | Maximum 10000 requests per day |
速率限制报头
http
X-RateLimit-Limit-Minute: 60
X-RateLimit-Remaining-Minute: 59
X-RateLimit-Reset-Minute: 1699528860
X-RateLimit-Limit-Hour: 1000
X-RateLimit-Remaining-Hour: 998
X-RateLimit-Reset-Hour: 1699532400
X-RateLimit-Limit-Day: 10000
X-RateLimit-Remaining-Day: 9995
X-RateLimit-Reset-Day: 1699574400
速率限制超出响应 (429)
json
{
"code": -1,
"msg": "API rate limit exceeded",
"data": {
"retry_after": 45,
"limit": "60 per minute",
"reset_at": 1699528860
}
}
理解状态数据
地址模式
标准模式
- Fixed number of cycles
- Manual cycle purchases
- Cycles consumed sequentially
- Shown as
mode: "standard"
无限模式
- Unlimited cycles
- Daily billing
- Auto-renewal
- Shown as
mode: "infinity"
cycles_remaining: -1
indicates unlimited
地址状态值
Status | Description | Can Receive Energy | Action Required |
---|---|---|---|
active | Normal operation | Yes | None |
paused | Temporarily stopped | No | Use /time/infinitystart to resume |
stopped | Permanently stopped | No | Use /time/add to restart |
error | Problem detected | Maybe | Check error details |
pending | Activation in progress | Soon | Wait for activation |
expired | All cycles consumed | No | Purchase more cycles |
能量状态
Delegated Energy (
current_energy
)- Amount currently delegated to address
- Usually 131,000 when active
- 0 when paused or stopped
Energy Usage (
energy_usage_24h
)- Actual consumption in last 24 hours
- Helps optimize cycle purchases
- Used for utilization calculations
Energy Efficiency (
average_energy_per_tx
)- Average energy per transaction
- Lower is more efficient
- Helps identify optimization opportunities
周期信息
- cycles_remaining: Unused cycles in queue
- cycles_used: Historical count of consumed cycles
- -1: Indicates infinity mode (unlimited)
- 0: No cycles, needs purchase or infinity mode
摘要统计
关键指标
利用率
utilization_rate = (total_energy_used_24h / total_energy_capacity) × 100
- Shows efficiency of energy allocation
- High rate (>80%) suggests need for more energy
- Low rate (<30%) suggests over-provisioning
地址健康状况
- Healthy: Active with sufficient cycles
- Warning: <5 cycles remaining
- Critical: 0 cycles or error status
成本分析
- Daily spend rate
- Cost per transaction
- Infinity vs standard mode comparison
监控建议
Metric | Good | Warning | Critical |
---|---|---|---|
Cycles Remaining | >10 | 5-10 | <5 |
Utilization Rate | 50-80% | 30-50% or 80-90% | <30% or >90% |
Failed Transactions | 0 | 1-5 per day | >5 per day |
Account Balance | >30 days cost | 7-30 days | <7 days |
使用状态数据
常用案例
监控仪表盘
python# Poll status every 5 minutes import time while True: status = get_host_mode_status(API_KEY) update_dashboard(status) check_alerts(status) time.sleep(300)
低周期警报
javascript// Check for addresses with low cycles const lowCycleAddresses = result.data.addresses.filter( addr => addr.cycles_remaining > 0 && addr.cycles_remaining < 5 ); if (lowCycleAddresses.length > 0) { sendAlert('Low cycles detected', lowCycleAddresses); }
成本优化
python# Compare standard vs infinity mode costs def analyze_cost_efficiency(status_data): for addr in status_data['addresses']: if addr['mode'] == 'standard': daily_cycles = addr['energy_usage_24h'] / 131000 standard_cost = daily_cycles * 3.0 # Price per cycle infinity_cost = 30.0 # Daily infinity rate if standard_cost > infinity_cost: print(f"{addr['address']} would save with infinity mode")
自动化循环购买
javascript// Auto-purchase cycles when low async function maintainCycles(minCycles = 10) { const status = await getHostModeStatus(API_KEY); for (const addr of status.data.addresses) { if (addr.cycles_remaining < minCycles && addr.mode === 'standard') { await orderCycles(API_KEY, addr.address, 50); console.log(`Ordered 50 cycles for ${addr.address}`); } } }
账单信息
账单数据理解
当前周期费用
- Accumulated charges in current billing period
- Includes cycle purchases and infinity mode fees
- Resets at billing cycle end
支付方式
account_balance
: Using prepaid balancecard
: Credit/debit card on filecrypto
: Cryptocurrency paymentsinvoice
: Enterprise invoicing
自动充值
- Automatically tops up balance when low
- Configurable threshold and amount
- Prevents service interruption
###计费周期
Billing Type | Period | Charge Time | Invoice |
---|---|---|---|
Cycle Purchase | Immediate | At purchase | Yes |
Infinity Daily | 24 hours | Midnight UTC | Daily |
Infinity Weekly | 7 days | Sunday UTC | Weekly |
Infinity Monthly | 30 days | 1st of month | Monthly |
技术细节
响应缓存
- Status data cached for 30 seconds
- Real-time delegation status always fresh
- Historical data updated every 5 minutes
- Force refresh available via header
数据聚合
状态端点聚合来自多个来源的数据:
- Database: Address configuration, cycles, history
- Blockchain: Current delegations, energy levels
- Cache: Recent transactions, usage statistics
- Billing System: Charges, payments, balances
性能注意事项
- Response time: 200-500ms typical
- Large accounts (>50 addresses): 500-1000ms
- Maximum addresses returned: 1000
- Pagination available for large accounts
安全注意事项
数据隐私
- Only shows addresses owned by API key
- No cross-account data exposure
- Sensitive data (full API key) redacted
- Transaction hashes truncated
访问控制
只读访问
- Status endpoint is read-only
- Cannot modify addresses or settings
- Safe for monitoring systems
IP 限制
- Enforced even for read operations
- Prevents unauthorized access
- Logs all access attempts
速率限制
- Higher limits for status checks
- Prevents abuse and scanning
- Per-API-key enforcement
相关端点
- POST /apiv2/time/add - Add new addresses to Host Mode
- POST /apiv2/time/order - Purchase cycles for addresses
- POST /apiv2/time/infinitystart - Enable infinity mode
- POST /apiv2/time/stop - Pause energy delegations
- POST /apiv2/time/delete - Remove addresses from Host Mode
最佳实践
监控策略
定期轮询
- Check status every 5-15 minutes
- More frequent during high activity
- Less frequent during off-hours
告警阈值
- Low cycles: <5 remaining
- Low balance: <7 days of costs
- High utilization: >90%
- Errors: Any error status
数据保留
- Store status snapshots hourly
- Keep daily summaries for 30 days
- Archive monthly reports
集成模式
仪表盘集成
javascript// Update dashboard with real-time data setInterval(async () => { const status = await getHostModeStatus(API_KEY); updateDashboard(status); checkAlerts(status); }, 300000); // Every 5 minutes
Webhook 触发器
python# Trigger webhooks based on status def check_status_triggers(status_data): for addr in status_data['addresses']: if addr['cycles_remaining'] < 5: trigger_webhook('low_cycles', addr) if addr['status'] == 'error': trigger_webhook('address_error', addr)
自动化管理
python# Automated address management def manage_addresses(status_data): for addr in status_data['addresses']: # Auto-purchase cycles if addr['cycles_remaining'] < 10: order_cycles(addr['address'], 50) # Switch to infinity for high usage if addr['energy_usage_24h'] > 300000: enable_infinity_mode(addr['address'])
故障排除
常见问题
空地址列表
问题: 状态返回无地址,尽管已添加地址
Solutions:
- Verify correct API key is being used
- Check if addresses were deleted
- Ensure addresses were successfully added
- Wait 1-2 minutes after adding for propagation
陈旧数据
问题: 状态数据似乎已过期
Solutions:
- Check
last_activity
timestamps - Verify blockchain connectivity
- Force cache refresh with header
- Contact support if persists
缺失字段
问题: 部分预期字段为空或缺失
Solutions:
- Check if address is in correct mode
- Some fields only appear for specific statuses
- Infinity mode has different fields than standard
- Review field documentation
能量值错误
问题: 能量值与预期不符
Solutions:
- Energy updates may have 1-2 minute delay
- Check blockchain for confirmation
- Verify delegation transaction completed
- Consider network congestion
性能问题
响应缓慢
症状: 状态端点耗时 >2 秒
Solutions:
- Check number of addresses (pagination for >100)
- Verify network connectivity
- Consider caching responses client-side
- Use summary endpoint for overview
速率限制问题
症状: 频繁达到速率限制
Solutions:
- Reduce polling frequency
- Implement exponential backoff
- Cache responses appropriately
- Consider webhook notifications instead
备注
- Real-Time Data: Energy and delegation status are real-time from blockchain
- Historical Data: Transaction counts and usage stats update every 5 minutes
- Billing Data: Payment and charge information updates immediately
- No Filtering: All addresses returned; filter client-side if needed
- Timezone: All timestamps in Unix format (UTC)
- Precision: Energy amounts in base units (1 TRX = 1,000,000 SUN)
- Infinity Mode: Shows as -1 cycles (unlimited)
- Pagination: Available for accounts with >1000 addresses
- Webhooks: Consider webhooks for real-time updates instead of polling
- Caching: Implement client-side caching to reduce API calls
- Batch Operations: Status check is more efficient than individual address queries
- Mobile Apps: Higher rate limits available for verified mobile applications
- Enterprise: Custom endpoints available for enterprise accounts
- SLA: 99.9% uptime guarantee for status endpoint
- Monitoring: Built-in monitoring and alerting for enterprise accounts