@@ -63,6 +63,7 @@ Currently, the following notifications are supported:
63
63
-zmqpubhashblock=address
64
64
-zmqpubrawblock=address
65
65
-zmqpubrawtx=address
66
+ -zmqpubsequence=address
66
67
67
68
The socket type is PUB and the address must be a valid ZeroMQ socket
68
69
address. The same address can be used in more than one notification.
@@ -74,6 +75,7 @@ The option to set the PUB socket's outbound message high water mark
74
75
-zmqpubhashblockhwm=n
75
76
-zmqpubrawblockhwm=n
76
77
-zmqpubrawtxhwm=n
78
+ -zmqpubsequencehwm=address
77
79
78
80
The high water mark value must be an integer greater than or equal to 0.
79
81
@@ -87,7 +89,15 @@ Each PUB notification has a topic and body, where the header
87
89
corresponds to the notification type. For instance, for the
88
90
notification ` -zmqpubhashtx ` the topic is ` hashtx ` (no null
89
91
terminator) and the body is the transaction hash (32
90
- bytes).
92
+ bytes) for all but ` sequence ` topic. For ` sequence ` , the body
93
+ is structured as the following based on the type of message:
94
+
95
+ <32-byte hash>C : Blockhash connected
96
+ <32-byte hash>D : Blockhash disconnected
97
+ <32-byte hash>R<8-byte LE uint> : Transactionhash removed from mempool for non-block inclusion reason
98
+ <32-byte hash>A<8-byte LE uint> : Transactionhash added mempool
99
+
100
+ Where the 8-byte uints correspond to the mempool sequence number.
91
101
92
102
These options can also be provided in bitcoin.conf.
93
103
@@ -124,13 +134,20 @@ No authentication or authorization is done on connecting clients; it
124
134
is assumed that the ZeroMQ port is exposed only to trusted entities,
125
135
using other means such as firewalling.
126
136
127
- Note that when the block chain tip changes, a reorganisation may occur
128
- and just the tip will be notified. It is up to the subscriber to
129
- retrieve the chain from the last known block to the new tip. Also note
130
- that no notification occurs if the tip was in the active chain - this
131
- is the case after calling invalidateblock RPC.
137
+ Note that for ` *block ` topics, when the block chain tip changes,
138
+ a reorganisation may occur and just the tip will be notified.
139
+ It is up to the subscriber to retrieve the chain from the last known
140
+ block to the new tip. Also note that no notification will occur if the tip
141
+ was in the active chain--as would be the case after calling invalidateblock RPC.
142
+ In contrast, the ` sequence ` topic publishes all block connections and
143
+ disconnections.
132
144
133
145
There are several possibilities that ZMQ notification can get lost
134
146
during transmission depending on the communication type you are
135
147
using. Bitcoind appends an up-counting sequence number to each
136
148
notification which allows listeners to detect lost notifications.
149
+
150
+ The ` sequence ` topic refers specifically to the mempool sequence
151
+ number, which is also published along with all mempool events. This
152
+ is a different sequence value than in ZMQ itself in order to allow a total
153
+ ordering of mempool events to be constructed.
0 commit comments