spacemeshos / go-spacemesh

Go Implementation of the Spacemesh protocol full node. 💾⏰💪
https://spacemesh.io
MIT License
748 stars 211 forks source link

Serve API per each NodeID configured / known poets #6174

Open ConvallariaMaj opened 2 months ago

ConvallariaMaj commented 2 months ago

per each POST identity configured / known poets (with some warning if they are missmatched)

pigmej commented 2 months ago

So, we need an endpoint that returns PER IDENTITY:

That will allow users to understand what's the situation with the poets

fasmat commented 2 months ago

That means failed registrations also need to be persisted into the local DB in a way that it makes clear which registrations are valid and which failed. This can probably be easiest achieved by leaving the RoundID field empty and setting the RoundEnd time to what it would have been according to the configuration of the node. When fetching the proofs from PoETs an additional check is needed such that when no RoundID is available it doesn't actually try to query the PoET for the proof.

When returning the current state of the identities if there are any registrations in the DB it should list the registrations with the following information (gathered from DB and config):

This info should in my opinion only be returned if the identity is currently waiting to fetch proofs from PoET, otherwise the current state of the identity should be returned instead: