我正在尝试使用
bitcoind gettransaction \
9962d5c704ec27243364cbe9d384808feeac1c15c35ac790dffd1e929829b271
但我收到
error: {"code":-5,"message":"Invalid or non-wallet transaction id"}
如何使用比特币 API 查看交易?
我正在尝试使用
bitcoind gettransaction \
9962d5c704ec27243364cbe9d384808feeac1c15c35ac790dffd1e929829b271
但我收到
error: {"code":-5,"message":"Invalid or non-wallet transaction id"}
如何使用比特币 API 查看交易?
您可以使用 bitcoind 查看国外交易。
在你索引了几个块之后,你可以使用这样的东西:
$ bitcoind getblockcount
122735
$ bitcoind getblockhash 67543
0000000004e213266ccd388df12896412c1a70e647b48004f7d6894b9d6f63b9
$ bitcoind getblock 0000000004e213266ccd388df12896412c1a70e647b48004f7d6894b9d6f63b9
// JSON containing tx "a93a668d9332e21d51380c7251bbf5ad47295ca9795e0ad6f2fe8d63b76af9aa"
$ bitcoind getrawtransaction a93a668d9332e21d51380c7251bbf5ad47295ca9795e0ad6f2fe8d63b76af9aa 1
// json of transaction - note that "1" at the end tells bitcoind to decode into json
有关更多信息,请参阅此。
getrawtransaction <txid>
命令甚至从 Bitcoin-qt 客户端获取任何交易
Bitcoin-Qt/bitcoind 0.7 版引入了“原始交易 API”。它为开发人员或非常复杂的最终用户提供了对事务创建和广播的低级访问权限。
这将返回十六进制的字节字符串,这不是很有用。但是如果你输入
getrawtransaction <txid> 1
您将获得格式良好的 JSON 表示
znort987 的blockparser 程序看起来很有希望。我还没有机会玩它,所以我不确定它是否具有指定要检查的单个交易的本机支持,但是 doco 说如果您知道接收地址,那么您可以获得所有交易详细信息那个地址是这样的:
./parser transactions the_receiving_address
正如错误所说,您正在尝试查看不属于您钱包的交易。Bitcoind 仅允许您探索与您的钱包相关的交易。
如果您想探索“外国”交易,您应该使用其他工具,例如http://blockexplorer.com/