Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
c49ebe8
feat: upgrade to ethers v6, bump common-ts and use toolshed for contr…
tmigone May 16, 2025
db6b450
chore: add is horizon ready flag to network monitor (#1118)
Maikol May 21, 2025
9fbfacc
feat: support split address books (#1119)
tmigone May 22, 2025
70490e0
feat: update registration to support horizon flow, add provisioning f…
tmigone May 22, 2025
da8f53d
Horizon fixes (#1121)
tmigone May 23, 2025
0e6c962
Horizon: allocation management (#1123)
tmigone Jun 2, 2025
f508a92
Merge remote-tracking branch 'origin/main' into horizon
tmigone Jun 2, 2025
f9cc1ff
chore: add isLegacy column to actions table
tmigone Jun 2, 2025
d2bfd5b
chore: cli support isLegacy for actions
tmigone Jun 3, 2025
2b44aaa
wip: full allocation management
tmigone Jun 6, 2025
606a8e7
fix: allocation cli bugs
tmigone Jun 9, 2025
325d6fa
feat: add column wrapping to table format in cli
tmigone Jun 9, 2025
3d4562b
feat: add wrap to allocation commands
tmigone Jun 9, 2025
09898ce
feat: allocate and unallocate in action queue
tmigone Jun 9, 2025
65f6fd2
fix: action update serialization bug for bigints
tmigone Jun 10, 2025
dc590ce
feat: unallocate action queue management
tmigone Jun 10, 2025
557f002
chore: clean up todos
tmigone Jun 10, 2025
0e448be
wip: graph tally support
tmigone Jun 10, 2025
bff35ba
chore: update toolshed to 0.6.4
tmigone Jun 18, 2025
7697a93
fix: rewardsmanager events
tmigone Jun 18, 2025
112e1e8
fix: wip refactor of batch execution to account for non atomic batches
tmigone Jun 18, 2025
3579e8e
chore: better tx filtering on executeTransaction
tmigone Jun 19, 2025
660ce64
feat: fix graphtally database model and add migrations
tmigone Jun 19, 2025
55d2284
fix: database migrations for horizon
tmigone Jun 20, 2025
19a4df1
feat: add graph-tally collector
tmigone Jun 24, 2025
30e3682
fix: tests in the horizon branch (#1135)
pcarranzav Jul 28, 2025
5a51888
core: replace horizon and subgraph dependency with address book
tmigone Aug 5, 2025
ce21845
fix: ensure allocation keys derive from root wallet (#1136)
Maikol Aug 15, 2025
b97fafb
Merge branch 'main' into horizon
tmigone Aug 19, 2025
dd9cd06
chore: lint
tmigone Aug 19, 2025
dd0bfec
fix: expired allocations filter
tmigone Sep 9, 2025
5b4a132
fix: bug where the agent would attempt to register on each startup
tmigone Sep 9, 2025
91c85e9
fix: multiple bugs with graph tally collection process
tmigone Sep 10, 2025
c9c4f10
fix: RAV finality and redeemal handling
tmigone Sep 11, 2025
4756443
ci: format
tmigone Sep 15, 2025
a9af51e
chore: remove unused dependencies
tmigone Sep 15, 2025
b085f29
fix: ensure payments destination is also treated as a registration pa…
tmigone Sep 15, 2025
eb59a01
ci: formatting
tmigone Sep 15, 2025
09a5779
docs: update some docs
tmigone Sep 16, 2025
1c4d618
docs: update readme files
tmigone Sep 16, 2025
5dc6c1a
fix(agent): use correct interface for service registry
tmigone Sep 18, 2025
ff6d648
ci: format
tmigone Sep 18, 2025
6eb2a92
fix: tap v1 rav management
tmigone Sep 19, 2025
f43266e
feat: automatically migrate stake after closing legacy allocations un…
tmigone Sep 19, 2025
1cff613
fix: dont attempt to register if indexer has no provision
tmigone Sep 19, 2025
410ddc8
fix: apply pre-register provision check only in horizon
tmigone Sep 22, 2025
79bd5c0
fix: better handling of auto reallocate during transition period
tmigone Sep 23, 2025
f4bbe22
fix: allocation management transitioning to horizon
tmigone Sep 24, 2025
ddcd0ba
chore: bump address book to testnet version
tmigone Oct 7, 2025
156a655
chore: update network subgraph endpoints for testnet
tmigone Oct 7, 2025
d45a596
chore: update network document for testnet
tmigone Oct 8, 2025
001b81c
fix: use correct address books
tmigone Oct 9, 2025
d0d9a8e
fix: downgrade wrap-ansi to avoid ESM import issues
tmigone Oct 9, 2025
f3df3e3
fix: wrap-ansi es module import issue by downgrading to v7
tmigone Oct 10, 2025
df7375d
fix: add wrap-ansi types
tmigone Oct 10, 2025
82c9eaf
docs: update EBO testnet deployment id
tmigone Oct 13, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -120,3 +120,7 @@ yalc.lock
.idea/
.envrc
.vscode

# local-network override mode files
tap-contracts.json
config/config.yaml
93 changes: 86 additions & 7 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@ This is the Graph Protocol Indexer monorepo containing the indexer agent, CLI, a

## Repository Structure

- **`/packages/`** - Lerna monorepo with 4 packages:
- **`/packages/`** - Lerna monorepo with 3 active packages:
- **`indexer-agent/`** - Main indexer agent that manages allocations and monitors the network
- **`indexer-cli/`** - CLI for managing indexer operations (plugin for @graphprotocol/graph-cli)
- **`indexer-common/`** - Shared functionality used by other packages
- **`indexer-native/`** - Listed but directory doesn't exist (deprecated)
- **`/docs/`** - Documentation including network configs and setup guides
- **`/k8s/`** - Kubernetes deployment configurations
- **`/terraform/`** - Infrastructure as Code for GKE deployment
Expand Down Expand Up @@ -59,9 +58,10 @@ yarn test:debug
### Code Quality
```bash
# In any package directory
yarn lint # Lint and fix TypeScript files
yarn format # Format code with Prettier
yarn lint # Lint and fix TypeScript files
yarn prepare # Run format, lint, and compile
yarn clean # Clean build artifacts and node_modules
```

### Running the Indexer
Expand Down Expand Up @@ -113,6 +113,14 @@ The indexer uses PostgreSQL to store:
- POI dispute data
- TAP receipts and RAVs (Receipt Aggregate Vouchers)

Database migrations are managed via Umzug. Available migration commands in `indexer-agent`:
```bash
yarn migrator:pending # View pending migrations
yarn migrator:executed # View executed migrations
yarn migrator:up # Run pending migrations
yarn migrator:down # Rollback last migration
```

### Integration Points
- **Graph Node**: Queries subgraph data and manages deployments
- **Ethereum/Arbitrum**: On-chain transactions for allocations
Expand All @@ -123,15 +131,86 @@ The indexer uses PostgreSQL to store:
## Testing Requirements

Tests require:
1. PostgreSQL database (handled by `scripts/run-tests.sh`)
2. Environment variables in `.env`:
1. Docker installed and running
2. PostgreSQL database (handled by `scripts/run-tests.sh`)
3. Environment variables in `.env` (copy from `.env.example`):
```
INDEXER_TEST_JRPC_PROVIDER_URL=<Arbitrum Sepolia RPC>
INDEXER_TEST_API_KEY=<Graph API key>
```

The `scripts/run-tests.sh` script:
- Starts a PostgreSQL container with test configuration
- Loads credentials from `.env`
- Runs the test suite with proper environment variables
- Cleans up the PostgreSQL container when done

## Horizon Support

The indexer now supports Graph Horizon, the next-generation architecture for The Graph Protocol:

### Key Changes
- **Dual Contract System**: Supports both legacy and Horizon contracts simultaneously
- **New Contracts**: HorizonStaking, SubgraphService, PaymentsEscrow, GraphTallyCollector
- **Enhanced TAP v2**: Receipt Aggregate Vouchers v2 (RAV v2) with collection-based aggregation
- **Automatic Detection**: System automatically detects Horizon-enabled networks
- **Address Books**: Separate configuration for horizon, subgraph-service, and TAP contracts

### Configuration
```bash
# New Horizon-specific options
--horizon-address-book # Path to Horizon contracts address book
--subgraph-service-address-book # Path to SubgraphService contracts address book
--tap-address-book # Path to TAP contracts address book
--max-provision-initial-size # Initial SubgraphService provision size
--payments-destination # Separate payment collection address
```

### Database Migrations
- Migration 21: Adds TAP Horizon tables for receipts and RAVs
- Migration 22: Adds TAP Horizon deny list functionality

## Package Architecture

### indexer-common
Core shared library providing:
- **Allocations**: Horizon and legacy allocation management (`allocations/`)
- TAP collector for query fee collection
- Graph tally collector for aggregating receipts
- Escrow account management for both Horizon and legacy
- **Indexer Management**: GraphQL server and resolvers for managing indexer operations
- Action queue management
- Allocation lifecycle
- Indexing rules
- Cost models
- **Network**: Network subgraph queries and protocol interactions
- **Graph Node**: Graph Node status and deployment management APIs
- **Subgraphs**: Subgraph deployment utilities and helpers
- **Transactions**: Ethereum transaction management with gas optimization

### indexer-agent
Autonomous agent that:
- Monitors network for subgraph deployments via network subgraph
- Manages allocations based on indexing rules (automatic or manual mode)
- Collects query fees via TAP protocol
- Submits POIs (Proofs of Indexing) on-chain
- Handles disputes monitoring
- Manages Graph Node deployments

### indexer-cli
Command-line interface providing commands for:
- Indexing rules management (`graph indexer rules`)
- Allocation management (`graph indexer allocations`)
- Action queue operations (`graph indexer actions`)
- Cost model configuration (`graph indexer cost`)
- Provision management for Horizon (`graph indexer provision`)
- Status monitoring (`graph indexer status`)
- Disputes monitoring (`graph indexer disputes`)

## Current State
- Version: v0.24.3
- Active branch: release-v0.24
- Node version: >=18.0.0
- Main branch: main
- Uncommitted changes in docs/ and config/
- Package manager: Yarn 1.22.22
- Beta software status
- Horizon support: Active on supported networks
Loading
Loading