Cardano Ogmios - Accessing Mempool Transactions from Peers

So, I was in the process of building my own library of monitoring the chain so that it could be used on other real-time applications to show transactions, minting, buy/sell, and other stuff.

Here is my environment:-

  • Network: Mainnet
  • Cardano Node: 8.1.2
  • Ogmios: v6.0.0 (62d21dd280a474b93ea9481c9d2a242ebe22ba63)

I was trying to use Ogmios (6.x) and have been experimenting with mempool monitoring, but I noticed the SizeAndCapacity is always returning size as zero. As if there aren’t any transactions on the mempool. But I can see on Cardanoscan that there is. My guess is Ogmios is only showing the local mempool of my node and not all the mempool from other peers such as Blockfrost and so on.

If that is the case, then what’s the right way to query mempool state from my node and all other peers?

If you add peers to your node, these peers will propagate their txs to you and you should see them in your mempool.

However, keep in mind there is nothing like a global mempool in Cardano. You might not see all the transactions that are in different nodes’ mempools.

I see, I think I got the concept now. But is there a place or way from where I can get a peer address so that I can test if things are working?

Also, I have seen a lot of dApps showing TXs from mempool such as CardanoScan or Dexhunter. I understand that it’s not possible to view all the transactions in different nodes’ mempool (as I have to add them all as my peers), but is there a silver lining here to get a reasonable amount of TXs?