[chronik] store a scripthash -> script index
Summary:
The index is wiped/reindexed depending on the -chronikscripthashindex (init param) value, the reindexing process takes about 12 minutes with the current blockchain.
After the initial is sync, new scripts are added to the index via the ScriptGroup index.
This will be needed for the ElectrumX API. Ref T3598
This diff does not deal with mempool data. This needs to be done in a separate diff.
Test Plan:
Test the wiping and reindexing of the new index by alternating bitcoind -chronikscripthashindex=1 and bitcoind -chronikscripthashindex=1
Tests are added in a child revision to keep the review manageable. On D16937, run ninja all check-all
Reviewers: #bitcoin_abc, tobias_ruck
Reviewed By: #bitcoin_abc, tobias_ruck
Subscribers: tobias_ruck
Maniphest Tasks: T3598
Differential Revision: https://reviews.bitcoinabc.org/D16827