-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathllms-full.txt
More file actions
2886 lines (1891 loc) · 137 KB
/
Copy pathllms-full.txt
File metadata and controls
2886 lines (1891 loc) · 137 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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# Blockchains building blocks: full text
Generated 2026-10-05T11:41:36Z from 32 repositories. Sections: Build with Blocks guide, blocks.json schema, then AGENTS.md of every repo.
=== Build with Blocks (Blockchains/.github/docs/BUILD-WITH-BLOCKS.md) ===
# Build with Blocks
How an AI agent (or a human) assembles a working project from the repositories under [github.com/Blockchains](https://github.com/Blockchains). Every live repo is documented as a **block**: what it exports, how to install it, its inputs and outputs, and which other blocks it fits with.
- Org doc map for LLMs: **https://blockchains.github.io/llms.txt** (full text: https://blockchains.github.io/llms-full.txt)
- Catalogue of every block (machine-readable): **https://blockchains.github.io/blocks.json** · human view: https://blockchains.github.io/blocks/
- Manifest format: [BLOCKS-SCHEMA.md](BLOCKS-SCHEMA.md) ([JSON Schema](blocks.schema.json))
- In each repo: `README.md` → section **Use as a building block**, `AGENTS.md` (setup, commands, structure, rules), `llms.txt`, `blocks.json`
## 1. The blocks at a glance
| Layer | Block | Use it for | Get it |
|---|---|---|---|
| Data | [blockchainlab-api](https://github.com/Blockchains/blockchainlab-api) | 20 nightly JSON datasets (chains, RPC health, TVL, stablecoins, yields, L2s, hacks, OFAC, EIPs…) | `https://blockchains.github.io/blockchainlab-api/v1/<dataset>.json` |
| Data | [blockchainlab-sdk](https://github.com/Blockchains/blockchainlab-sdk) | Typed TS/Python client for the API | `npm i github:Blockchains/blockchainlab-sdk` |
| Data | [blockchainlab-feeds](https://github.com/Blockchains/blockchainlab-feeds), [whitepapers](https://github.com/Blockchains/whitepapers) | Hackathon/event/X-intel feeds; historic whitepaper index | raw JSON URLs |
| Agents | [blockchainlab-mcp](https://github.com/Blockchains/blockchainlab-mcp) | 43 read-only MCP tools for any agent (datasets + live on-chain decoding) | `npx -y github:Blockchains/blockchainlab-mcp` |
| Agents | [grokhack-forge](https://github.com/Blockchains/grokhack-forge) | Compose a Grok app (chat or digest) with CI and Pages | `python3 forge/compose.py --idea … --name …` |
| Agents | [grokhack-index](https://github.com/Blockchains/grokhack-index) | Grok/xAI integration parts from 99 forks | `data/parts.json` |
| Contracts | [forge-usd-priced-membership-nft](https://github.com/Blockchains/forge-usd-priced-membership-nft) | ERC-721 pass, USD price via Chainlink, royalties, roles | `forge install Blockchains/forge-usd-priced-membership-nft` |
| Contracts | [forge-dao-governance-token](https://github.com/Blockchains/forge-dao-governance-token) | ERC20Votes + permit token, Governor + Timelock | `forge install …` |
| Contracts | [forge-example-usd-savings-vault](https://github.com/Blockchains/forge-example-usd-savings-vault), [forge-example-gasless-membership](https://github.com/Blockchains/forge-example-gasless-membership) | ERC-4626 USD vault; ERC-4337 paymaster club (with viem front ends) | `forge install …` |
| Contracts | [blockchainlab-labs](https://github.com/Blockchains/blockchainlab-labs) | 45 small tested Solidity patterns (AMM, flash loan, proxy, ERC-7201…), Noir, Cairo | `forge install Blockchains/blockchainlab-labs` |
| Contracts | [blockchainlab-starters](https://github.com/Blockchains/blockchainlab-starters) | 8 CI-tested starters (OZ, Chainlink, Uniswap v4 hook, 4337, Hedera, wagmi, circom, Noir) | template repo |
| Composers | [blockchainlab-compose](https://github.com/Blockchains/blockchainlab-compose) + [blockchainlab-index](https://github.com/Blockchains/blockchainlab-index) | Idea → tested Foundry repo from indexed fork components | `python3 -m blcompose.compose "…" --name …` |
| UI / explain | [blockchainlab-tools](https://github.com/Blockchains/blockchainlab-tools), [blockchainlab-lens](https://github.com/Blockchains/blockchainlab-lens) | 26 browser tools with deep links; explorer explainer + `BLLens` detector | `https://blockchains.github.io/blockchainlab-tools/<tool>/?…` |
| Hub | [blockchains.github.io](https://github.com/Blockchains/blockchains.github.io) | 75 services, `services.json`, health data, this catalogue | https://blockchains.github.io |
| Templates | [hackathon-entry-template](https://github.com/Blockchains/hackathon-entry-template), [grokhack-submissions](https://github.com/Blockchains/grokhack-submissions) | Entry repos with CI and secret scanning | GitHub template |
| Learning | [blockchain-dev-roadmap](https://github.com/Blockchains/blockchain-dev-roadmap), [blockchain-interview-questions](https://github.com/Blockchains/blockchain-interview-questions) | Curated paths linking labs and tools | README |
| Fork corpus | [awesome-blockchainlab](https://github.com/Blockchains/awesome-blockchainlab), [awesome-grokhack](https://github.com/Blockchains/awesome-grokhack), [fork-sync](https://github.com/Blockchains/fork-sync) | Curated, synced forks of upstream projects (see section 4) | `forge.json`, `grok-forge.json`, `forks.json` |
## 2. How to assemble a project (procedure for an AI agent)
1. **Discover.** Fetch `https://blockchains.github.io/blocks.json`. Filter `blocks[]` by `kind` (`library`, `contracts`, `mcp-server`, `http-api`, …) and read each candidate's `summary`, `inputs`, `outputs` and `compatible_with`.
2. **Check fit.** Prefer pairs that list each other in `compatible_with`. Check `license` (GPL blocks such as `forge-example-gasless-membership` make the combined work GPL) and `stability` (`reference` = copy and adapt, `stable` = depend on it).
3. **Read the block's `AGENTS.md`** (raw URL in its `llms.txt`) for setup, test commands and do/don't rules.
4. **Install from the `entrypoints`** exactly as written; pin a tag or commit (`github:Blockchains/<repo>#<sha>`, `forge install Blockchains/<repo>@<tag>`).
5. **Prove it.** Run the block's `tests.command`, then your own test of the combination. Most tests use live networks: retry once before assuming a code bug.
6. **Never** commit keys; run `gitleaks` before pushing. Show "needs key" notices instead of faking AI output.
## 3. Recipes (each one was run end to end on 2026-10-04)
### Recipe 1: token-gated dApp (forge-usd-priced-membership-nft + blockchainlab-sdk + blockchainlab-api)
A members-only contract gated on the composed USD-priced membership NFT, plus the off-chain gate a front end uses: OFAC screening and a healthy RPC from the SDK.
**Contracts** (Foundry, solc 0.8.30):
```bash
forge init gated && cd gated && rm -f src/Counter.sol test/Counter.t.sol script/Counter.s.sol
forge install Blockchains/forge-usd-priced-membership-nft Blockchains/openzeppelin-contracts@v5.7.0
cat > remappings.txt <<'R'
@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/
@chainlink/contracts/src/=lib/forge-usd-priced-membership-nft/lib/chainlink-evm/contracts/src/
forge-std/=lib/forge-std/src/
membership/=lib/forge-usd-priced-membership-nft/src/
R
# foundry.toml [profile.default]: solc = "0.8.30", evm_version = "cancun"
```
`lib/` inside each forge-* repo holds only the OpenZeppelin files that project uses, so map `@openzeppelin/contracts/` to the full fork at the same release (v5.7.0, commit `cab1993`). That way several forge-* blocks can share one OpenZeppelin.
`src/MembersOnly.sol`:
```solidity
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;
import {IERC721} from "@openzeppelin/contracts/token/ERC721/IERC721.sol";
/// Token gate: any function marked onlyMembers needs at least one pass from the membership NFT.
contract MembersOnly {
IERC721 public immutable pass;
mapping(address => string) public notes;
error NotMember(address who);
constructor(IERC721 pass_) { pass = pass_; }
modifier onlyMembers() { if (pass.balanceOf(msg.sender) == 0) revert NotMember(msg.sender); _; }
function post(string calldata note) external onlyMembers { notes[msg.sender] = note; }
}
```
`test/MembersOnly.t.sol`:
```solidity
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;
import "forge-std/Test.sol";
import {UsdPricedMembership} from "membership/UsdPricedMembership.sol";
import {FixedPriceAggregator} from "lib/forge-usd-priced-membership-nft/test/utils/FixedPriceAggregator.sol";
import {IERC721} from "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import {MembersOnly} from "../src/MembersOnly.sol";
contract MembersOnlyTest is Test {
UsdPricedMembership nft; MembersOnly gate; address alice = address(0xA11CE);
function setUp() public {
FixedPriceAggregator feed = new FixedPriceAggregator(2500e8); // $2,500 / ETH
nft = new UsdPricedMembership(address(this), 100, "ipfs://base/", address(feed), 25e18, 1 hours, address(this), 500); // $25 mint
gate = new MembersOnly(IERC721(address(nft)));
vm.deal(alice, 1 ether);
}
function test_gate() public {
vm.prank(alice); vm.expectRevert(abi.encodeWithSelector(MembersOnly.NotMember.selector, alice)); gate.post("hi");
uint256 price = nft.mintPriceWei(); // $25 at $2,500/ETH = 0.01 ETH
vm.prank(alice); nft.mint{value: price}();
vm.prank(alice); gate.post("gm");
assertEq(gate.notes(alice), "gm");
}
}
```
`forge test` → `[PASS] test_gate()`. Deploy with the repo's `script/Deploy.s.sol` pattern (live Chainlink ETH/USD feed on Sepolia/mainnet), then deploy `MembersOnly(pass)`. The same setup also compiles `forge-dao-governance-token` if you install it next to it, so you can add a governor.
**Off-chain gate** (Node ≥ 18 or browser; `npm i github:Blockchains/blockchainlab-sdk`):
```js
import { BlockchainLab } from "blockchainlab-sdk";
const bl = new BlockchainLab();
// Is `wallet` allowed in? Screen against OFAC, then check it holds a pass on the membership NFT.
export async function canEnter(wallet, nft, chain = "ethereum") {
if (await bl.isSanctioned(wallet)) return { ok: false, reason: "sanctioned address" };
const [rpc] = await bl.healthyRpcs(chain); // fastest healthy public RPC from the nightly probe
const data = "0x70a08231" + wallet.slice(2).toLowerCase().padStart(64, "0"); // balanceOf(address)
const r = await fetch(rpc.url, { method: "POST", headers: { "content-type": "application/json" },
body: JSON.stringify({ jsonrpc: "2.0", id: 1, method: "eth_call", params: [{ to: nft, data }, "latest"] }) }).then(r => r.json());
const balance = BigInt(r.result);
return { ok: balance > 0n, balance, rpc: rpc.url };
}
// Live check against any ERC-721, e.g. canEnter("0x000000000000000000000000000000000000dEaD", "0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D")
// returned { ok: true, balance: 3n, rpc: "https://eth.drpc.org" } on 2026-10-04.
```
Extend: show the mint price in USD (`mintPriceWei()`), link each tx to `https://blockchains.github.io/blockchainlab-tools/tx/?chain=<chain>&hash=<hash>`, or start the UI from `blockchainlab-starters/starters/wagmi-rainbowkit-dapp`.
### Recipe 2: Grok agent with blockchain tools (grokhack-forge + blockchainlab-mcp + blockchainlab-sdk)
**a. Compose the app** (Python 3.10+, Node 20):
```bash
git clone https://github.com/Blockchains/grokhack-forge && cd grokhack-forge
python3 forge/compose.py --idea "A chat assistant that answers DeFi questions with tools" --name defi-grok-chat --out /tmp/defi-grok-chat
cd /tmp/defi-grok-chat && npm ci && npm i github:Blockchains/blockchainlab-sdk
```
**b. Give Grok blockchain tools.** The `chat` archetype streams through `@ai-sdk/xai` and calls the tools in `src/tools.ts` → `localTools`. Add:
```ts
import { BlockchainLab } from 'blockchainlab-sdk'
const bl = new BlockchainLab()
// inside `export const localTools = { … }`
defi_protocols: tool({
description: 'Top DeFi protocols by TVL (DefiLlama snapshot via the Blockchain Lab Open Data API). Filter by category and chain.',
inputSchema: z.object({ category: z.string().optional().describe('e.g. Lending, Dexs'), chain: z.string().optional().describe('e.g. Arbitrum'), limit: z.number().int().min(1).max(20).default(5) }),
execute: async ({ category, chain, limit }) => ({ results: (await bl.rows('protocols')).filter(p => (!category || p.category === category) && (!chain || (p.chains ?? []).includes(chain))).slice(0, limit) }),
}),
stablecoin: tool({
description: 'Stablecoin price vs peg and circulating supply by symbol.',
inputSchema: z.object({ symbol: z.string().describe('e.g. USDC') }),
execute: async ({ symbol }) => ({ results: [await bl.stablecoin(symbol)].filter(Boolean) }),
}),
```
`npm run build` (tsc + vite) passes, and a node test calling both tools against the live API passes (`npm test`). The visitor's xAI key goes only to api.x.ai. Push with `--create --wait` (or the compose workflow) to get a repo with CI and Pages.
The SDK is used in app code because it is typed. `blockchainlab-mcp`'s JS SDK works too, but it ships no `.d.ts` yet, so `tsc` needs a `declare module 'blockchainlab-mcp'` shim.
**c. Give the developer agent the same powers via MCP.** When you or an AI coding agent (Grok, Cursor, Claude Code) works on the app, add the MCP server so it can query chains, decode transactions and check standards while coding:
```json
{ "mcpServers": { "blockchainlab": { "command": "npx", "args": ["-y", "github:Blockchains/blockchainlab-mcp"] } } }
```
`tools/list` returns 43 tools (e.g. `top_defi_protocols`, `decode_transaction`, `lookup_standard`, `sanctions_check`). For a server-side Grok agent, spawn the same server over stdio from your backend and pass its tools to the model. It never signs or sends transactions.
### Recipe 3: risk dashboard (blockchainlab-api + blockchainlab-lens + blockchainlab-tools)
A single static page: stablecoins off peg and large recent hacks from the API, plus a box that turns any tx hash, address or ENS name into an explanation link, using the same detector the Lens extension uses.
```html
<!doctype html>
<meta charset="utf-8">
<title>Risk dashboard (Blockchain Lab blocks)</title>
<script src="https://blockchains.github.io/blockchainlab-lens/extension/detect.js"></script>
<h1>Stablecoin pegs and recent hacks</h1>
<p><input id="q" placeholder="paste a tx hash, address or ENS name" size="70"> <a id="explain" target="_blank">explain ↗</a></p>
<h2>Stablecoins off peg (> 0.5%)</h2><table id="peg"></table>
<h2>Hacks over $10m since 2026-01-01</h2><table id="hacks"></table>
<script type="module">
const API = "https://blockchains.github.io/blockchainlab-api/v1";
const get = (d) => fetch(`${API}/${d}.json`).then(r => r.json());
const [stables, hacks] = await Promise.all([get("stablecoins"), get("security-incidents")]);
document.querySelector("#peg").innerHTML = stables.data
.filter(s => s.price != null && s.peg_type === "peggedUSD" && Math.abs(s.price - 1) > 0.005 && s.circulating > 1e7)
.map(s => `<tr><td>${s.symbol}</td><td>${s.price.toFixed(4)}</td><td>$${(s.circulating / 1e6).toFixed(0)}m</td></tr>`).join("");
document.querySelector("#hacks").innerHTML = hacks.data
.filter(h => (h.date ?? "") >= "2026-01-01" && (h.amount_usd ?? 0) >= 1e7)
.map(h => `<tr><td>${h.date}</td><td>${h.name}</td><td>${h.technique ?? ""}</td><td>$${(h.amount_usd / 1e6).toFixed(1)}m</td></tr>`).join("");
const q = document.querySelector("#q"), a = document.querySelector("#explain");
q.oninput = () => { a.href = BLLens.fromText(q.value) || ""; }; // same deep links the Lens extension opens
</script>
```
Serve it with any static server (`python3 -m http.server`). Headless Chromium on 2026-10-04: 20 peg rows, 24 hack rows, no JS errors; `vitalik.eth` → `https://blockchains.github.io/blockchainlab-tools/address/?q=vitalik.eth&chain=ethereum&utm_source=blockchainlab-lens`. Data is CORS-enabled and needs no key. For production, switch the `fetch` calls to the typed SDK, add more datasets (`l2-metrics`, `yields`, `rpc-health`), and install [Lens](https://github.com/Blockchains/blockchainlab-lens) so explorer pages get the same explanations.
## 4. Reusing the fork corpus
388 live forks of upstream open-source projects sit under Blockchains (archived forks are listed in `ARCHIVED-*.md` reports and can be unarchived). They are **unmodified mirrors**, kept current by [fork-sync](https://github.com/Blockchains/fork-sync) (curated blockchain set) and the grokhack-index nightly (Grok set). They have no `blocks.json` of their own. Use the indexes instead:
| Need | Where | How |
|---|---|---|
| Find a contract/module by capability or symbol | [blockchainlab-index](https://github.com/Blockchains/blockchainlab-index) | `index.sqlite` FTS5, `components/<slug>.json`, or `indexer/compose.py plan "<idea>"` |
| How to reuse a fork of a given category | `catalog.json` → `repos[].reuse` and [`taxonomy/reuse.json`](https://github.com/Blockchains/blockchainlab-index/blob/main/taxonomy/reuse.json) | pinned install line per fork + per-category notes |
| Curated list with licences and starters | [awesome-blockchainlab `forge.json`](https://github.com/Blockchains/awesome-blockchainlab/blob/main/forge.json) | category, licence notes, docs, starters, index links |
| Grok/xAI integration code | [grokhack-index `data/parts.json`](https://blockchains.github.io/grokhack-index/data/parts.json) | SDK exports, packages, snippets with commit-pinned URLs |
| Generate a project automatically | [blockchainlab-compose](https://github.com/Blockchains/blockchainlab-compose) (Solidity), [grokhack-forge](https://github.com/Blockchains/grokhack-forge) (Grok apps) | idea → repo with CI |
Rules for fork code: pin the indexed `commit`; keep SPDX headers and add a NOTICE; never copy source-available files (e.g. BUSL-1.1); GPL/LGPL components make the combined work copyleft; prefer the upstream package registry when the fork is only a mirror.
## 5. Keeping this true
- Each repo's `blocks.json` is validated daily by [validate-blocks](../.github/workflows/validate-blocks.yml); the hub catalogue is rebuilt weekly by `scripts/blocks.py` in blockchains.github.io.
- When you add or change an export, update that repo's README section, `AGENTS.md`, `llms.txt` and `blocks.json` in the same commit.
=== blocks.json schema (Blockchains/.github/docs/BLOCKS-SCHEMA.md) ===
# blocks.json: the Blockchains building-block manifest
Every live, non-fork repository under [github.com/Blockchains](https://github.com/Blockchains) ships a `blocks.json` at its root that tells AI agents and humans **what the repo exports and how to plug it into something else**. One schema is used everywhere:
- JSON Schema (draft 2020-12): [`docs/blocks.schema.json`](blocks.schema.json), raw URL `https://raw.githubusercontent.com/Blockchains/.github/main/docs/blocks.schema.json`
- Validator: [`scripts/validate_blocks.py`](../scripts/validate_blocks.py), run by [`validate-blocks`](../.github/workflows/validate-blocks.yml) on every push here and daily across all repos
- Aggregated catalogue of every manifest: **https://blockchains.github.io/blocks.json** (human view: https://blockchains.github.io/blocks/)
- How to combine blocks: [BUILD-WITH-BLOCKS.md](BUILD-WITH-BLOCKS.md)
Each repo also has `AGENTS.md` (instructions for AI coding agents) and `llms.txt` ([llmstxt.org](https://llmstxt.org/) format). `blocks.json` is the machine-readable part of the same information.
**Exception:** in `Blockchains/blockchains.github.io` the root `/blocks.json` is the org catalogue and `/llms.txt` is the org doc map, so that repo's own manifest is `blocks/hub.json`.
## Fields
| Field | Required | Type | Meaning |
|---|---|---|---|
| `$schema` | no | URI | Schema URL (always the raw URL above) |
| `schema_version` | yes | `"1.0"` | Manifest format version |
| `name` | yes | string | Repository name; must match the repo |
| `repo` | yes | `Blockchains/<name>` | Full repository id; must match the repo |
| `summary` | yes | string (10–400) | What the block is, in one or two sentences |
| `kind` | yes | array of enum | `library`, `contracts`, `http-api`, `dataset`, `mcp-server`, `cli`, `github-action`, `web-app`, `browser-extension`, `template`, `index`, `curated-list`, `docs`, `automation` |
| `stability` | yes | enum | `stable` (interfaces kept compatible), `beta` (may change, used in production), `experimental`, `reference` (generated/example code: copy and adapt) |
| `version` | no | string | Current version or API version |
| `license` | yes | SPDX expression | `NOASSERTION` when the repo has no licence file |
| `homepage` | no | URI | Live site or docs |
| `entrypoints` | yes | array | How to consume the block (see below) |
| `inputs` / `outputs` | yes | array of ports | `{name, type, description?}` |
| `deps` | yes | array of strings | Toolchains/runtimes, e.g. `node>=18`, `foundry (solc 0.8.30)` |
| `compatible_with` | yes | array | `{repo: "Blockchains/<other>", how}`: tested or documented combinations |
| `tests` | yes | object | `{command, ci?, network?}`: how to prove it works; `network: true` means live networks (no mocks) |
| `env` | no | array | `{name, required, purpose?}`: environment variables / secrets (names only, never values) |
| `docs` | yes | object | `{readme, agents, llms, extra?}`: paths of the docs in the repo |
| `tags` | no | array of strings | Free-form search tags |
### Entrypoints
| `type` | `ref` is | Typical `install` / `usage` |
|---|---|---|
| `npm` | source path of the package entry | `npm i github:Blockchains/<repo>` |
| `pypi` | source path of the package | `pip install "git+https://github.com/Blockchains/<repo>#subdirectory=python"` |
| `git` | template or clone URL | "Use this template" |
| `http` | URL (may contain `{placeholders}`) | `curl …` |
| `mcp-stdio` | server entry file | `npx -y github:Blockchains/<repo>` |
| `docker` | Dockerfile | `docker run -i --rm ghcr.io/blockchains/<repo>` |
| `cli` | script path | full command line |
| `solidity` | contract source path | `forge install Blockchains/<repo>` |
| `file` | path in the repo | how to use the file |
| `github-action` | workflow path | inputs / triggers |
| `web` | URL | deep-link pattern |
| `browser-script` | script path | `<script src=…>` |
`exports` (optional) lists the public names: functions, classes, contracts or MCP tools.
## Example (abridged, from blockchainlab-sdk)
```json
{
"$schema": "https://raw.githubusercontent.com/Blockchains/.github/main/docs/blocks.schema.json",
"schema_version": "1.0",
"name": "blockchainlab-sdk",
"repo": "Blockchains/blockchainlab-sdk",
"summary": "Typed TypeScript and Python clients for the Blockchain Lab Open Data API …",
"kind": ["library"],
"stability": "stable",
"version": "1.1.0",
"license": "MIT",
"entrypoints": [
{ "type": "npm", "name": "blockchainlab-sdk", "ref": "ts/src/index.ts", "install": "npm i github:Blockchains/blockchainlab-sdk", "exports": ["BlockchainLab", "DATASETS"] }
],
"inputs": [{ "name": "dataset name", "type": "DatasetName" }],
"outputs": [{ "name": "typed rows", "type": "<Dataset>Row[]" }],
"deps": ["node>=18 (or browsers/Deno/Bun)", "python>=3.9 (stdlib only)"],
"compatible_with": [{ "repo": "Blockchains/blockchainlab-api", "how": "the data source" }],
"tests": { "command": "npm test", "ci": ".github/workflows/ci.yml", "network": true },
"docs": { "readme": "README.md", "agents": "AGENTS.md", "llms": "llms.txt" }
}
```
## Rules
1. Everything in a manifest must be true of the code at the default branch. Commands must run; exports must exist.
2. Never put secret values in a manifest; `env` lists names only.
3. New optional fields can be added within `1.x`; making a field required or changing its meaning is `2.0` with a new schema file.
4. Validate before pushing: `pip install jsonschema && python3 scripts/validate_blocks.py --local ../<repo>`.
=== Blockchains/.github / AGENTS.md ===
Summary: Org-wide defaults (issue/PR templates, CONTRIBUTING, CODE_OF_CONDUCT, SECURITY) plus the building-block docs: BUILD-WITH-BLOCKS.md, BLOCKS-SCHEMA.md, blocks.schema.json and the workflow that validates every repo's blocks.json.
Manifest: https://raw.githubusercontent.com/Blockchains/.github/main/blocks.json
# AGENTS.md: .github
Instructions for AI coding agents (Grok, Cursor, Claude Code, Codex, Copilot and others) working **in** this repo or **using it as a building block**. Humans: see [README.md](README.md).
## What this is
Org-wide defaults (issue/PR templates, CONTRIBUTING, CODE_OF_CONDUCT, SECURITY) plus the building-block docs: BUILD-WITH-BLOCKS.md, BLOCKS-SCHEMA.md, blocks.schema.json and the workflow that validates every repo's blocks.json.
- Kind: docs, automation · stability: `stable` · licence: NOASSERTION
- Machine-readable manifest: [`blocks.json`](blocks.json) (schema: [BLOCKS-SCHEMA](https://github.com/Blockchains/.github/blob/main/docs/BLOCKS-SCHEMA.md))
- How it fits with the other Blockchains repos: [Build with Blocks](https://github.com/Blockchains/.github/blob/main/docs/BUILD-WITH-BLOCKS.md)
## Setup
```bash
pip install jsonschema
```
## Build and test
```bash
python3 scripts/validate_blocks.py
```
Tests hit **live** public networks/APIs (the org rule is no mocks). A failure can be an upstream outage: re-run before changing code.
## Structure
| Path | What |
|---|---|
| `docs/BUILD-WITH-BLOCKS.md` | assembly guide + recipes |
| `docs/BLOCKS-SCHEMA.md` | schema documentation |
| `docs/blocks.schema.json` | JSON Schema |
| `docs/STATUS.md` | repo audit |
| `scripts/validate_blocks.py` | validator |
| `.github/workflows/validate-blocks.yml` | CI |
| `ISSUE_TEMPLATE/, *.md` | community health defaults |
## Conventions
- Community files here apply to every repo that does not define its own.
## Extension points
- New schema field: add it to blocks.schema.json + BLOCKS-SCHEMA.md as optional first.
## Do
- Validate locally before pushing a blocks.json.
## Don't
- Make optional schema fields required without updating every repo.
- Commit secrets, keys or `.env` files. Run `gitleaks` before pushing; CI and the org policy reject leaks.
## Using it from another project
- **docs/blocks.schema.json** (file): `https://raw.githubusercontent.com/Blockchains/.github/main/docs/blocks.schema.json`
- **docs/BUILD-WITH-BLOCKS.md** (file): `how to assemble projects from Blockchains repos, with 3 verified recipes`
- **scripts/validate_blocks.py** (cli): `python3 scripts/validate_blocks.py [--local DIR ...] # validates every repo's blocks.json`
- **validate blocks** (github-action): `push, daily, workflow_dispatch`
See the README section [Use as a building block](README.md#use-as-a-building-block) for a copy-paste example.
## Related blocks
- [Blockchains/blockchains.github.io](https://github.com/Blockchains/blockchains.github.io): hub aggregates every blocks.json into /blocks.json
- [Blockchains/blockchainlab-sdk](https://github.com/Blockchains/blockchainlab-sdk): example block
- [Blockchains/blockchainlab-mcp](https://github.com/Blockchains/blockchainlab-mcp): example block
=== Blockchains/awesome-blockchainlab / AGENTS.md ===
Summary: Curated list of 225 open-source blockchain projects (+11 extended) forked under Blockchains and kept in sync by fork-sync, with a machine-readable forge.json (fork, upstream, category, licence, stars, docs, starters, index links).
Manifest: https://raw.githubusercontent.com/Blockchains/awesome-blockchainlab/main/blocks.json
# AGENTS.md: awesome-blockchainlab
Instructions for AI coding agents (Grok, Cursor, Claude Code, Codex, Copilot and others) working **in** this repo or **using it as a building block**. Humans: see [README.md](README.md).
## What this is
Curated list of 225 open-source blockchain projects (+11 extended) forked under Blockchains and kept in sync by fork-sync, with a machine-readable forge.json (fork, upstream, category, licence, stars, docs, starters, index links).
- Kind: curated-list, dataset · stability: `stable` · licence: CC0-1.0
- Machine-readable manifest: [`blocks.json`](blocks.json) (schema: [BLOCKS-SCHEMA](https://github.com/Blockchains/.github/blob/main/docs/BLOCKS-SCHEMA.md))
- How it fits with the other Blockchains repos: [Build with Blocks](https://github.com/Blockchains/.github/blob/main/docs/BUILD-WITH-BLOCKS.md)
## Setup
```bash
python3 --version
```
## Build and test
```bash
python3 scripts/validate.py # schema + every fork/upstream reachable
```
Tests hit **live** public networks/APIs (the org rule is no mocks). A failure can be an upstream outage: re-run before changing code.
## Structure
| Path | What |
|---|---|
| `README.md` | the list |
| `forge.json` | machine-readable list |
| `scripts/validate.py` | validator used by CI |
## Conventions
- README and forge.json must list the same forks.
- Selection: OSI licence, ≥1,000 stars (few documented exceptions), active in the last 90 days, not archived.
## Extension points
- Add a fork: fork it under Blockchains, add it to fork-sync forks.json and blockchainlab-index sources, then to forge.json + README.
## Do
- Run the validator before pushing.
## Don't
- Add a fork that fails the list's criteria (licence, stars, activity, not archived) without updating the criteria text.
- Commit secrets, keys or `.env` files. Run `gitleaks` before pushing; CI and the org policy reject leaks.
## Using it from another project
- **forge.json** (file): `https://raw.githubusercontent.com/Blockchains/awesome-blockchainlab/main/forge.json`
- **README.md** (file): `human-readable list by category`
See the README section [Use as a building block](README.md#use-as-a-building-block) for a copy-paste example.
## Related blocks
- [Blockchains/fork-sync](https://github.com/Blockchains/fork-sync): keeps every listed fork in sync
- [Blockchains/blockchainlab-index](https://github.com/Blockchains/blockchainlab-index): code index of the same forks (projects[].index links)
- [Blockchains/blockchainlab-starters](https://github.com/Blockchains/blockchainlab-starters): starters built on these forks
- [Blockchains/blockchainlab-compose](https://github.com/Blockchains/blockchainlab-compose): composes projects from them
=== Blockchains/awesome-grokhack / AGENTS.md ===
Summary: Curated list of 99 open-source Grok/xAI integrations (official xAI repos, SDKs, gateways, agent frameworks, coding agents, chat UIs, observability, voice, apps) forked under Blockchains, with machine-readable grok-forge.json.
Manifest: https://raw.githubusercontent.com/Blockchains/awesome-grokhack/main/blocks.json
# AGENTS.md: awesome-grokhack
Instructions for AI coding agents (Grok, Cursor, Claude Code, Codex, Copilot and others) working **in** this repo or **using it as a building block**. Humans: see [README.md](README.md).
## What this is
Curated list of 99 open-source Grok/xAI integrations (official xAI repos, SDKs, gateways, agent frameworks, coding agents, chat UIs, observability, voice, apps) forked under Blockchains, with machine-readable grok-forge.json.
- Kind: curated-list, dataset · stability: `stable` · licence: MIT
- Machine-readable manifest: [`blocks.json`](blocks.json) (schema: [BLOCKS-SCHEMA](https://github.com/Blockchains/.github/blob/main/docs/BLOCKS-SCHEMA.md))
- How it fits with the other Blockchains repos: [Build with Blocks](https://github.com/Blockchains/.github/blob/main/docs/BUILD-WITH-BLOCKS.md)
## Setup
```bash
python3 --version
```
## Build and test
```bash
# CI: validates grok-forge.json fields, README links and that every fork + upstream exists (gh api)
```
Tests hit **live** public networks/APIs (the org rule is no mocks). A failure can be an upstream outage: re-run before changing code.
## Structure
| Path | What |
|---|---|
| `README.md` | the list + criteria + Archived note |
| `grok-forge.json` | machine-readable list (consumed nightly by grokhack-index) |
| `skipped.json` | rejected candidates |
## Conventions
- Every repo in grok-forge.json must be linked from README.md (CI checks).
- Criteria live in grok-forge.json `criteria` and the README.
## Extension points
- Add a repo: fork it, add it to grok-forge.json (all required fields) and the README table; grokhack-index picks it up nightly.
## Do
- Keep `count` in sync.
## Don't
- Add a fork that fails the list's criteria (licence, stars, activity, not archived) without updating the criteria text.
- Commit secrets, keys or `.env` files. Run `gitleaks` before pushing; CI and the org policy reject leaks.
## Using it from another project
- **grok-forge.json** (file): `https://raw.githubusercontent.com/Blockchains/awesome-grokhack/main/grok-forge.json`
- **skipped.json** (file): `candidates rejected, with reasons`
See the README section [Use as a building block](README.md#use-as-a-building-block) for a copy-paste example.
## Related blocks
- [Blockchains/grokhack-index](https://github.com/Blockchains/grokhack-index): nightly index of these forks' Grok surface (reads grok-forge.json)
- [Blockchains/grokhack-forge](https://github.com/Blockchains/grokhack-forge): composes apps from the index
- [Blockchains/grokhack-submissions](https://github.com/Blockchains/grokhack-submissions): entry template for The Grok Hack
=== Blockchains/blockchain-dev-roadmap / AGENTS.md ===
Summary: Curated 2026 developer path from zero to shipping production smart contracts in 13 stages; every stage links concepts, primary docs, a runnable lab and a free tool.
Manifest: https://raw.githubusercontent.com/Blockchains/blockchain-dev-roadmap/main/blocks.json
# AGENTS.md: blockchain-dev-roadmap
Instructions for AI coding agents (Grok, Cursor, Claude Code, Codex, Copilot and others) working **in** this repo or **using it as a building block**. Humans: see [README.md](README.md).
## What this is
Curated 2026 developer path from zero to shipping production smart contracts in 13 stages; every stage links concepts, primary docs, a runnable lab and a free tool.
- Kind: docs, dataset · stability: `stable` · licence: MIT AND CC-BY-4.0
- Machine-readable manifest: [`blocks.json`](blocks.json) (schema: [BLOCKS-SCHEMA](https://github.com/Blockchains/.github/blob/main/docs/BLOCKS-SCHEMA.md))
- How it fits with the other Blockchains repos: [Build with Blocks](https://github.com/Blockchains/.github/blob/main/docs/BUILD-WITH-BLOCKS.md)
## Setup
```bash
# nothing to install
```
## Build and test
```bash
# CI link-checks README.md (.github/workflows/links.yml)
```
Tests hit **live** public networks/APIs (the org rule is no mocks). A failure can be an upstream outage: re-run before changing code.
## Structure
| Path | What |
|---|---|
| `README.md` | the content |
| `.github/workflows/links.yml` | link checker |
| `LICENSE` | MIT (code) / CC BY 4.0 (text) |
## Conventions
- Every item links to a primary doc plus a runnable lab or tool.
- UTM-tagged links to blockchainlab.com are intentional.
## Extension points
- Add an item in the right section with the same link pattern.
## Do
- Verify every link.
## Don't
- Remove or rename anchors other repos link to.
- Commit secrets, keys or `.env` files. Run `gitleaks` before pushing; CI and the org policy reject leaks.
## Using it from another project
- **README.md** (file): `https://raw.githubusercontent.com/Blockchains/blockchain-dev-roadmap/main/README.md`
See the README section [Use as a building block](README.md#use-as-a-building-block) for a copy-paste example.
## Related blocks
- [Blockchains/blockchainlab-labs](https://github.com/Blockchains/blockchainlab-labs): hands-on labs linked from each item
- [Blockchains/blockchainlab-tools](https://github.com/Blockchains/blockchainlab-tools): tools linked from each item
- [Blockchains/blockchain-interview-questions](https://github.com/Blockchains/blockchain-interview-questions): companion guide
=== Blockchains/blockchain-interview-questions / AGENTS.md ===
Summary: 54 blockchain and smart-contract interview questions with concise answers, each linked to a runnable lab, a free tool or an explainer.
Manifest: https://raw.githubusercontent.com/Blockchains/blockchain-interview-questions/main/blocks.json
# AGENTS.md: blockchain-interview-questions
Instructions for AI coding agents (Grok, Cursor, Claude Code, Codex, Copilot and others) working **in** this repo or **using it as a building block**. Humans: see [README.md](README.md).
## What this is
54 blockchain and smart-contract interview questions with concise answers, each linked to a runnable lab, a free tool or an explainer.
- Kind: docs, dataset · stability: `stable` · licence: MIT AND CC-BY-4.0
- Machine-readable manifest: [`blocks.json`](blocks.json) (schema: [BLOCKS-SCHEMA](https://github.com/Blockchains/.github/blob/main/docs/BLOCKS-SCHEMA.md))
- How it fits with the other Blockchains repos: [Build with Blocks](https://github.com/Blockchains/.github/blob/main/docs/BUILD-WITH-BLOCKS.md)
## Setup
```bash
# nothing to install
```
## Build and test
```bash
# CI link-checks README.md (.github/workflows/links.yml)
```
Tests hit **live** public networks/APIs (the org rule is no mocks). A failure can be an upstream outage: re-run before changing code.
## Structure
| Path | What |
|---|---|
| `README.md` | the content |
| `.github/workflows/links.yml` | link checker |
| `LICENSE` | MIT (code) / CC BY 4.0 (text) |
## Conventions
- Every item links to a primary doc plus a runnable lab or tool.
- UTM-tagged links to blockchainlab.com are intentional.
## Extension points
- Add an item in the right section with the same link pattern.
## Do
- Verify every link.
## Don't
- Remove or rename anchors other repos link to.
- Commit secrets, keys or `.env` files. Run `gitleaks` before pushing; CI and the org policy reject leaks.
## Using it from another project
- **README.md** (file): `https://raw.githubusercontent.com/Blockchains/blockchain-interview-questions/main/README.md`
See the README section [Use as a building block](README.md#use-as-a-building-block) for a copy-paste example.
## Related blocks
- [Blockchains/blockchainlab-labs](https://github.com/Blockchains/blockchainlab-labs): hands-on labs linked from each item
- [Blockchains/blockchainlab-tools](https://github.com/Blockchains/blockchainlab-tools): tools linked from each item
- [Blockchains/blockchain-dev-roadmap](https://github.com/Blockchains/blockchain-dev-roadmap): companion guide
=== Blockchains/blockchainlab-api / AGENTS.md ===
Summary: Free, static, CORS-enabled JSON API of 20 blockchain datasets rebuilt nightly from public sources (chainid.network, DefiLlama, L2BEAT, OFAC via 0xB10C, ethereum/EIPs, bitcoin/bips, Blockchain Lab corpus). No key, no backend.
Manifest: https://raw.githubusercontent.com/Blockchains/blockchainlab-api/main/blocks.json
# AGENTS.md: blockchainlab-api
Instructions for AI coding agents (Grok, Cursor, Claude Code, Codex, Copilot and others) working **in** this repo or **using it as a building block**. Humans: see [README.md](README.md).
## What this is
Free, static, CORS-enabled JSON API of 20 blockchain datasets rebuilt nightly from public sources (chainid.network, DefiLlama, L2BEAT, OFAC via 0xB10C, ethereum/EIPs, bitcoin/bips, Blockchain Lab corpus). No key, no backend.
- Kind: http-api, dataset · stability: `stable` · licence: MIT
- Machine-readable manifest: [`blocks.json`](blocks.json) (schema: [BLOCKS-SCHEMA](https://github.com/Blockchains/.github/blob/main/docs/BLOCKS-SCHEMA.md))
- How it fits with the other Blockchains repos: [Build with Blocks](https://github.com/Blockchains/.github/blob/main/docs/BUILD-WITH-BLOCKS.md)
## Setup
```bash
node --version # Node 20, zero npm dependencies
pip install jsonschema==4.23.0 pyyaml
```
## Build and test
```bash
node scripts/build.mjs # fetch all sources, write v1/*.json (network)
python3 scripts/validate.py # every dataset validates against its schema
python3 scripts/openapi.py && git diff --exit-code openapi.json
```
Tests hit **live** public networks/APIs (the org rule is no mocks). A failure can be an upstream outage: re-run before changing code.
## Structure
| Path | What |
|---|---|
| `scripts/build.mjs` | nightly builder: fetch, normalise, write `v1/<dataset>.json` |
| `scripts/schemas.py` | JSON Schemas per dataset |
| `scripts/validate.py` | schema validation |
| `scripts/openapi.py` | generates openapi.json/yaml |
| `v1/` | published datasets + `index.json` + `schemas/` |
| `data/grants.json` | curated grants input |
| `index.html, swagger.html` | docs pages |
## Conventions
- Same envelope for every dataset; never change field meaning within a schema major.
- Sources must be public and attributed (`source`, `source_url`).
- Unknown values are `null`, never invented.
## Extension points
- New dataset: add a builder in `scripts/build.mjs`, a schema in `scripts/schemas.py`, regenerate OpenAPI, then run `python3 scripts/gen.py` in blockchainlab-sdk.
- Self-host: copy `v1/` anywhere static and point SDK `baseUrl` / MCP `BLOCKCHAINLAB_API` at it.
## Do
- Read `v1/index.json` first to discover datasets and freshness.
- Respect each source's terms; keep attribution.
## Don't
- Hand-edit files in `v1/`; they are regenerated nightly.
- Invent data, mock network responses in shipped code, or hard-code values that should come from the live source; every repo here is 'no mocks, real data'.
- Commit secrets, keys or `.env` files. Run `gitleaks` before pushing; CI and the org policy reject leaks.
## Using it from another project
- **GET /v1/{dataset}.json** (http): `curl -s https://blockchains.github.io/blockchainlab-api/v1/chains.json`
- **GET /v1/index.json** (http): `catalogue: dataset, url, schema, count, generated_at, stale`
- **GET /v1/schemas/{dataset}.schema.json** (http): `JSON Schema per dataset`
- **openapi.yaml** (file): `https://blockchains.github.io/blockchainlab-api/openapi.yaml`
See the README section [Use as a building block](README.md#use-as-a-building-block) for a copy-paste example.
## Related blocks
- [Blockchains/blockchainlab-sdk](https://github.com/Blockchains/blockchainlab-sdk): typed TS/Python client generated from these schemas
- [Blockchains/blockchainlab-mcp](https://github.com/Blockchains/blockchainlab-mcp): 43 MCP tools, many backed by these datasets
- [Blockchains/blockchainlab-tools](https://github.com/Blockchains/blockchainlab-tools): browser tools read chains and EIP/ERC/BIP data from here
- [Blockchains/blockchains.github.io](https://github.com/Blockchains/blockchains.github.io): hub pages and AI briefs are built on it
- [Blockchains/blockchainlab-feeds](https://github.com/Blockchains/blockchainlab-feeds): source of the hackathons and events datasets
=== Blockchains/blockchainlab-compose / AGENTS.md ===
Summary: Idea-to-repo engine behind blockchainlab.com/forge: turns a plain-language token/NFT idea into a tested Foundry project (components from blockchainlab-index, pragma/licence checks, generated glue, tests, deploy script, CI) and optionally creates it under github.com/Blockchains.
Manifest: https://raw.githubusercontent.com/Blockchains/blockchainlab-compose/main/blocks.json
# AGENTS.md: blockchainlab-compose
Instructions for AI coding agents (Grok, Cursor, Claude Code, Codex, Copilot and others) working **in** this repo or **using it as a building block**. Humans: see [README.md](README.md).
## What this is
Idea-to-repo engine behind blockchainlab.com/forge: turns a plain-language token/NFT idea into a tested Foundry project (components from blockchainlab-index, pragma/licence checks, generated glue, tests, deploy script, CI) and optionally creates it under github.com/Blockchains.
- Kind: cli, github-action · stability: `beta` · licence: MIT
- Machine-readable manifest: [`blocks.json`](blocks.json) (schema: [BLOCKS-SCHEMA](https://github.com/Blockchains/.github/blob/main/docs/BLOCKS-SCHEMA.md))
- How it fits with the other Blockchains repos: [Build with Blocks](https://github.com/Blockchains/.github/blob/main/docs/BUILD-WITH-BLOCKS.md)
## Setup
```bash
pip --version # engine is stdlib only
pip install jsonschema # only for the tests (blocks.json schema validation)
foundryup # forge on PATH
```
## Build and test
```bash
python3 -m unittest discover -s tests -v
python3 -m blcompose.compose "An NFT membership collection with ERC-2981 royalties, role-based minting, a pause switch, and a paid mint priced in USD using a Chainlink ETH/USD price feed" --name ci-nft --out /tmp/ci-nft --json nft.json
```
Tests hit **live** public networks/APIs (the org rule is no mocks). A failure can be an upstream outage: re-run before changing code.
## Environment
| Variable | Required | Purpose |
|---|---|---|
| `XAI_API_KEY` | no | one Grok review call written to REVIEW.md (not an audit) |
| `MAINNET_RPC_URL` | no | enables generated live-chain fork tests |
| `FORGE_TOKEN` | no | repo secret; needed by the Action to create repos |
## Structure
| Path | What |
|---|---|
| `blcompose/compose.py` | pipeline + CLI (`main`) |
| `blcompose/recipes.py` | capability → glue/test generators |
| `blcompose/agentdocs.py` | AGENTS.md / llms.txt / blocks.json for composed repos (parses src/*.sol) |
| `blcompose/blocks.schema.json` | vendored copy of the org blocks schema (a test checks it matches the published one) |
| `tests/test_engine.py, tests/test_agentdocs.py` | unit tests |
| `.github/workflows/compose.yml` | dispatchable Action used by blockchainlab.com |
| `.github/workflows/ci.yml` | re-composes both reference ideas + refusal check |
## Conventions
- Copied components stay unmodified with SPDX headers; NOTICE lists every file.
- GPL components are refused for now; source-available licences are never copied.
- Outputs are deterministic for the same index + idea.
## Extension points
- New capability: add a recipe in `blcompose/recipes.py`, the taxonomy id in blockchainlab-index `taxonomy/capabilities.json`, and a CI idea that exercises it.
- Generated agent docs: edit `blcompose/agentdocs.py`; `tests/test_agentdocs.py` validates the manifest against the schema and the real generated sources.
## Do
- Run without `--create` while developing; inspect `/tmp/<name>`.
## Don't
- Create repos from tests.
- Hand-edit composed reference repos (they must stay reproducible).
- Invent data, mock network responses in shipped code, or hard-code values that should come from the live source; every repo here is 'no mocks, real data'.
- Commit secrets, keys or `.env` files. Run `gitleaks` before pushing; CI and the org policy reject leaks.
## Using it from another project
- **python3 -m blcompose.compose** (cli): `python3 -m blcompose.compose "<idea>" --name <repo> [--out DIR] [--index PATH] [--json result.json] [--create --wait]`
- **Compose a project** (github-action): `workflow_dispatch inputs: idea, name, request_id → results/<request_id>.json`
See the README section [Use as a building block](README.md#use-as-a-building-block) for a copy-paste example.
## Related blocks
- [Blockchains/blockchainlab-index](https://github.com/Blockchains/blockchainlab-index): component source (catalog, components, taxonomy)
- [Blockchains/forge-dao-governance-token](https://github.com/Blockchains/forge-dao-governance-token): reference output, re-composed in CI
- [Blockchains/forge-usd-priced-membership-nft](https://github.com/Blockchains/forge-usd-priced-membership-nft): reference output, re-composed in CI
- [Blockchains/grokhack-forge](https://github.com/Blockchains/grokhack-forge): sister composer for Grok apps
- [Blockchains/blockchainlab-sdk](https://github.com/Blockchains/blockchainlab-sdk): add a data layer to a generated dApp
=== Blockchains/blockchainlab-feeds / AGENTS.md ===
Summary: Public JSON feeds for blockchainlab.com: hackathons/grants/bounties, events, clustered X intel and mentions (public post IDs, links, handles, short trimmed summaries, counts only), built daily.
Manifest: https://raw.githubusercontent.com/Blockchains/blockchainlab-feeds/main/blocks.json
# AGENTS.md: blockchainlab-feeds
Instructions for AI coding agents (Grok, Cursor, Claude Code, Codex, Copilot and others) working **in** this repo or **using it as a building block**. Humans: see [README.md](README.md).
## What this is
Public JSON feeds for blockchainlab.com: hackathons/grants/bounties, events, clustered X intel and mentions (public post IDs, links, handles, short trimmed summaries, counts only), built daily.
- Kind: dataset, automation · stability: `beta` · licence: NOASSERTION
- Machine-readable manifest: [`blocks.json`](blocks.json) (schema: [BLOCKS-SCHEMA](https://github.com/Blockchains/.github/blob/main/docs/BLOCKS-SCHEMA.md))
- How it fits with the other Blockchains repos: [Build with Blocks](https://github.com/Blockchains/.github/blob/main/docs/BUILD-WITH-BLOCKS.md)
## Setup
```bash
python3 --version
```
## Build and test
```bash
python3 scripts/fetch_plan.py --date $(date +%F)
python3 scripts/build_feeds.py --date $(date +%F) --raw-dir /tmp/raw --digest-dir /tmp/digest # local build, no push
```
Tests hit **live** public networks/APIs (the org rule is no mocks). A failure can be an upstream outage: re-run before changing code.
## Structure
| Path | What |
|---|---|
| `feeds/<feed>/latest.json` | current feed (+ dated copies) |
| `scripts/fetch_plan.py` | list of X MCP calls to make |
| `scripts/build_feeds.py` | builds all feeds |
| `scripts/run_daily.sh` | build → gitleaks → commit → push |
| `watchlist.json` | accounts/topics |
## Conventions
- Public data only; summaries are trimmed from the post text, nothing invented.
- No licence file yet.
## Extension points
- New feed: add a builder in `scripts/build_feeds.py` writing `feeds/<name>/latest.json`.
## Do
- Keep `x_status` honest (`unavailable` when X could not be read).
## Don't
- Store private data or full post text.
- Invent data, mock network responses in shipped code, or hard-code values that should come from the live source; every repo here is 'no mocks, real data'.
- Commit secrets, keys or `.env` files. Run `gitleaks` before pushing; CI and the org policy reject leaks.
## Using it from another project
- **feeds/hackathons/latest.json** (http): `items[]: title, url, dates, prize, location, organizer, themes, state, source, verified`
- **feeds/events/latest.json** (http): `https://raw.githubusercontent.com/Blockchains/blockchainlab-feeds/main/feeds/events/latest.json`
- **feeds/x-intel/latest.json** (http): `https://raw.githubusercontent.com/Blockchains/blockchainlab-feeds/main/feeds/x-intel/latest.json`
- **scripts/build_feeds.py** (cli): `python3 scripts/build_feeds.py --date YYYY-MM-DD --raw-dir DIR --digest-dir DIR`
See the README section [Use as a building block](README.md#use-as-a-building-block) for a copy-paste example.
## Related blocks
- [Blockchains/blockchainlab-api](https://github.com/Blockchains/blockchainlab-api): republishes hackathons and events as API datasets
- [Blockchains/blockchains.github.io](https://github.com/Blockchains/blockchains.github.io): powers /events
- [Blockchains/hackathons](https://github.com/Blockchains/hackathons): human tracker of the same events
=== Blockchains/blockchainlab-index / AGENTS.md ===
Summary: Nightly machine-readable code index of the curated Blockchains forks: per-repo catalog, every contract/module/circuit as a component with functions, licence and pinned raw URL, capability taxonomy, int8 embeddings, static search shards and SQLite FTS5. Feeds the composers.
Manifest: https://raw.githubusercontent.com/Blockchains/blockchainlab-index/main/blocks.json
# AGENTS.md: blockchainlab-index
Instructions for AI coding agents (Grok, Cursor, Claude Code, Codex, Copilot and others) working **in** this repo or **using it as a building block**. Humans: see [README.md](README.md).
## What this is
Nightly machine-readable code index of the curated Blockchains forks: per-repo catalog, every contract/module/circuit as a component with functions, licence and pinned raw URL, capability taxonomy, int8 embeddings, static search shards and SQLite FTS5. Feeds the composers.
- Kind: index, dataset, cli · stability: `beta` · licence: MIT
- Machine-readable manifest: [`blocks.json`](blocks.json) (schema: [BLOCKS-SCHEMA](https://github.com/Blockchains/.github/blob/main/docs/BLOCKS-SCHEMA.md))
- How it fits with the other Blockchains repos: [Build with Blocks](https://github.com/Blockchains/.github/blob/main/docs/BUILD-WITH-BLOCKS.md)
## Setup
```bash
pip install -r requirements.txt
```
## Build and test
```bash
python3 indexer/validate.py . # catalog/component/vector consistency, file sizes
python3 indexer/build_index.py work/ingest-out . sources.json # full rebuild (after ingest)
```
## Structure
| Path | What |
|---|---|
| `catalog.json` | one record per fork |
| `components/` | components per fork |
| `vectors/` | bge-small int8 embeddings |
| `search/` | static search shards |
| `index.sqlite` | FTS5 |
| `taxonomy/capabilities.json` | capability taxonomy |
| `taxonomy/reuse.json` | how to reuse each fork category |
| `sources.json` | fork list |
| `indexer/` | ingest, build, validate, refresh, compose, finalize; reuse.py builds the per-repo `reuse` field |
| `examples/` | worked idea → plan examples |
## Conventions
- Everything is extracted from source files, never from READMEs alone.
- Licences recorded per repo and file; compose.py refuses source-available files and flags GPL/LGPL.
- Generated files are written by the nightly workflow; edit the indexer, not the output.
## Extension points
- New capability: add it to `taxonomy/capabilities.json` (synonyms, match rules, preferred components).