Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/35.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Node.js 如何通过指定的地址以太坊获取挂起的事务?_Node.js_Blockchain_Ethereum_Solidity - Fatal编程技术网

Node.js 如何通过指定的地址以太坊获取挂起的事务?

Node.js 如何通过指定的地址以太坊获取挂起的事务?,node.js,blockchain,ethereum,solidity,Node.js,Blockchain,Ethereum,Solidity,你能帮我吗?我几乎什么都试过了 我试过这个: var选项={ fromBlock:“待定”, 托布洛克:“最新”, 地址:“0xabc123…”, } web3.eth.filter(选项,(错误,结果)=>{ 如果(!错误) 控制台日志(结果); }); 但它什么也没回来 我还尝试了eth.subscribe,但它返回了每个挂起的事务您可以使用getBlock在挂起的块中搜索事务,并通过结果中的事务id进行循环。请检查文档中的示例输出 web3.eth.getBlock("pend

你能帮我吗?我几乎什么都试过了

我试过这个:

var选项={
fromBlock:“待定”,
托布洛克:“最新”,
地址:“0xabc123…”,
}
web3.eth.filter(选项,(错误,结果)=>{
如果(!错误)
控制台日志(结果);
});
但它什么也没回来
我还尝试了
eth.subscribe
,但它返回了每个挂起的事务

您可以使用getBlock在挂起的块中搜索事务,并通过结果中的事务id进行循环。请检查文档中的示例输出

web3.eth.getBlock("pending")
如果您知道您的交易id,您可以立即使用GetTransactionReceive

web3.eth.getTransaction( {transaction id} )
但如果您是按发件人或收件人地址搜索,则可能需要从挂起块的事务id获取TransactionReceive