Bitcoin-Core

LND 無法連接到 ZMQ

  • May 13, 2019

我想(再次)執行我的 LND 實例,但在連接到比特幣的 ZMQ 時遇到了一些麻煩。

這是我所做的:

$ bitcoin-cli getblockcount
575704

$ lnd --bitcoin.mainnet --bitcoin.active --debuglevel=debug --bitcoin.node=bitcoind --bitcoind.rpcuser=tepo --bitcoind.rpcpass=**** --bitcoind.zmqpubrawblock=tcp://127.0.0.1:28332 --bitcoind.zmqpubrawtx=8332

解鎖 lnd 錢包後,我得到:

2019-05-12 18:33:03.842 [INF] LTND: Version: 0.5.2-99-beta commit=, build=production, logging=default
2019-05-12 18:33:03.842 [INF] LTND: Active chain: Bitcoin (network=mainnet)
2019-05-12 18:33:03.842 [INF] CHDB: Checking for schema update: latest_version=8, db_version=8
2019-05-12 18:33:03.853 [INF] RPCS: password gRPC proxy started at [::]:8080
2019-05-12 18:33:03.853 [INF] RPCS: password RPC server listening on 127.0.0.1:10009
2019-05-12 18:33:03.853 [INF] LTND: Waiting for wallet encryption password. Use `lncli create` to create a wallet, `lncli unlock` to unlock an existing wallet, or `lncli changepassword` to change the password of an existing wallet and unlock it.
2019-05-12 18:33:10.105 [INF] LNWL: Opened wallet
2019-05-12 18:33:10.204 [INF] LTND: Primary chain is set to: bitcoin
unable to create chain control: unable to connect to bitcoind: unable to subscribe for zmq tx events: dial tcp 0.0.32.140:0: connect: invalid argument
2019-05-12 18:33:10.207 [INF] LTND: Shutdown complete
unable to connect to bitcoind: unable to subscribe for zmq tx events: dial tcp 0.0.32.140:0: connect: invalid argument

比特幣.conf:

server=1
txindex=1
daemon=1
rpcconnect=127.0.0.1
rpcport=8332
rpcuser=tepo
rpcpassword=****
dbcache=1024
rpcallowip=0.0.0.0/0
rpcthreads=4
rpctimeout=300
zmqpubrawblock=tcp://127.0.0.1:28332
zmqpubrawtx=tcp://127.0.0.1:28333

lnd.conf:

Application Options]
debuglevel=info
#debughtlc=true
#listen=0.0.0.0:9735
externalip=188.167.56.214
#rpclisten=0.0.0.0:8332
alias=axon
color=#ff9200
maxpendingchannels=10
restlisten=0.0.0.0:8080

[Bitcoin]
bitcoin.mainnet=1
bitcoin.active=1
bitcoin.node=bitcoind

[Bitcoind]
bitcoind.rpchost=127.0.0.1:8332
bitcoind.rpcuser=tepo
bitcoind.rpcpass=****
bitcoind.zmqpubrawblock=127.0.0.1:28332
bitcoind.zmqpubrawtx=127.0.0.1:28333
#bitcoind.zmqpath=tcp://127.0.0.1:18501
$ ldd /usr/bin/bitcoind | grep -i mq
   libzmq.so.5 => /usr/lib/libzmq.so.5 (0x00007f9ce53c1000)

如果我錯過了要給你看的東西,請告訴我。

幫助表示讚賞

我相信您的配置沒問題,但是當您lnd使用 flags 之類的命令啟動時,您會將一個參數覆蓋為損壞的值。

具體來說,我說的是 flag --bitcoind.zmqpubrawtx=8332,應該是--bitcoind.zmqpubrawtx=127.0.0.1:28333

引用自:https://bitcoin.stackexchange.com/questions/87677