What is Nostr?
DanConwayDev
npub15qy…yejr
2024-09-03 06:37:23
in reply to nevent1q…42cv

DanConwayDev on Nostr: We discussed it back in March and here are some numbers for the bitcoin core repo: ...

We discussed it back in March and here are some numbers for the bitcoin core repo:
its definitely worth supporting for git servers designed to work with nostr. Its just widespread support is probably unlikely. Its a little but uncertain the extent to which repositories that use nostr will use free-to-host git servers (ie remain on github) vs using bespoke solutions like song or ghole.

I did some tests with native git options if `git archive`. Its probably then worth having a stateful proxy service that serves from a cache of repositories.

```
git clone --no-checkout --filter=tree:0 https://github.com/bitcoin/bitcoin
cd bitcoin
git restore --staged README.md
git checkout README.md
```
3 calls - 28.44mb + 88kb + 1.57kb


```
git clone --no-checkout --filter=blob:none https://github.com/bitcoin/bitcoin
cd bitcoin
git restore --staged README.md
git checkout README.md
```
2 calls - 55.46mb + 1.57kb

```
git clone --no-checkout
cd bitcoin
git restore --staged README.md
git checkout README.md
```
1 calls - 247.66mb

tbh those numbers are not that big. last time I checked, git implementations in the browser don't support these advanced flags. doing a full clone automatically in the browser is probably a bad idea as it is unfair on those who are bandwidth constrained.
But this could be done statelessly on a server fairly quickly. bandwidth on a VPS is probably quite cheap these days so if traffic volumes were low it shouldn't be too expensive.
Depending on the bandwidth vs storage costs it could be worth storing a clone of repositories and using that instead. That way it would be easier, or cheaper per interaction, to allow browsing commits, metadata, etc.
From a decentralisation point of view, I could build `ngit serve` which could be used instead (even in offline scenarios) instead of the proxy.
Author Public Key
npub15qydau2hjma6ngxkl2cyar74wzyjshvl65za5k5rl69264ar2exs5cyejr