----------- 13/09/2022 -
Automating capture verification in bash.
Goal is to make a script and PR it into starling-captures-verifications-2022 repo
Based in
* Demo video: https://app.claap.io/numbers-protocol/starling-capture-verification-tool-usage-c-O35CsUM4Uy-tMNLTN7e4OB_
* Wiki: https://github.com/numbersprotocol/starling-capture/wiki/Development#verification
* GitHub repo: https://github.com/numbersprotocol/starling-capture/tree/release-1.9.2/util/verification
The commands:
* Pantanal collections requires some preparation. For every pic (.jpg) we need to dump `.meta` and `.signature` .json fields.
First we dump .json information into the files:
For signature.json
```jq '(.signature)' 2021-10-30-05-15-03.json > signature.json```
For information.json
```
jq '(.meta)' 2021-10-30-05-15-03.json > information.json
cat information.json | jq -rc > tmp.json
jq 'del(.information[])' tmp.json | jq -rc > information.json
perl -pi -e 'chomp if eof' information.json
rm tmp.json
```
Then if we verify with
```./verify.sh /home/user/anydir/starling-capture-verifications-2022/pantanal/```
We should get

* For other collections
First, generate ```signature.json```
```
cp ff661bf207108b4ec9734622391d312dd848e91b3ee27618d461fe291e94c1b5-signature.json signature.json
```
Then generate `information.json` file, stringify and remove EOF character.
```
jq 'del(.information[])' ff661bf207108b4ec9734622391d312dd848e91b3ee27618d461fe291e94c1b5-meta.json | jq -rc . > information.json && perl -pi -e 'chomp if eof' information.json
```
Verify with
```
./verify.sh starling-capture-verifications-2022/legco-election-2021/
```
