V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
diveinto
V2EX  ›  分享发现

开源了一个以太坊的小工具,用来监听新的区块和 transaction 事件

  •  1
     
  •   diveinto · 2019-12-27 21:35:13 +08:00 · 3744 次点击
    这是一个创建于 1575 天前的主题,其中的信息可能已经有所发展或是发生改变。

    不知道有没有人需要 (~~并没有~~)

    地址: https://github.com/HydroProtocol/nights-watch

    内部好几个 production 的服务用到了这个组件,对有类似需求的同学,用起来应该挺顺手的

    第 1 条附言  ·  2020-01-03 10:09:25 +08:00

    方便上手,加了个 docker image,来展示这个 lib 能做些什么

    比如监控 USDT 的转账事件

    docker run diveinto/nights-watch:master /bin/nights-watch usdt-transfer
    

    usdt transfer

    更多见 help

    docker run diveinto/nights-watch:master /bin/nights-watch help
    

    Screen Shot 2020-01-03 at 10 07 16 AM

    6 条回复    2020-10-16 11:13:37 +08:00
    ob
        1
    ob  
       2019-12-27 21:43:27 +08:00 via Android
    数据来源哪个节点?
    diveinto
        2
    diveinto  
    OP
       2019-12-27 21:45:37 +08:00   ❤️ 1
    @ob 需要自己配置以太坊节点,可以用 [infura]( https://infura.io/) 提供的免费节点,也可以自己跑以太坊的 Node
    ob
        3
    ob  
       2019-12-27 21:59:46 +08:00 via Android
    @diveinto 那你这个工具提供的数据 infura api 本身不都有了吗?你们内部用的场景是怎样?
    diveinto
        4
    diveinto  
    OP
       2019-12-27 22:13:52 +08:00   ❤️ 1
    比如我们需要监控特定合约里新产生的交易事件,用我们这个库只需要配置好合约地址和事件 Hash 即可,这样用这个库的人就可以专注写自己的业务逻辑。

    例如这里 https://github.com/HydroProtocol/nights-watch/blob/master/watcher_with_receipt_logs_plugin_test.go#L22:L28
    lxzhtxh13
        5
    lxzhtxh13  
       2019-12-29 09:39:44 +08:00
    看起来都好高深的样子
    pynix
        6
    pynix  
       2020-10-16 11:13:37 +08:00
    交易所充值监控。。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1299 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 17:40 · PVG 01:40 · LAX 10:40 · JFK 13:40
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.