Open utkarshg6 opened 5 months ago
I do root for what was roughed out in the premier comment. (Maybe because I was leading the effort to design it this way - look at it, what an awesome example of human vanity haha)
Back to work... I'm here as I just brushed some of these thoughts off and on my journey seeking this card I stumbled a couple of times over some other cards at least distantly resembling these. And so I'd like to mention them:
https://github.com/MASQ-Project/MASQ-Node-issues/issues/712 https://github.com/MASQ-Project/MASQ-Node-issues/issues/549 https://github.com/MASQ-Project/MASQ-Node-issues/issues/458
and perhaps more...
A partial solution to eliminate the need of restarting the Node while Generating/Recovering Wallets during the Node startup is to redefine the trigger of the startup of
Neighborhood
andAccountant
.This could be achieved using an already in use message called
StartMessage
.This message is used for two unrelated purposes. 1) After the
ActorSystemFactory
has finished binding all the Actors withBindMessage
, it sends aStartMessage
to theNeighborhood
so that it can start trying to connect the new Node to the Network. 2) After theNeighborhood
is successfully connected to the Network well enough to begin routing messages, theNeighborhood
sends anotherStartMessage
to theAccountant
, which uses the StartMessage as a signal to begin running its regular scans.These sequence of events can be understood as:
We can modify this sequence of events so that the ActorSystemFactory sends a message to the Configurator, and then the Configurator sends another message to the Accountant.
This sequencing allows the Configurator to verify whether wallets are present or not.
The new sequence of events can be understood as:
The Configurator performs this check using information provided by
BootstrapperConfig
. Here’s how it works:1)
BootstrapperConfig
preparesConfiguratorConfig
, indicating whether wallets are present or not. 2) If wallets are present in theConfiguratorConfig
, the Configurator immediately sends a message to theNeighborhood
upon receiving theStartMessage
. If wallets are not present, it notifies the user to generate/recover wallets and waits for the user to complete this action.Note: There's another idea that we haven't discussed much about. It involves building a separate utility to generate/recover wallet.