Copycat L3 indexer and GraphQL#903
Draft
speeddragon wants to merge 58 commits into
Draft
Conversation
- Return tagged tuples from latest_height and normalize_height
- Propagate errors through parse_range using maybe block
- Return {error, unavailable} (HTTP 503) on upstream failures
- Validate resolved heights are non-negative in parse_range
- Log original upstream error reason before collapsing to unavailable
- Add regression tests with mock server for both failure paths
…ritting faster than OS is writting in disk
…ave, tests fixed on hb_store_arweave
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR is the continuation of #837 with GraphQL and pending TX work.
Summary currently reflects the previous PR, to be updated.
Summary
~arweave@2.9/parent=<id>endpoint for parent lookupsHow to use
Index blocks
Index a range of blocks at depth 3 (L1 TXs → L2 bundle items → L3 nested items):
curl "http://localhost:8005/~copycat@1.0/arweave?from=1890000&to=1889000&depth=3"For long-running indexing, use the cron wrapper to avoid HTTP timeout killing the job:
curl "http://localhost:8005/~cron@1.0/once?cron-path=~copycat@1.0/arweave&from=-1&to=1862995&depth=3"Query the inventory
See what was indexed per block, grouped by depth level:
curl "http://localhost:8005/~copycat@1.0/arweave?from=1890000&to=1889990&mode=inventory"Example response:
{ "1890000": { "depth": 3, "items": { "1": ["txid1", "txid2"], "2": ["bundleitem1", "bundleitem2"], "3": ["nesteditem1"] } } }Look up an item's parent
Find which block or bundle contains a given item:
curl "http://localhost:8005/~arweave@2.9/parent=CwxY--7bsqjtw2lneMUjkmYT9CWAYZvsmsO06dY232g"Response:
{"parents": [{"type": "bundle", "id": "Rve4-grgOw8jXLVw3f6nUhQvlVn6AYm7wA4I5HeKW74"}]}What gets indexed
The copycat indexer writes these entries to the index store:
<item-id>→ codec + offset + length): maps each item to its location in the Arweave weaveblock/<height>/depth→ integer): records that a block was indexed and to what depthblock/<height>/items/<depth>→ item IDs): lists items found at each depth levelparent/<item-id>→ type + parent ref): maps each item to its containing block (height) or bundle (ID)Configuration
arweave_block_workersarweave_index_workerscopycat_memory_budgetcopycat_memory_cap