-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
136 lines (111 loc) · 5.16 KB
/
Copy pathMakefile
File metadata and controls
136 lines (111 loc) · 5.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
.PHONY: help demo network stats chart reputation discovery real-archive kodi \
containers node node-down node-shell lightning-up lightning-down lightning-demo lightning-smoke \
all-stdlib clean install uninstall test test-e2e trust
PYTHON ?= python3
PREFIX ?= $(HOME)/.local
BINDIR ?= $(PREFIX)/bin
help:
@echo "censorship-resistant video PoC — real mechanisms behind the #all-pdx brainstorm"
@echo ""
@echo "Pure stdlib (no setup needed):"
@echo " make demo poc_challenge_auction.py — possession-gated auction, narrated"
@echo " make network poc_network_challenge.py — real sockets, single-shot rounds"
@echo " make stats poc_network_challenge.py stats — repeated-challenge separation"
@echo " make discovery poc_discovery.py — 3 real relays, personalized ranking, sybil test"
@echo " make all-stdlib the four above, in sequence"
@echo ""
@echo "Needs pip install cryptography / matplotlib:"
@echo " make reputation poc_reputation.py — signed attestations + revocation"
@echo " make chart viz_challenge_separation.py — regenerates the README chart"
@echo ""
@echo "Needs docker/podman compose:"
@echo " make containers same challenge test, real containers instead of loopback"
@echo " make node web_ui.py + relay, builds + runs, then auto-trusts the cert"
@echo " make trust (re)add the node's cert to Chrome's NSS trust store; run chrome://restart after"
@echo " make node-down stop both containers (data survives — see docker-compose.node.yml)"
@echo " make node-shell interactive weed shell inside the running node container"
@echo ""
@echo "Needs the lightning/ stack up (see lightning/README.md for one-time channel setup):"
@echo " make lightning-up start bitcoind + 2 LND nodes on regtest"
@echo " make lightning-demo poc_challenge_auction.py --lightning — real HTLC settlement"
@echo " make lightning-smoke lightning_settle.py standalone — one real test payment"
@echo " make lightning-down tear down the lightning stack (drops chain state + wallets)"
@echo ""
@echo "Needs real_archive/ set up (see README.md 'real .ott archive' section):"
@echo " make real-archive poc_real_archive_challenge.py — real video, real 3324 chunks"
@echo ""
@echo "Needs pip install -e .[dev]:"
@echo " make test unit/integration suite (tests/) — fast, no browser, no Docker"
@echo " make test-e2e + tests/e2e/ — real browser against a real relay+host+web UI"
@echo " (needs pytest-playwright + a Chromium binary; see tests/e2e/conftest.py)"
@echo ""
@echo " make clean remove __pycache__, generated chart, tmp reputation stores"
@echo ""
@echo " make install symlink weed.py to $(BINDIR)/weed (override with PREFIX=...)"
@echo " make uninstall remove $(BINDIR)/weed"
demo:
$(PYTHON) poc_challenge_auction.py
network:
$(PYTHON) poc_network_challenge.py
stats:
$(PYTHON) poc_network_challenge.py stats
discovery:
$(PYTHON) poc_discovery.py
all-stdlib: demo network stats discovery
reputation:
$(PYTHON) poc_reputation.py
chart:
$(PYTHON) viz_challenge_separation.py
containers:
docker compose up --build --abort-on-container-exit verifier
docker compose down
trust:
certutil -d sql:$$HOME/.pki/nssdb -D -n "weed" 2>/dev/null || true
openssl s_client -connect weed:8080 </dev/null 2>/dev/null \
| openssl x509 -outform PEM > /tmp/weed-cert.pem
certutil -d sql:$$HOME/.pki/nssdb -A -t "CT,," -n "weed" -i /tmp/weed-cert.pem
@echo "Trusted. Run chrome://restart to pick it up."
node:
GIT_COMMIT=$$(git rev-parse --short HEAD 2>/dev/null) docker compose -f docker-compose.node.yml up --build
$(MAKE) trust
node-down:
docker compose -f docker-compose.node.yml down
node-shell:
docker compose -f docker-compose.node.yml exec node python3 weed.py
lightning-up:
cd lightning && docker compose up -d
@echo "one-time channel setup still needed the first time — see lightning/README.md"
lightning-down:
cd lightning && docker compose down -v
lightning-demo:
$(PYTHON) poc_challenge_auction.py --lightning
lightning-smoke:
$(PYTHON) lightning_settle.py
real-archive:
$(PYTHON) poc_real_archive_challenge.py
test:
$(PYTHON) -m pytest tests --ignore=tests/e2e
test-e2e:
$(PYTHON) -m pytest tests
clean:
find . -name '__pycache__' -type d -exec rm -rf {} +
find . -name '*.pyc' -delete
rm -f /tmp/poc_rep_alice.json /tmp/poc_rep_bob.json
install:
mkdir -p $(BINDIR)
ln -sf $(CURDIR)/weed.py $(BINDIR)/weed
@echo "installed: $(BINDIR)/weed -> $(CURDIR)/weed.py"
@case ":$$PATH:" in \
*":$(BINDIR):"*) ;; \
*) echo "note: $(BINDIR) is not on your PATH" ;; \
esac
uninstall:
rm -f $(BINDIR)/weed
# The Kodi add-on, zipped the way Kodi's "Install from zip file" wants it
# (the add-on folder at the top level of the zip). Version from addon.xml.
KODI_VER := $(shell sed -n 's/.*<addon id="plugin.video.weed"[^>]*version="\([^"]*\)".*/\1/p' kodi/plugin.video.weed/addon.xml)
kodi:
@mkdir -p dist
@rm -f dist/plugin.video.weed-$(KODI_VER).zip
@cd kodi && zip -qr ../dist/plugin.video.weed-$(KODI_VER).zip plugin.video.weed -x '*__pycache__*' -x '*.pyc'
@echo "dist/plugin.video.weed-$(KODI_VER).zip"