{"id":25449779,"url":"https://github.com/martincastroalvarez/rust-alloy","last_synced_at":"2026-04-19T14:09:05.261Z","repository":{"id":277781002,"uuid":"933428522","full_name":"MartinCastroAlvarez/rust-alloy","owner":"MartinCastroAlvarez","description":"Dockerized Rust API using Tokio, Warp, Alloy, Foundry, and Grafana.","archived":false,"fork":false,"pushed_at":"2025-02-16T03:25:27.000Z","size":3847,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-16T04:19:40.936Z","etag":null,"topics":["alloy","docker","docker-compose","foundry","grafana","prometheus","rust","tokio","web3"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MartinCastroAlvarez.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-02-15T23:29:05.000Z","updated_at":"2025-02-16T03:25:30.000Z","dependencies_parsed_at":"2025-02-16T04:29:59.604Z","dependency_job_id":null,"html_url":"https://github.com/MartinCastroAlvarez/rust-alloy","commit_stats":null,"previous_names":["martincastroalvarez/rust-alloy"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MartinCastroAlvarez%2Frust-alloy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MartinCastroAlvarez%2Frust-alloy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MartinCastroAlvarez%2Frust-alloy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MartinCastroAlvarez%2Frust-alloy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MartinCastroAlvarez","download_url":"https://codeload.github.com/MartinCastroAlvarez/rust-alloy/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239366246,"owners_count":19626656,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["alloy","docker","docker-compose","foundry","grafana","prometheus","rust","tokio","web3"],"created_at":"2025-02-17T21:18:14.866Z","updated_at":"2025-11-02T02:30:42.173Z","avatar_url":"https://github.com/MartinCastroAlvarez.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rust-alloy\n\nDockerized Rust API using Tokio, Warp, Alloy, Foundry, and Grafana.\n\n![wallpapers.jpg](./wallpaper.jpg)\n\n## References\n\n- [Alloy](https://github.com/alloy-rs) - Rust Ethereum development framework\n- [Anvil](https://book.getfoundry.sh/anvil/) - Local Ethereum node for development and testing\n\n## API Documentation\n\n| Endpoint | Method | Description |\n|----------|--------|-------------|\n| `/health` | GET | Check if the server is running. |\n| `/balance/:id/balance` | GET | Get the balance of an address. |\n\n## Setup\n\nStart all the services using Docker Compose:\n\n```bash\ndocker compose up -d\n```\n\nThis will start a local Ethereum network using Anvil, the Rust API server, and Grafana.\n\nNow, verify that the API is running:\n\n```bash\ncurl http://localhost:3030/health\n```\n\n![health.png](./health.png)\n\nNext, you can get the balance of an address:\n\n```bash\ncurl http://localhost:3030/balance/f39Fd6e51aad88F6F4ce6aB8827279cffFb92266\n```\n\n![balance.png](./balance.png)\n\nAlso, verify that Grafana is running:\n\n```bash\nopen http://localhost:3000\n```\n\n![grafana.png](./grafana.png)\n\n## Build\n\n#### Linting \u0026 Formatting\n\nLinting and formatting are handled by the `clippy` and `rustfmt` tools during the build process.\nThere is no need to run them separately.\n\n#### Unit Testing\n\nUnit testing is handled by the `cargo test` command.\nThis is run automatically during the build process. There is no need to run it separately.\n\n```bash\ndocker compose up --build\n```\n\n## Deployment\n\nSimple build the project according to [BUILD.md](./BUILD.md) and then deploy the API to a server.\n\nRemember to set the `ETHEREUM_RPC_URL` environment variable to the URL of the Ethereum node you want to use.\nIn addition, set the `OTEL_EXPORTER_OTLP_ENDPOINT` environment variable to the URL of the OpenTelemetry collector you want to use.\n\n## Monitoring\n\nThe project uses [Prometheus](https://prometheus.io/) to collect metrics and [Grafana](https://grafana.com/) to visualize them.\n\nPrometheus is configured to scrape metrics from the project's API.\n\nGrafana is configured to display the metrics collected by Prometheus.\n\nTo view the dashboards, run `docker compose up` and navigate to [`http://localhost:3000`](http://localhost:3000).\n\n| File | Purpose |\n|------|---------|\n| [`otel-collector-config.yaml`](./infra/otel-collector-config.yaml) | Sets up how our monitoring system collects and sends data about our API. |\n| [`prometheus.yml`](./infra/prometheus.yml) | Tells Prometheus (our metrics database) where to find the data it needs to store. |\n| [`grafana/datasources/prometheus.yml`](./infra/grafana/datasources/prometheus.yml) | Helps Grafana (our metrics dashboard) find and display the data from Prometheus. |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmartincastroalvarez%2Frust-alloy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmartincastroalvarez%2Frust-alloy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmartincastroalvarez%2Frust-alloy/lists"}