zips
zips copied to clipboard
Extract metadata JSON.
This branch introduces a (hideous) shell script which generates a single JSON document with all of the ZIP header metadata.
It is a finicky unix pipeline parser and it introduces a strict requirement that metadata fields MUST be prefixed with exactly 2 spaces. There was only one ZIP that violated this: zip-1006.rst
, so this PR updates that ZIP to match the format.
This metadata may be useful if served from https://zips.z.cash for building various infrastructure atop ZIPs.
jq
examples
I am using the JSON output to perform various queries with jq
. Some recipes follow:
Show all present metadata fields
$ jq 'reduce .[] as $acc ({}; $acc + .) | keys' zip-metadata.json
[
"Category",
"Created",
"Credits",
"Discussions-To",
"License",
"Obsoletes",
"Original-Authors",
"Owners",
"Pull-Request",
"Status",
"Title",
"ZIP"
]
Finding all ZIPs without owners (they're all Reserved
):
$ jq '.[] | select(.Owners? == null)' zip-metadata.json
{
"ZIP": "1",
"Title": "Network Upgrade Policy and Scheduling",
"Status": "Reserved",
"Category": "Consensus Process",
"Discussions-To": "<https://github.com/zcash/zips/issues/343>"
}
{
"ZIP": "2",
"Title": "Design Considerations for Network Upgrades",
"Status": "Reserved",
"Category": "Informational",
"Discussions-To": "<https://github.com/zcash/zips/issues/362>"
}
{
"ZIP": "312",
"Title": "Shielded Multisignatures using FROST",
"Status": "Reserved",
"Category": "Standards / RPC / Wallet",
"Discussions-To": "<https://github.com/zcash/zips/issues/382>"
}
{
"ZIP": "402",
"Title": "New Wallet Database Format",
"Status": "Reserved",
"Category": "Wallet",
"Discussions-To": "<https://github.com/zcash/zips/issues/365>"
}
{
"ZIP": "403",
"Title": "Verification Behaviour of zcashd",
"Status": "Reserved",
"Category": "Informational",
"Discussions-To": "<https://github.com/zcash/zips/issues/404>"
}
Listing all owners
$ jq --raw-output '[ .[] | .Owners? | select( . != null ) ] | flatten | .[]' zip-metadata.json | sed 's/ <.*$//; s/ (.*$//' | sort -u
...
Aditya Bharadwaj
Alfredo Garcia
Andrew Miller
aristarchus
Avichal Garg
Colleen Swanson
Daira Emma Hopwood
Daira Hopwood
Deirdre Connolly
Dimitris Apostolou
Eran Tromer
First Owner
Gordon Mohr
Greg Pfeil
Henry de Valence
Jack Grigg
James Todaro
J. Ayo Akinyele
Joseph Todaro
Josh Cincinnati
@kek
Kris Nuttycombe
@lex-node
Matt Luongo
@mistfpga
mistfpga
Nathan Wilcox
Pablo Kogan
Sean Bowe
Steven Smith
Taylor Hornby
teor
Vivek Arte
Ying Tong Lai
Zooko Wilcox
Finding ZIPs with a given author
$ jq '.[] | select(.Owners? | tostring | ascii_downcase | contains("nathan wilcox")) | { ZIP, Title }' zip-metadata.json
{
"ZIP": "316",
"Title": "Unified Addresses and Unified Viewing Keys"
}
{
"ZIP": "319",
"Title": "Options for Shielded Pool Retirement"
}