关灯

Stream ethereum (ERC20) transactions (node.js)

  [复制链接]
区块链技术 发表于 2019-1-1 11:00:55 | 显示全部楼层 |阅读模式 打印 上一主题 下一主题
 

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有帐号?立即注册 新浪微博登陆

x

I would like to get discord message every time when address receive ERC20 token. Is there any way to stream Ethereum transactions?

I tried https://github.com/AlexanderC/ethereum-transaction-stream but it's not working as I want (it start scanning all transactions including old ones).




上一篇:Error: [ethjs-abi] invalid hex or buffer, must be a prefixed alphanumeric even l
下一篇:OpenZeppelin crowdsale token ownership
版权申明:此文如未标注转载均为本站原创,自由转载请注明 本贴地址:https://xuesq.cn/thread-109449-1-1.html 上篇帖子: 动态 | CryptoKitty为赵长鹏制作Kitty形象 部分收益将捐给币安慈善基金 ... 下篇帖子: 你有没有勇气和币市说再见 stream transactions
回复

使用道具 举报

 

精彩评论1

正序浏览
区块链技术 发表于 2019-1-1 11:24:58 | 显示全部楼层
 

The code you show has an option to select the rnage of blocks to sear for the transactions:

// Creates a new stream.
  // Note that "startblock", "endblock", "ERC20TokenAddress" and "mintOnly" options
  // are only available for "EtherscanHTTP" provider. By including "ERC20TokenAddress"
  // there will be included transactions for ERC20 token only and enabling "mintOnly"
  // option will result in leaving only token minting events.
  // Important: "ERC20TokenAddress" and "mintOnly" options are available only when "includeLogs" enabled
  // Important: the result will INCLUDE transactions from the "startblock"
  const stream = await ets.stream(
    '0x4a1eade6b3780b50582344c162a547d04e4e8e4a'
    /*, startblock, endblock, ERC20TokenAddress, mintOnly */
  );

if you are going to search block by block, set the start and end block to the block you are interested in.

Hope this helps

回复

使用道具 举报

 
您需要登录后才可以回帖 登录 | 立即注册 新浪微博登陆

本版积分规则

排行榜

关注我们:微信订阅号

官方微信

APP下载

全国服务邮箱:

admin@xuesq.cn

公司地址:重庆南岸区学府大道

运营中心:重庆微生派网络工作室

邮编:610066 Email:1401171837#qq.com

Copyright   ©2017-2018  中比特Powered by©xuesq.cn!技术支持:中比特    ( 蜀ICP备16009247号-1 )