|
| 1 | +# Developer Setup Guide |
| 2 | + |
| 3 | +This guide provides the step to set up a development workflow for the indexer-service project testing. |
| 4 | +Including how to build and deploy the required containers, and how to use hot-reload for faster dev iterations. |
| 5 | + |
| 6 | +### Note |
| 7 | + |
| 8 | +The current implementation leverages local-network for the common services and uses its testing configuration. |
| 9 | + |
| 10 | +## Available Commands |
| 11 | + |
| 12 | +We provide the following Make/Just commands to streamline your development workflow: |
| 13 | + |
| 14 | +- `just setup` - Full setup of all services, dependencies and binary compilation |
| 15 | +- `just reload` - Rebuild Rust binaries and restart services after code changes |
| 16 | +- `just logs` - Watch log output from all services |
| 17 | +- `just down` - Stop all services |
| 18 | +- `just test-local` - Run integration tests against local services |
| 19 | + |
| 20 | +## Initial Setup |
| 21 | + |
| 22 | +To get started with development: |
| 23 | + |
| 24 | +1. Clone the repository |
| 25 | +2. Run the full setup to initialize all services: |
| 26 | + |
| 27 | +```bash |
| 28 | +just setup |
| 29 | +``` |
| 30 | + |
| 31 | +This will: |
| 32 | + |
| 33 | +- Clone the local-network repo if needed |
| 34 | +- Start core infrastructure services |
| 35 | +- Deploy contracts and required services |
| 36 | +- Set up and start the indexer and tap-agent services |
| 37 | + |
| 38 | +## Development Workflow |
| 39 | + |
| 40 | +After the initial setup, you can use the fast development workflow: |
| 41 | + |
| 42 | +1. Make changes to the Rust code in `crates/` |
| 43 | +2. Run the reload command to rebuild and restart indexer and tap-agent services: |
| 44 | + |
| 45 | +```bash |
| 46 | +just reload |
| 47 | +``` |
| 48 | + |
| 49 | +This workflow is much faster because: |
| 50 | + |
| 51 | +- It only recompiles the Rust code |
| 52 | +- It doesn't rebuild Docker containers |
| 53 | +- It restarts only the necessary services |
| 54 | + |
| 55 | +The `reload` command will automatically show the logs after restarting, so you can see if your changes are working properly. |
| 56 | + |
| 57 | +## How It Works |
| 58 | + |
| 59 | +The development workflow uses volume mounts to avoid rebuilding containers: |
| 60 | + |
| 61 | +1. A base Docker image with all dependencies is created once |
| 62 | +2. Your code is compiled locally on your machine |
| 63 | +3. The compiled binaries are mounted into the containers |
| 64 | +4. Services are restarted with the new binaries |
| 65 | + |
| 66 | +This approach avoids the time-consuming container rebuild process while still maintaining a consistent containerized environment. |
| 67 | + |
| 68 | +## Viewing Logs |
| 69 | + |
| 70 | +To monitor the services during development: |
| 71 | + |
| 72 | +```bash |
| 73 | +just logs |
| 74 | +``` |
| 75 | + |
| 76 | +This will show a live stream of logs from all services, which is useful for debugging. |
| 77 | + |
| 78 | +## Running Tests |
| 79 | + |
| 80 | +To run integration tests against your local environment: |
| 81 | + |
| 82 | +```bash |
| 83 | +just local-test |
| 84 | +``` |
| 85 | + |
| 86 | +This is currently a work in progress, and additional testing strategies are still being defined and implemented. |
| 87 | + |
| 88 | +## Stopping Services |
| 89 | + |
| 90 | +When you're done working: |
| 91 | + |
| 92 | +```bash |
| 93 | +just down |
| 94 | +``` |
| 95 | + |
| 96 | +This will stop and remove all the containers defined in the docker-compose file. |
0 commit comments