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?

  • What do you mean by "when it has been executed in monero?" ? – jtgrassie Apr 3 at 2:14

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.

  • can we get the information for the current blocks on the chain.. when they were added to transaction pool and when they were added to the chain? – Sri davei Apr 3 at 1:48
  • Again, blocks are not added to the tx pool. You can get the time a block was added to the chain by calling get_last_block_header, which includes a timestamp in the response. – jtgrassie Apr 3 at 1:56
  • Transactions, not blocks, are added to the txpool. A block may include transactions that were added to the txpool at different times. – user36303 Apr 6 at 15:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.