比特幣(Bitcoin) RPC Network API中getnodeaddresses的用法及代碼示例。
用法:
getnodeaddresses ( count )
返回已知地址,可用於在網絡中查找新節點
參數1 - count
類型:數字,可選,默認值= 1
返回多少個地址。限於2500個較小的地址或所有已知地址的23%。
返回結果
[
{
"time": ttt, (numeric) Timestamp in seconds since epoch (Jan 1 1970 GMT) keeping track of when the node was last seen
"services": n, (numeric) The services offered
"address": "host", (string) The address of the node
"port": n (numeric) The port of the node
}
,....
]
示例
bitcoin-cli getnodeaddresses 8
curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getnodeaddresses", "params": [8] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/
相關用法
- Bitcoin addnode用法及代碼示例
- Bitcoin clearbanned用法及代碼示例
- Bitcoin disconnectnode用法及代碼示例
- Bitcoin getaddednodeinfo用法及代碼示例
- Bitcoin getconnectioncount用法及代碼示例
- Bitcoin getnettotals用法及代碼示例
- Bitcoin getnetworkinfo用法及代碼示例
- Bitcoin getpeerinfo用法及代碼示例
- Bitcoin listbanned用法及代碼示例
- Bitcoin ping用法及代碼示例
- Bitcoin setban用法及代碼示例
注:本文由純淨天空篩選整理自bitcoin.org大神的英文原創作品 Bitcoin getnodeaddresses。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。