简体   繁体   English

在没有浏览器的情况下使用Node.js App观看以太坊智能合约事件

[英]Watch Ethereum Smart Contract Events with Node.js App without browser

I need to be able to listen to events from a smart contract on the ethereum blockchain. 我需要能够侦听以太坊区块链上智能合约中的事件。 I'd like to use Node.js but it only seem to work if I open the App in my browser. 我想使用Node.js,但只有在浏览器中打开应用程序后,它才能正常工作。 I want the node app to run in the background, listen for events and then do something automatically. 我希望节点应用程序在后台运行,侦听事件,然后自动执行某些操作。

Is this possible or would you recommend any other technology? 这可能吗,或者您会推荐其他任何技术?

Solution: Minimal Node.js App with express and web3. 解决方案:带有Express和Web3的最小Node.js应用。 Try this repository as a reference, it was very insightful to me: https://github.com/nacmonad/eth-iot-examples/ 尝试将此存储库作为参考,这对我来说是很有见地的: https//github.com/nacmonad/eth-iot-examples/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Node JS 与以太坊智能合约交互 - Node JS Interacting with Ethereum Smart Contract 使用 Node.js 编译和部署以太坊智能合约时出错 - Getting error when compiling and deploying ethereum smart contract with Node.js 如何在 node.js 应用程序中使用 ethers.js contract.on() 监听来自智能合约的事件? - How do I listen to events from a smart contract using ethers.js contract.on() in a node.js application? 如何从 node.js 应用程序永久监听智能合约中的事件? - How to listen permanently to events in a smart contract from node.js Application? Node.js addEventListener等事件无浏览器 - Node.js addEventListener and other events without browser Node.js:从浏览器接收事件 - Node.js: Receive events from browser 如何用WalletConnect调用智能合约function? (React.js, Node.js) - How to call a smart contract function with WalletConnect? (React.js, Node.js) 如何从node.js在智能合约中创建令牌? - How can I create tokens in smart contract from node.js? ethereum remix 中的简单智能合约 - ParserError: Expected ';' - Simple smart contract in ethereum remix - ParserError: Expected ';' 如何使用 nodejs 上的 Web3js 解码在以太坊上调用智能合约的响应 - How to decode response from calling smart contract on Ethereum using Web3js on nodejs
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM