我该如何从流量区块链上的智能合约中听取活动?
我使用了一些服务来聆听我在以太坊上的智能合约中的活动。 但是我找不到与流量区块链一起工作时的任何文档。 我该怎么做?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
我使用了一些服务来聆听我在以太坊上的智能合约中的活动。 但是我找不到与流量区块链一起工作时的任何文档。 我该怎么做?
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(3)
对于一项共同任务来说,这是一个非常好的问题!
@onflow/fllfly/fcl 软件包为您提供有用的方法
events ,可用于“订阅”特定事件。
您可以在Flow Docs网站上查看事件描述。或者,您可以复制/粘贴代码bellow并随身携带:
您也可以尝试使用工作 codesandbox示例
This is a really nice question for a common task!
@onflow/fcl package provides you with a helpful method
events
, which can be used to "subscribe" to a specific event.You can check events description on Flow Docs Site. Or you can copy/paste code bellow and play around with it:
You can also try and play around with working Codesandbox Example
有多种方法可以做到这一点。我认为最简单的是为此使用服务。目前,我们在.find上使用的是 https://graffle.io.io 。
您也可以使用其中一个SDK自己制作。 Kitty-items有一个 https://github.com/onflow/kitty/kitty-iTems/ << /a>在JavaScript中。
如果您喜欢Golang,我将有一些事件提取代码 https:// https:// github.com/bjartek/overflow/blob/main/overflow/event.go 。这是有关如何使用的示例:
There are multiple ways of doing this. The easiest I think is to use a service for this. The one we use at .find at the moment is https://graffle.io.
You could also make your own using one of the SDKs. Kitty-items has an example of this https://github.com/onflow/kitty-items/ in javascript.
If you prefer golang I have some event fetching code in overflow https://github.com/bjartek/overflow/blob/main/overflow/event.go. Here is an example on how it can be used: https://github.com/bjartek/overflow/blob/main/overflow/event_integration_test.go#L13
上面的更新:铺设不再提供此功能。
Flow最近发布了事件流API访问,可从访问节点获得。这为消费事件提供了基于推动的访问范式,而无需进行接触调查。
flip: https> https:https:https: //forum.flow.com/t/flip-73-proposal-to-add-event-streaming-to-access-api/4509
docs: https://developers.flower.flow.com/architector.com/architector/node-ops/nodecture/node-ops/nodops/ Access-api#tag/nodeversionInfo/paths/〜1node_version_info/get
Update on above: Graffle no longer provides this capability.
Flow recently released Event Streaming API access which are available from Access Nodes. This offers a push based access paradigm for consuming events without the need for contact polling.
FLIP: https://forum.flow.com/t/flip-73-proposal-to-add-event-streaming-to-access-api/4509
Docs: https://developers.flow.com/architecture/node-ops/nodes/access-api#tag/NodeVersionInfo/paths/~1node_version_info/get