我收到了这条消息。
无法连接到live.stellar.org端口9002:连接超时
我的代码是,请帮助我。
$fields = array(
'method' => 'account_tx',
'params' => array(
array(
'account' => 'gPP3hmC86rA8aJiCwRLXRLd9NxGnL2qSwG',
'limit' => '20'
)
)
);
$data = json_encode($fields);
$response = curl_post($data);
function curl_post($fields)
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://live.stellar.org:9002");
//curl_setopt($ch, CURLOPT_PORT , 9002);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS,$fields);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec ($ch);
echo curl_error($ch);
curl_close ($ch);
return $response;
}
这是来自Stellar的API代码:
curl -X POST https://live.stellar.org:9002 -d '
{
"method": "account_tx",
"params": [
{
"account": "gPP3hmC86rA8aJiCwRLXRLd9NxGnL2qSwG",
"limit": 4
}
]
}'
答案 0 :(得分:-1)
一切都是对的。
所以,可能性是:
在其他主机上试用此代码或在本地运行以确保。