Skip to content

Commit 96a3b60

Browse files
committed
docs: update wip
Signed-off-by: Gustavo Inacio <[email protected]>
1 parent 53c4e40 commit 96a3b60

File tree

1 file changed

+75
-76
lines changed

1 file changed

+75
-76
lines changed

README.md

Lines changed: 75 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,19 @@ to provide subgraph service as an Indexer,
66
integrated with [TAP](https://github.com/semiotic-ai/timeline-aggregation-protocol)
77
which is a fast, efficient, and trustless unidirectional micro-payments system.
88

9+
---
910
## Getting started
1011

11-
1212
### Docker images
1313
We build Docker images for commit, pull request and release.
1414

1515
You can use them by using xxxx:<tag>.
1616

17-
### Building locally
17+
### Building Locally
18+
19+
To build and run the project locally, use the following command:
1820

19-
```txt
21+
```bash
2022
$ cargo run -p indexer-service-rs -- --help
2123

2224
Usage: indexer-service-rs --config <FILE>
@@ -27,17 +29,19 @@ Options:
2729
-h, --help Print help
2830
```
2931

30-
### Configuration
32+
## Configuration
3133

32-
All the configuration is done through a TOML file. Please see the
33-
up-to-date TOML configuration templates:
34+
All configuration is managed through a TOML file. Below are examples of configuration templates to help you get started:
3435

35-
- [Minimal configuration template (recommended)](config/minimal-config-example.toml)
36-
- [Maximal configuration template (not recommended, dangerous settings)](config/maximal-config-example.toml)
36+
- [Minimal Configuration Template (Recommended)](config/minimal-config-example.toml): A minimal setup with only the essential configuration options.
37+
- [Maximal Configuration Template (Not Recommended)](config/maximal-config-example.toml): Includes all possible options, but some settings may be dangerous or unsuitable for production.
3738

39+
If you are migrating from an older stack, use the [Migration Configuration Guide](./docs/migration-config/README.md) for detailed instructions.
3840

39-
If you are running the old stack, you can quickly start by using
40-
the [Migration Config](/docs/migration-config/README.md).
41+
### Key Notes:
42+
- Ensure your configuration is tailored to your deployment environment.
43+
- Validate the configuration file syntax before starting the service.
44+
- Use environment variables to override sensitive settings like database credentials or API tokens where applicable.
4145

4246

4347
### Migrations
@@ -50,87 +54,82 @@ the [Migration Config](/docs/migration-config/README.md).
5054

5155
## Upgrading
5256

53-
We follow conventional semantics for package versioning.
54-
An indexer may set a minor version specification for
55-
automatic patch updates while preventing breaking changes.
56-
To safely upgrade the package, we recommend the following steps:
57-
58-
1. **Review Release Notes**: Before upgrading, check the release
59-
notes for the new version to understand what changes, fixes,
60-
or new features are included.
61-
2. **Review Documentation**: Check the up-to-date documentation
62-
for an accurate reflection of the changes made during the
63-
upgrade.
64-
3. **Backup Configuration**: Save your current configuration
65-
files and any local modifications you've made to the
66-
existing codebase.
67-
4. **Deploy**: Replace the old executable or docker image with
68-
the new one and restart the service to apply the upgrade.
69-
5. **Monitor and Validate**: After the upgrade, monitor system
70-
behavior and performance metrics to validate that the
71-
service is running as expected.
72-
73-
These steps should ensure a smooth transition to the latest version
74-
of `indexer-service-rs`, harnessing new capabilities
75-
while maintaining system integrity.
57+
We follow semantic versioning to ensure backward compatibility and minimize breaking changes. To upgrade safely, follow these steps:
7658

59+
1. **Review Release Notes:** Check the release notes for details about changes, fixes, and new features included in the updated version.
60+
2. **Review Documentation:** Refer to the latest documentation to understand any modifications in behavior or configuration.
61+
3. **Backup Configuration:** Save your existing configuration files and any local changes for easy recovery if needed.
62+
4. **Deploy:** Replace the old executable or Docker image with the new version. Restart the service to apply the changes.
63+
5. **Monitor and Validate:** After upgrading, monitor metrics and logs to ensure the service is running as expected and validate critical functionality.
7764

78-
## Contributing
79-
80-
[Contributions guide](./CONTRIBUTORS.md)
81-
82-
83-
## Applications
84-
### indexer-service-rs
65+
By following these steps, you can take advantage of new features and improvements while maintaining the stability of your system.
8566

86-
The Subgraph Service is an [axum](https://crates.io/crates/axum) webserver
87-
which serves as a router to [graph-node](https://github.com/graphprotocol/graph-node).
67+
## Contributing
8868

89-
The server was built in way where all checks are done via middlewares,
90-
and are easily extensible providing granuality and testable components.
69+
We welcome contributions to `indexer-rs`!
9170

92-
TAP receipts are processed by the `tap-middleware` which execute
93-
all [checks](./crates/service/src/tap/checks/) and then store
94-
the receipts in the database. Later, those receipts are
95-
processed and aggregated by [tap-agent](#indexer-tap-agent).
71+
### How to Contribute
72+
- Read the [Contributions Guide](./CONTRIBUTORS.md) for detailed guidelines.
73+
- Follow coding standards and ensure your changes align with the project structure.
74+
- Write tests to validate your contributions and maintain project integrity.
75+
- Submit a pull request with a clear description of your changes and their purpose.
9676

97-
The [router](./crates/service/src/service/router.rs) is built
98-
using the builder pattern where you provide all components
99-
needed checked at compile time. You can find the routes
100-
[here](./docs/Routes.md).
77+
Contributions can include:
78+
- Bug fixes
79+
- New features
80+
- Documentation improvements
81+
- Performance optimizations
10182

102-
If you want to see examples of queries to `indexer-service-rs`, you
103-
can [checkout here](./docs/Queries.md).
83+
Feel free to suggest enhancements or report issues in the project repository.
10484

10585

106-
The application is instrumented to output prometheus metrics.
107-
It accepts requests in `<metric_port>` (defaults to 7300) in route `/metrics`.
86+
## Implementation Details
10887

109-
List of exposed metrics can be [found here](/docs/Metrics.md#indexer-service-metrics).
88+
### indexer-service-rs
11089

90+
The Subgraph Service is an [axum](https://crates.io/crates/axum)-based web server that serves as a router to [graph-node](https://github.com/graphprotocol/graph-node). It is designed for extensibility, granularity, and testability.
91+
92+
#### Key Features
93+
- **Middleware-Based Checks:** All validation and processing are performed through middleware, enabling modular and reusable components.
94+
- **TAP Integration:**
95+
- TAP receipts are processed by the `tap-middleware`, where they undergo various [checks](./crates/service/src/tap/checks/).
96+
- Valid receipts are stored in the database, later aggregated into RAVs (Redeemable Aggregate Values) by the [tap-agent](#indexer-tap-agent).
97+
- **Router Implementation:**
98+
- Built using the builder pattern for compile-time validation of required components.
99+
- Routes are well-defined and documented. For a complete list, refer to the [Routes Documentation](./docs/Routes.md).
100+
- **Query Examples:** Examples of queries that can be sent to `indexer-service-rs` are available in the [Queries Documentation](./docs/Queries.md).
101+
- **Prometheus Metrics:**
102+
- The service is instrumented to expose metrics in Prometheus format.
103+
- Metrics are accessible via the `/metrics` endpoint on `<metric_port>` (default: `7300`).
104+
- A detailed list of metrics is available in the [Metrics Documentation](/docs/Metrics.md#indexer-service-metrics).
111105

112106
### indexer-tap-agent
113107

114-
Tap Agent
115-
116-
117-
## Crates
118-
- `indexer-allocation`: Shared structs related to allocations in The Graph.
119-
- `indexer-attestation`: Library used to generate attestations for (request, response).
120-
- `indexer-config`: Parses the configuration shared by both applications.
121-
- `indexer-dips`: WIP: Library used to for DIPS.
122-
- `indexer-monitor`: Library shared by applications to monitor subgraphs via polling
123-
and update the state shared with reactive components.
124-
- `indexer-query`: Type-safe queries used in the system checked at compile-time
125-
using [graphql-client](https://github.com/graphql-rust/graphql-client) as lib.
126-
- `*indexer-service-rs*`: Subgraph Service application that process payments,
127-
route to graph-node and create attestations.
128-
- `*indexer-tap-agent*`: Tap Agent application which process receipts into
129-
RAVs and mark them as ready to be redeemed.
130-
- `indexer-watcher`: Alternative to [eventuals](https://github.com/edgeandnode/eventuals) that
131-
uses `tokio::sync::watch` as main primitive.
132-
- `test-assets`: Assets used in test to generate allocations, wallets, receipts, etc.
108+
The TAP Agent is an actor-based system powered by [ractor](https://crates.io/crates/ractor). It is responsible for processing receipts into RAVs and marking them ready for redemption.
133109

110+
#### Key Features
111+
- **Receipt Processing:** Handles receipts stored by `indexer-service-rs`, performing aggregation and RAV generation.
112+
- **Concurrency Management:** Leverages the actor model to efficiently manage receipt processing tasks.
134113

135114

115+
## Crates
136116

117+
| Crate Name | Description |
118+
|--------------------------|----------------------------------------------------------------------------------------------|
119+
| `indexer-allocation` | Shared structs and logic related to subgraph allocations in The Graph. |
120+
| `indexer-attestation` | Provides tools for generating and verifying attestations for requests and responses. |
121+
| `indexer-config` | Parses shared configuration used by both `indexer-service-rs` and `indexer-tap-agent`. |
122+
| `indexer-dips` | (WIP) Library for managing DIPS (Distributed Indexing Payment System). |
123+
| `indexer-monitor` | Monitors subgraphs through polling and updates shared state with reactive components. |
124+
| `indexer-query` | Type-safe GraphQL queries, leveraging [graphql-client](https://github.com/graphql-rust/graphql-client). |
125+
| `indexer-service-rs` | Subgraph service application that handles payments, routes queries to graph-node, and creates attestations. |
126+
| `indexer-tap-agent` | Processes receipts into RAVs (Redeemable Aggregate Values) and marks them as ready for redemption. |
127+
| `indexer-watcher` | An alternative to [eventuals](https://github.com/edgeandnode/eventuals), built on `tokio::sync::watch`. |
128+
| `test-assets` | Provides assets for testing, such as generating allocations, wallets, and receipts. |
129+
130+
131+
## Additional Documentation
132+
133+
- [Routes Documentation](./docs/Routes.md): Comprehensive list of available routes and their descriptions.
134+
- [Queries Documentation](./docs/Queries.md): Examples of queries you can perform with `indexer-service-rs`.
135+
- [Metrics Documentation](./docs/Metrics.md): Detailed documentation of all Prometheus metrics exposed by the service.

0 commit comments

Comments
 (0)