How can we receive hashtx and hashblock from bitcoind by zmq subscribe? #8759

issue caiqinghua opened this issue on September 19, 2016
  1. caiqinghua commented at 1:34 PM on September 19, 2016: none

    <!--- Remove sections that do not apply -->

    Describe the issue

    zmq is not default build in v0.13.0 installed by sudo apt-get install in Ubutun 16.04.

    Is the issue reproducible?

    yes

    List steps to reproduce below:

    1. install bitcoind by sudo apt install bitcoind in Ubuntu 16.04 server amd64(https://bitcoin.org/en/full-node#ubuntu-1410)
    2. bitcoind --version show v0.13 ga402396
    3. bitcoind -daemon -debug -zmqpubhashblock=tcp://127.0.0.1:28332 -zmqpubhashtx=tcp://127.0.0.1:28332 after download, blocks file is 89G. and the bitcoin.conf only have rpcuser=xxxyyy and rpcpassword=xxx123 should add server=1 to bitcoin.conf?
    4. git clone https://github.com/bitcoin/bitcoin
    5. cd bitcoin/contrib/zmq and pip install zmq, then do python zmq_sub.py and we can't receive anything in long wait. How can we receive hashtx and hashblock from bitcoind? Should i install libzmq3-dev? Is libzmq3-dev only for compile bitcoind and don't need in runtime?
    6. after sudo apt remove bitciond and git clone https://github.com/bitcoin/bitcoin & make & sudo make install.
    7. bitcoind -daemon -debug -zmqpubhashblock=tcp://127.0.0.1:28332 -zmqpubhashtx=tcp://127.0.0.1:28332 then we see zmq: Initialize notification interface in debug.log

    Expected behavior

    Tell us what should happen we should see "zmq: Initialize notification interface" in debug.log. and we should receive hashtx or hashblock.

    ~/bitcoin/contrib/zmq$ python zmq_sub.py

    • HASH TX (5401) - 0ff9c69f43b41456e57120507683a45d69b04f7be7fc3d70e48d5ae21bf665a2
    • HASH TX (5402) - 5fe5fa7324a05471b65360c4ae40d9494159d96c4a3375ceef8b8f3ca367abcd

    Actual behavior

    Tell us what happens instead we haven't see "zmq: Initialize notification interface" in debug.log. and we have't receive anything.

    Any information in the debug.log file related to this issue?

    no

    Screenshots (if available)

    What binary version was used (official or self compiled)

    v0.13 ga402396

    Machine specs: CPU, RAM, Disk space & OS (Windows, OS X, Linux)

    Intel 1000G Linux(Ubuntu 16.04 server amd64)

  2. caiqinghua renamed this:
    How can i receive hashtx and hashblock from bitcoind by zmq subscribe?
    How can we receive hashtx and hashblock from bitcoind by zmq subscribe?
    on Sep 19, 2016
  3. caiqinghua commented at 5:25 AM on September 20, 2016: none

    @laanwj i can't find zmq: Initialize notification interface in problem version debug.log

    bitcoind -daemon -zmqpubhashblock=tcp://127.0.0.1:28332 -zmqpubhashtx=tcp://127.0.0.1:28332

    2016-09-20 03:09:37 Bitcoin version v0.13.0.0-ga402396 2016-09-20 03:09:37 InitParameterInteraction: parameter interaction: -whitelistforcerelay=1 -> setting -whitelistrelay=1 2016-09-20 03:09:37 Default data directory /home/lin/.bitcoin 2016-09-20 03:09:37 Using data directory /home/lin/.bitcoin 2016-09-20 03:09:37 Using config file /home/lin/.bitcoin/bitcoin.conf 2016-09-20 03:09:37 Using at most 125 connections (1024 file descriptors available) 2016-09-20 03:09:37 Using 4 threads for script verification 2016-09-20 03:09:37 scheduler thread start 2016-09-20 03:09:37 HTTP: creating work queue of depth 16 2016-09-20 03:09:37 Config options rpcuser and rpcpassword will soon be deprecated. Locally-run instances may remove rpcuser to use cookie-based auth, or may be replaced with rpcauth. Please see share/rpcuser for rpcauth auth generation. 2016-09-20 03:09:37 HTTP: starting 4 worker threads 2016-09-20 03:09:37 Using BerkeleyDB version Berkeley DB 4.8.30: (April 9, 2010) 2016-09-20 03:09:37 Using wallet wallet.dat 2016-09-20 03:09:37 init message: Verifying wallet... 2016-09-20 03:09:37 CDBEnv::Open: LogDir=/home/lin/.bitcoin/database ErrorFile=/home/lin/.bitcoin/db.log 2016-09-20 03:09:37 Bound to [::]:8333 2016-09-20 03:09:37 Bound to 0.0.0.0:8333 2016-09-20 03:09:37 Cache configuration: 2016-09-20 03:09:37 * Using 2.0MiB for block index database 2016-09-20 03:09:37 * Using 8.0MiB for chain state database 2016-09-20 03:09:37 * Using 290.0MiB for in-memory UTXO set 2016-09-20 03:09:37 init message: Loading block index... 2016-09-20 03:09:37 Opening LevelDB in /home/lin/.bitcoin/blocks/index 2016-09-20 03:09:37 Opened LevelDB successfully 2016-09-20 03:09:37 Using obfuscation key for /home/lin/.bitcoin/blocks/index: 0000000000000000 2016-09-20 03:09:37 Opening LevelDB in /home/lin/.bitcoin/chainstate 2016-09-20 03:09:37 Opened LevelDB successfully 2016-09-20 03:09:37 Using obfuscation key for /home/lin/.bitcoin/chainstate: 1eb96e25911d0621 2016-09-20 03:09:40 LoadBlockIndexDB: last block file = 628

  4. caiqinghua commented at 5:35 AM on September 20, 2016: none

    @laanwj debug.log by the version we build

    2016-09-20 05:19:40 Bitcoin version v0.13.0 2016-09-20 05:19:40 InitParameterInteraction: parameter interaction: -whitelistforcerelay=1 -> setting -whitelistrelay=1 2016-09-20 05:19:40 Default data directory /home/lin/.bitcoin 2016-09-20 05:19:40 Using data directory /home/lin/.bitcoin 2016-09-20 05:19:40 Using config file /home/lin/.bitcoin/bitcoin.conf 2016-09-20 05:19:40 Using at most 125 connections (1024 file descriptors available) 2016-09-20 05:19:40 Using 4 threads for script verification 2016-09-20 05:19:40 scheduler thread start 2016-09-20 05:19:40 Allowing HTTP connections from: 127.0.0.0/8 ::1/128 2016-09-20 05:19:40 Binding RPC on address ::1 port 8332 2016-09-20 05:19:40 Binding RPC on address 127.0.0.1 port 8332 2016-09-20 05:19:40 Initialized HTTP server 2016-09-20 05:19:40 HTTP: creating work queue of depth 16 2016-09-20 05:19:40 Starting RPC 2016-09-20 05:19:40 Starting HTTP RPC server 2016-09-20 05:19:40 Config options rpcuser and rpcpassword will soon be deprecated. Locally-run instances may remove rpcuser to use cookie-based auth, or may be replaced with rpcauth. Please see share/rpcuser for rpcauth auth generation. 2016-09-20 05:19:40 Registering HTTP handler for / (exactmatch 1) 2016-09-20 05:19:40 Starting HTTP server 2016-09-20 05:19:40 HTTP: starting 4 worker threads 2016-09-20 05:19:40 Entering http event loop 2016-09-20 05:19:40 Bound to [::]:8333 2016-09-20 05:19:40 Bound to 0.0.0.0:8333 2016-09-20 05:19:40 zmq: Initialize notification interface 2016-09-20 05:19:40 Notifier pubhashblock ready (address = tcp://127.0.0.1:28332) 2016-09-20 05:19:40 zmq: Reusing socket for address tcp://127.0.0.1:28332 2016-09-20 05:19:40 Notifier pubhashtx ready (address = tcp://127.0.0.1:28332)

    and we receive hash tx ~/bitcoin/contrib/zmq$ python zmq_sub.py

    • HASH TX (5401) - 0ff9c69f43b41456e57120507683a45d69b04f7be7fc3d70e48d5ae21bf665a2
    • HASH TX (5402) - 5fe5fa7324a05471b65360c4ae40d9494159d96c4a3375ceef8b8f3ca367abcd
  5. jonasschnelli commented at 7:35 AM on September 20, 2016: contributor

    Can it be that the PPA was built without zmq support? ping @TheBlueMatt?

  6. jonasschnelli commented at 7:38 AM on September 20, 2016: contributor

    Yes. I just checked https://launchpad.net/~bitcoin/+archive/ubuntu/bitcoin/+packages and the PPA/dep was not compiled with ZMQ. Would be nice if it would @TheBlueMatt.

  7. jonasschnelli added the label Build system on Sep 20, 2016
  8. laanwj commented at 7:54 AM on September 20, 2016: member

    Yes Matt creates the PPAs not me, please don't highlight me in every one of your messages.

  9. layershifter commented at 7:37 AM on April 3, 2017: none

    Just a note, this issue can be closed. Latest packages from ppa:bitcoin/bitcoin contain ZMQ support:

    bitcoin@bitcoin:/var/log/bmq# dpkg -l | grep bitcoin
    ii  bitcoind                               0.14.0-xenial1                             amd64        peer-to-peer network based digital currency - daemon
    bitcoin@bitcoin:/var/log/bmq# bitcoind --help | grep hashtx
      -zmqpubhashtx=<address>
    
  10. laanwj commented at 11:23 AM on April 3, 2017: member

    Thanks for letting us know. Closing.

  11. laanwj closed this on Apr 3, 2017

  12. MarcoFalke locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-05-01 15:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me