mosaicnetworks / babble

Distributed Consensus Middleware
MIT License
478 stars 95 forks source link

Add getPublKey function to get public key #142

Closed jonknight73 closed 4 years ago

jonknight73 commented 4 years ago

From a given private key.

When loading an archive, you need to know the current public key - and to make efforts to fix the peers files accordingly. The configuration only saves the private. By exposing this function we can read the private key, get the public key and amend the correct peers entry to match the current network details.

It has become more key with the refactoring to use the same workflow and data structures for archive and live sessions.

arrivets commented 4 years ago

Why do you need to know the public key when loading an archive? I don't understand why it's necessary to amend the peers file when loading an archive. Is it to update the network address? I don't think the network addresses are used when loading from archive in suspended mode.

jonknight73 commented 4 years ago

It is not used directly. However the ResolvedGroup and ResolvedService records which are being used to define the set up for Group - and thus to populate the config files expects the public key to be set. The advantage of using the same structure for Archive is that we can consolidate the binding to the service and launching the node into a single workflow.

  It may be possible not to avoid needing it, but as it was trivial to populate it, it seemed prudent to do so.

  It could be chopped out at a later date, but the initial pass is to make sure as much as possible is populated so if we add functionality we maximise the chances it will work for everything.

  Warm regards,

  Jon

-----Original message----- From: Martin Arrivets Sent: Tuesday, 21st April 2020, 17:24 To: mosaicnetworks/babble Cc: Jonathan Knight; Author Subject: Re: [mosaicnetworks/babble] Add getPublKey function to get public key (#142)

  Why do you need to know the public key when loading an archive? I don't understand why it's necessary to amend the peers file when loading an archive. Is it to update the network address? I don't think the network addresses are used when loading from archive in suspended mode.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.