LocalTxMonitor class helps to query mempool of a local Cardano node using local tx monitor node-to-client mini protocol. This class is not thread-safe.
Get LocalTxMonitorClient
from a LocalClientProvider instance.
LocalClientProvider localClientProvider = new LocalClientProvider(nodeSocketFile, protocolMagic);
localClientProvider.start();
LocalTxMonitorClient localTxMonitorClient = localQueryProvider.getTxMonitorClient();
Mono<Long> mono = localTxMonitorClient.acquire();
localTxMonitorClient.acquire().block(Duration.ofSeconds(10));
Mono<MempoolStatus> mono = localTxMonitorClient.getMempoolSizeAndCapacity();
Mono<MempoolStatus> mono = localTxMonitorClient.acquireAndGetMempoolSizeAndCapacity();
localTxMonitorClient.acquire().block();
Mono<List<byte[]>> mono = localTxMonitorClient.getCurrentMempoolTransactionsAsMono();
localTxMonitorClient.acquire().block();
Flux<byte[]> flux = localTxMonitorClient.getCurrentMempoolTransactions();