2

Is there a way to get the data for when each block has been added to the pool and to when it has been executed in monero?

jtgrassie
  • 19,601
  • 4
  • 17
  • 54
Sri davei
  • 167
  • 4

1 Answers1

3

Firstly, blocks don't get "added to the pool". A wallet instructs a daemon to broadcast a transaction which gets added to the transaction pool. A miner constructs a block template by bunching transactions that are in the transaction pool, then mining that block template. When a miner successfully mines a block, it is broadcast to the network, and if valid, get's added to each peers blockchain.

If you need an external notification when your node adds a block to your blockchain, you can use the parameter --block-notify when starting your node, which will instruct it to execute a program every time a block is added:

monerod --help
  ...
  --block-notify arg                    Run a program for each new block, '%s' 
                                        will be replaced by the block hash
  ...

You can also call the daemon's RPC method get_last_block_header, which includes a timestamp field in the response. Note that this timestamp however is a miner created timestamp, not the time your node added the block to your local blockchain.

jtgrassie
  • 19,601
  • 4
  • 17
  • 54