There's no way yet to show on a repo that it's gitmarked. This adds one, in two steps.
1. git mark badge
A new command that prints badge markdown for the current repo. It reads the origin remote, the current branch and blocktrails.json, and builds a shields.io dynamic JSON badge that counts states in the pushed trail file:
[](<link>)
- The badge renders as
gitmarks | 1 · txbt4, and the count updates whenever blocktrails.json is pushed.
- It links to the latest mark's transaction on the chain's explorer (derived from
CHAINS[chain].explorer). It could link to a trail page later.
- Tested against melvincarvalho/delivery-day, whose trail is on
txbt4. The badge renders gitmarks: 1 · txbt4.
- It's only as current as the pushed file: it shows what the repo claims, not what the chain confirms. Step 2 fixes that.
- Non-GitHub remotes: print the markdown with a placeholder URL for the raw trail file, and say so.
2. A verified badge (later)
A small endpoint that does what git mark verify does: re-derive each address from pubkeyBase and states, and check the outputs on the chain's explorer. It returns shields.io endpoint JSON:
verified 3/3 · txbt4, green
2/3 verified, red, when a mark is missing or doesn't match
unconfirmed, amber, while the newest mark is still in the mempool
git mark badge --verified would print the markdown pointing at it. It needs hosting and some caching, so it can be a separate piece; step 1 doesn't depend on it.
Also
- A Badge section in the README showing the markdown, and a badge on this repo if it gets a trail of its own.
- Tests: the badge URL built from a fixture remote and trail, and the non-GitHub fallback.
There's no way yet to show on a repo that it's gitmarked. This adds one, in two steps.
1.
git mark badgeA new command that prints badge markdown for the current repo. It reads the
originremote, the current branch andblocktrails.json, and builds a shields.io dynamic JSON badge that countsstatesin the pushed trail file:gitmarks | 1 · txbt4, and the count updates wheneverblocktrails.jsonis pushed.CHAINS[chain].explorer). It could link to a trail page later.txbt4. The badge rendersgitmarks: 1 · txbt4.2. A verified badge (later)
A small endpoint that does what
git mark verifydoes: re-derive each address frompubkeyBaseandstates, and check the outputs on the chain's explorer. It returns shields.io endpoint JSON:verified 3/3 · txbt4, green2/3 verified, red, when a mark is missing or doesn't matchunconfirmed, amber, while the newest mark is still in the mempoolgit mark badge --verifiedwould print the markdown pointing at it. It needs hosting and some caching, so it can be a separate piece; step 1 doesn't depend on it.Also