You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently service.rs contains a mostly unimplemented Service on the server side. The tower Service abstraction is convenient for both clients and servers, so a client should be easy to implement for a single peer.
Once implemented, dialing a node should look something like this:
The client should also make p2p requests more ergonomic. For example rather than dealing with peer message channels directly, we should have the following UX for making requests:
// using From<Vec<[u8; 32]>> for GetPooledTransactionslet txs_request:GetPooledTransactions = vec![
hex!("c05a9eda51dd448c79e1dda1c79a3835c82c1142104f88adc1a64ec80fd193fb"),
hex!("2fa4c5912523f735581cc731a9d44870fbb45cc3cbfb529d643b5aaca112beda"),
hex!("3f855459086213a3def40270ee1c6e12aba7f5f81375ca35cdcd8e71e7a9b092"),
].into();// a lower-level way to make a request, using the `Service` trait, still not badlet request = Request::GetPooledTransactions(RequestPair{request_id:1,message: txs_request,});let response = peer.call(request).await.unwrap();// another possible way to make a request// if using the `Service` under the hood the implementation of this method should be very easylet txs_response = peer.get_pooled_transactions(txs_request).await.unwrap();
The text was updated successfully, but these errors were encountered:
Currently
service.rs
contains a mostly unimplementedService
on the server side. The towerService
abstraction is convenient for both clients and servers, so a client should be easy to implement for a single peer.Once implemented, dialing a node should look something like this:
The client should also make p2p requests more ergonomic. For example rather than dealing with peer message channels directly, we should have the following UX for making requests:
The text was updated successfully, but these errors were encountered: