@@ -8,50 +8,54 @@ The project includes a `Dockerfile.dev` for consistent local development and tes
88
99### Prerequisites
1010
11- - [ Podman ] ( https://podman.io / ) or [ Docker ] ( https://docker.com / ) installed
11+ - [ Docker ] ( https://docker.com / ) installed ( or [ Podman ] ( https://podman.io / ) as an alternative)
1212- Git (for cloning the repository)
1313- At least 4GB of available RAM
1414
1515### Building the Development Image
1616
1717``` bash
1818# Build the development image
19- podman build -f Dockerfile.dev -t indexer-dev:latest .
20-
21- # Or with Docker
2219docker build -f Dockerfile.dev -t indexer-dev:latest .
20+
21+ # Note: You can also use Podman as a drop-in replacement for Docker
22+ # podman build -f Dockerfile.dev -t indexer-dev:latest .
2323```
2424
2525### Testing Performance Improvements Locally
2626
27+ ** Note** : All ` docker ` commands in this section can be used with Podman by simply replacing ` docker ` with ` podman ` .
28+
27291 . ** Mount your local project and run tests:**
2830``` bash
2931# Test the complete build
30- podman run --rm -v $( pwd) :/opt/indexer indexer-dev:latest bash -c " cd /opt/indexer && yarn compile"
32+ docker run --rm -v $( pwd) :/opt/indexer indexer-dev:latest bash -c " cd /opt/indexer && yarn compile"
3133
3234# Test individual packages
33- podman run --rm -v $( pwd) :/opt/indexer indexer-dev:latest bash -c " cd /opt/indexer/packages/indexer-common && yarn compile"
34- podman run --rm -v $( pwd) :/opt/indexer indexer-dev:latest bash -c " cd /opt/indexer/packages/indexer-agent && yarn compile"
35- podman run --rm -v $( pwd) :/opt/indexer indexer-dev:latest bash -c " cd /opt/indexer/packages/indexer-cli && yarn compile"
35+ docker run --rm -v $( pwd) :/opt/indexer indexer-dev:latest bash -c " cd /opt/indexer/packages/indexer-common && yarn compile"
36+ docker run --rm -v $( pwd) :/opt/indexer indexer-dev:latest bash -c " cd /opt/indexer/packages/indexer-agent && yarn compile"
37+ docker run --rm -v $( pwd) :/opt/indexer indexer-dev:latest bash -c " cd /opt/indexer/packages/indexer-cli && yarn compile"
3638```
3739
38402 . ** Test the new CLI flag:**
3941``` bash
4042# Verify the new flag is available
41- podman run --rm -v $( pwd) :/opt/indexer indexer-dev:latest bash -c " cd /opt/indexer/packages/indexer-agent && node bin/graph-indexer-agent start --help | grep -A 5 'indexer-min-stake-threshold'"
43+ docker run --rm -v $( pwd) :/opt/indexer indexer-dev:latest bash -c " cd /opt/indexer/packages/indexer-agent && node bin/graph-indexer-agent start --help | grep -A 5 'indexer-min-stake-threshold'"
4244```
4345
44463 . ** Run TypeScript type checking:**
4547``` bash
4648# Check specific files for type errors
47- podman run --rm -v $( pwd) :/opt/indexer indexer-dev:latest bash -c " cd /opt/indexer/packages/indexer-common && tsc --noEmit src/subgraphs.ts"
49+ docker run --rm -v $( pwd) :/opt/indexer indexer-dev:latest bash -c " cd /opt/indexer/packages/indexer-common && tsc --noEmit src/subgraphs.ts"
4850```
4951
5052### Interactive Development
5153
54+ ** Note** : All ` docker ` commands in this section can be used with Podman by simply replacing ` docker ` with ` podman ` .
55+
5256``` bash
5357# Start an interactive shell in the container
54- podman run --rm -it -v $( pwd) :/opt/indexer indexer-dev:latest bash
58+ docker run --rm -it -v $( pwd) :/opt/indexer indexer-dev:latest bash
5559
5660# Inside the container, you can:
5761cd /opt/indexer
@@ -62,14 +66,16 @@ yarn test # Run tests
6266
6367### Environment Variables for Testing
6468
69+ ** Note** : All ` docker ` commands in this section can be used with Podman by simply replacing ` docker ` with ` podman ` .
70+
6571The development image supports the same environment variables as the production build:
6672
6773``` bash
6874# Test with custom batch sizes
69- podman run --rm -v $( pwd) :/opt/indexer -e INDEXER_DEPLOYMENT_BATCH_SIZE=1000 indexer-dev:latest bash -c " cd /opt/indexer && yarn compile"
75+ docker run --rm -v $( pwd) :/opt/indexer -e INDEXER_DEPLOYMENT_BATCH_SIZE=1000 indexer-dev:latest bash -c " cd /opt/indexer && yarn compile"
7076
7177# Test with custom stake thresholds
72- podman run --rm -v $( pwd) :/opt/indexer -e INDEXER_MIN_STAKE_THRESHOLD=5000000000000000000 indexer-dev:latest bash -c " cd /opt/indexer && yarn compile"
78+ docker run --rm -v $( pwd) :/opt/indexer -e INDEXER_MIN_STAKE_THRESHOLD=5000000000000000000 indexer-dev:latest bash -c " cd /opt/indexer && yarn compile"
7379```
7480
7581### Troubleshooting
@@ -81,14 +87,16 @@ podman run --rm -v $(pwd):/opt/indexer -e INDEXER_MIN_STAKE_THRESHOLD=5000000000
8187
8288### Performance Testing
8389
90+ ** Note** : All ` docker ` commands in this section can be used with Podman by simply replacing ` docker ` with ` podman ` .
91+
8492To test the performance improvements with large datasets:
8593
8694``` bash
8795# Test compilation performance
88- podman run --rm -v $( pwd) :/opt/indexer indexer-dev:latest bash -c " cd /opt/indexer && time yarn compile"
96+ docker run --rm -v $( pwd) :/opt/indexer indexer-dev:latest bash -c " cd /opt/indexer && time yarn compile"
8997
9098# Test individual package compilation
91- podman run --rm -v $( pwd) :/opt/indexer indexer-dev:latest bash -c " cd /opt/indexer/packages/indexer-common && time tsc --noEmit"
99+ docker run --rm -v $( pwd) :/opt/indexer indexer-dev:latest bash -c " cd /opt/indexer/packages/indexer-common && time tsc --noEmit"
92100```
93101
94102## Project Structure
@@ -209,12 +217,14 @@ The script will:
209217
210218### Using Docker for Testing
211219
220+ ** Note** : All ` docker ` commands in this section can be used with Podman by simply replacing ` docker ` with ` podman ` .
221+
212222``` bash
213223# Run tests in the development container
214- podman run --rm -v $( pwd) :/opt/indexer indexer-dev:latest bash -c " cd /opt/indexer && yarn test"
224+ docker run --rm -v $( pwd) :/opt/indexer indexer-dev:latest bash -c " cd /opt/indexer && yarn test"
215225
216226# Run specific test suites
217- podman run --rm -v $( pwd) :/opt/indexer indexer-dev:latest bash -c " cd /opt/indexer/packages/indexer-common && yarn test"
227+ docker run --rm -v $( pwd) :/opt/indexer indexer-dev:latest bash -c " cd /opt/indexer/packages/indexer-agent && yarn test"
218228```
219229
220230## Contributing
@@ -266,6 +276,8 @@ When making changes that affect performance:
266276** Problem** : Port conflicts
267277** Solution** : Use different ports or stop conflicting services
268278
279+ ** Note** : If you're using Podman instead of Docker, replace ` docker ` with ` podman ` in all commands. Podman is a drop-in replacement for Docker and supports the same command-line interface.
280+
269281## Resources
270282
271283- [ The Graph Protocol Documentation] ( https://thegraph.com/docs/ )
0 commit comments