Skip to content
This repository has been archived by the owner on Oct 27, 2024. It is now read-only.

Tower Services #11

Open
plebhash opened this issue May 29, 2024 · 1 comment
Open

Tower Services #11

plebhash opened this issue May 29, 2024 · 1 comment

Comments

@plebhash
Copy link
Member

Tower

plebpool leverages the tower crate and its ecosystem.

tower-test crate is used to assert Towers work as expected.

main.rs is responsible for waiting on these two tokio::task::JoinHandle handles:

  • LnTower::serve()?
  • PoolTower::serve()?

All plebpool logic is handled asyncrhonously inside these two main tasks.

LN Service Tower

struct LnChannelManagerService { ... }
struct LnPaymentService { ... }

impl tower::Service<LnChannelManagerRequest> for LnChannelManagerService { ... }
impl tower::Service<LnPaymentRequest> for LnPaymentService { ... }

struct LnTower {
  ln_channel_manager_service: LnChannelManagerService,
  ln_payment_service: LnPaymentService,
}

Pool Service Towers

struct Sv1MiningChannelService { ... }
struct Sv2MiningChannelService { ... }
struct JobDeclaratorService { ... }
struct TemplateReceiverService { ... }

impl tower::Service<Sv1MiningChannelRequest> { ... }
impl tower::Service<Sv2MiningChannelRequest> { ... }
impl tower::Service<JobDeclarationRequest> { ... }
impl tower::Service<TemplateReceiverRequest> { ... }

struct PoolTower {
  sv1_mining_channels_service: Sv1MiningChannelService,
  sv2_mining_channels_service: Sv2MiningChannelService,
  job_declarator_service: JobDeclaratorService,
  template_receiver_service: TemplateReceiverService
}
@plebhash
Copy link
Member Author

Current Status:

there's a draft of Sv1MiningChannelService inside src/pool/service/sv1_mining_channel_service.rs (ln-pool-tower branch).

the idea there is to get the TcpListener to receive and decode Sv2Frame objects.

development is being driven around

RUST_LOG=debug cargo watch -c -x t

while unit tests leverage tower_test

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant