It's is possible to track by API, if block was forked/orphaned? Will be glad to see some example.
1 Answer
Blocks do not fork, the chain forks. If a block is orphaned it is discarded when a reorg is done, so you can know it only if your node received that block and you was online during the reorg, but it will not always be the case. And in any case there's no specific API to know it (even though the new web3 is working to make easy to understand if a transaction was removed from the main chain due a reorg).
With specific API you can get the uncles, essentially certified orphaned blocks that sometimes are included in the chain by miners.