target for the next block is available in
getblocktemplate but I can not figure out if there is a way to get the
target without also getting all of the pending transactions, which can take a very long time and generate lots of data.
You could also use
getbestblock to get the top block and then use
getblockheader to get the previous 2016 blocks and then do the math based on the times, but again this is very slow and data heavy.
Is there a fast way to determine the
target for the next block from bitcoin-core over RPC?