Closed Luis-omega closed 1 year ago
For now, we are thinking of using a server and client in both the Leader
and Users
, some options for this are:
use of purescript-httpure for servers and purescript-request for clients
Same as before but using purescript-servant to bundle together client and server.
As the last option but write our own servant
module.
Look for a package that already does all this and is updated, the more up-to-date (2 years ago) I found is purescript-payload
Update:
We choose to use payload
and queue
for the work.
I'm in the process of rewriting the interface, for that purpose I wrote this :
leader
to process the action, currently named UserAction a
, and the other one is the information for the server to send later responses, like IP and port. Also, the user put some information related in a pool of actions sent to the server.UserAction a
together with the information to reach later the user in a queue of pending processing actions.next round priority queue
, takes the actions there and puts them in the currently processing
array.currently processing
array. chain
of transactions, we can have errors trying to process an action, in that case, we should find the information of the user that sent the action and notify the error (or maybe just discard the action and make the user the one that must contact leader?) . Then the remainder of the chain is built.recovering from errors in the chain
protocol. recovering from errors in the chain
protocol.pending for confirmation
in case the user accepts it.recovering from errors in the chain
protocol. recovering from errors in the chain
protocol. If we have a chain [ .., a_n,...]
built and some error makes invalid the a_n
, we discard the a_n
related info, then we query the original request of the rest of the chain a_(n+1), a_(n+2)...
and put it in a next round priority queue
.
Once #24 is ready (or even before that), we must begin to implement it, this is a place to discuss how we are going to do it.My current thoughts are towards using https://pursuit.purescript.org/packages/purescript-queue/8.0.2 to handle the pending request on both Leader and Users. I also think that we would send back-and-forth JSONs that could also be encoded in CBOR or something like that (some advice here is pretty appreciated).The current task is split across the following tasks :
27
28
30