The utxo is too big to hold in the memory. (~58 GB at 860K blocks)
Since we're extracting claim scripts from an already validated database,
a dumb native map saves us memory as well as overhead maintaining a
uxto.
This takes 8.5 minutes to extract claim scripts in 1M blocks, but
still takes ~56 GB of memory.
1. Ditch in-house block repo, and use btcd blocks database.
2. Commands switch from args to flags.
3. Revive chain recording and replaying, which will be part of CI pipeline.
4. Refactor cleanup the CLI skeletons.
5. Support DataDir, and testnet/regtes (not tested yet).
TODOs:
1. Remove hardcoded test/development params, and pass them from flags.
2. Make output more sensible.
3. Add debug level flag.
4. Add MerkleTrie implementation switch.
5. Refactor periodic progess/status reporting for long run-time tasks.
...
Ideally, network related params should be part of config, which is
passed down to the components to avoid references to global instances.
This commit is only halfway through as there are a couple of structs
that are too small to house the params and are still referencing
global variables. We'll rework that later.