-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feat.Req] TAP Agent gRPC API #84
Comments
From @Jannis #83 (comment):
|
We had discussed something like: service {
rpc ContinuityCheck(ContinuityRequest) ContinuityResponse;
rpc SubmitReceipt(SubmitReceiptRequest) ContinuityResponse;
rpc SubmitVoucher(SubmitReceiptRequest) ContinuityResponse;
}
message ContinuityRequest {
strong payer_address = 1;
}
message ContinuityResponse {
uint64 remaining_collateral = 2; // on-chain collateral with all the vouchers and additional receipts I've received.
}
message SubmitReceiptRequest {
bytes tap_payload_for_a_receipt = 1;
}
message SubmitVoucherRequest {
bytes tap_payload_for_a_voucher = 1;
} in our other post here: streamingfast/firehose-core#18 We don't need to submit receipts? Is there another path that's already taken into account with a different protocol in the TAP agent already? |
@abourget Right now, the design is that there is a component that would live inside the Firehose Indexer Service that writes receipts and vouchers straight to the database, so the My thinking now is the following:
My recommendation would be to write the latter two in Rust, since we can then use existing functionality to create receipts, discover indexers in the network (both on the client side) as well as handle receipts, store them in the database etc. (client side). I can put some documentation together for what these pieces are that we can use for this. |
I would assume that he who owns the component chooses how and with what language to build it. Having the database interactions behind the TAP agent would be a nice way to split responsibilities, and ownership. In our original design, the voucher stuff was completely opaque and transitive to the indexer service. A better segregation of responsibilities I think. |
No user needs access to tap-agent currently. If anyone building new data services needs sync communication, we can reopen it. |
Problem statement
For facilitating payments for Firehose and Substreams data, we will need to extend the functionality of TAP agent as described in this issue. Note: The bold parts in the use case description are what require new TAP agent functionality.
This assumes that indexers will run e.g. a Firehose Indexer Service that consumers will open a connection with in order to exchange TAP receipts and RAVs. This service will need to know when to request an RAV from a consumer and when to stop serving them.
Unlike with gateways that have a public endpoint to send RAV requests to, the only way to get RAVs from consumers is by "talking" to them directly. We therefore envision roughly the following architecture for this:
How does this work in practice?
Proposal
We propose that TAP agent serves a gRPC API for Firehose Indexer Services but also Subgraph Indexer Services to connect to. This API could look as follows:
Using this, different indexer service implementations can:
The subgraph indexer service could use this by periodically checking the payer status for all gateways it has interacted with. If a RAV is required for any of them, it could then send that request to their aggregator endpoint. This way, TAP agent would not need to know anything about gateways and their URLs.
The Firehose indexer service could use this by periodically checking the payer status for all consumers that have a payment connection open with the indexer. It can forward RAV requests to them via these payment connections.
Alternative considerations
Additional context
The text was updated successfully, but these errors were encountered: