feat: refactor store api into separate services#932
Conversation
crates/store/src/server/api.rs
Outdated
| // CLIENT ENDPOINTS | ||
| // -------------------------------------------------------------------------------------------- | ||
| #[tonic::async_trait] | ||
| impl api_server::Api for StoreApi { | ||
| // CLIENT ENDPOINTS | ||
| // -------------------------------------------------------------------------------------------- | ||
|
|
||
| impl rpc_server::Rpc for StoreApi { |
There was a problem hiding this comment.
Should we move this (and the other two similar impls) into separate files? For example, instead of a single api.rs file, we'd have something like:
src/server/rpc_api.rssrc/server/ntx_builder.rssrc/server/block_producer.rs
Maybe we should do this in stages? First logically separate the services and then in the next PR make them work on different addresses? |
Agree, we can do the different addresses in a follow-up PR |
Mirko-von-Leipzig
left a comment
There was a problem hiding this comment.
Just some really minor nits; I didn't do a deep review of the method impls - I assume they're just copies of the original impls.
Addresses part of #918
This PR refactors the Store API to separate it into three APIs: RPC, BlockProducer, NtxBuilder.
For follow up PR:
The three services are being hosted on one single tonic server, it's probably better to serve them separately on 3 different addresses. This would need to update the store config.