feat(p2p): add ability to update peer_id.json with SIGUSR1#981
Merged
feat(p2p): add ability to update peer_id.json with SIGUSR1#981
Conversation
32beb29 to
968b96c
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #981 +/- ##
=======================================
Coverage 85.10% 85.10%
=======================================
Files 296 296
Lines 22902 22909 +7
Branches 3447 3449 +2
=======================================
+ Hits 19490 19497 +7
- Misses 2728 2732 +4
+ Partials 684 680 -4 ☔ View full report in Codecov by Sentry. |
26f53bc to
3fd7a4d
Compare
jansegre
reviewed
Mar 28, 2024
jansegre
previously approved these changes
Apr 2, 2024
msbrogli
requested changes
Apr 5, 2024
msbrogli
requested changes
Apr 8, 2024
cccfe88 to
adc0191
Compare
df90865 to
83e2aca
Compare
Contributor
Author
|
@msbrogli @jansegre This PR changed considerably, could you please re-review it? The description has been updated to reflect new changes. Also, I ended up not implementing the looping call to refresh the auto hostname, and instead just provided a sysctl command to do it. The reason is that the API is currently blocking. |
glevco
commented
Apr 10, 2024
jansegre
previously approved these changes
Apr 10, 2024
msbrogli
previously approved these changes
Apr 16, 2024
jansegre
previously approved these changes
Apr 16, 2024
msbrogli
previously approved these changes
Apr 16, 2024
ea94b70 to
e91f983
Compare
e91f983 to
b9abf07
Compare
jansegre
approved these changes
Apr 16, 2024
msbrogli
approved these changes
Apr 17, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Implement ability to update the full node public IP while the sync is running, as requested in the issue: resolves https://github.com/HathorNetwork/internal-issues/issues/261.
Here are the new ways of interacting with entrypoints and the hostname:
Sysctl
hostnamecommandGet and manually set the full node's hostname. Entrypoints will automatically reflect this change, and connections will be reset.
Sysctl
refresh_auto_hostnamecommandAutomatically set the hostname to an auto discovered one. Entrypoints will automatically reflect this change, and connections will be reset.
Sysctl
reload_entrypoints_and_connectionscommandReload the
peer_id.jsonfile, replacing the entrypoints list with the new one. Then, connections will be reset.SIGUSR1commandThis is just a shortcut to the sysctl
reload_entrypoints_and_connectionscommand.Acceptance Criteria
CliBuilder.create_peer_id()and addPeerId.create_from_json_path().ConnectionsManager.listen()so it uses the listen deferred and persists the listened addresses.ConnectionsManager.update_hostname_entrypoints()andreset_all_connections().peer_id.jsonfile path to thePeerIdclass, with thereload_entrypoints_from_source_file()method.hostname, refreshing the auto hostname, and resetting all connections.peer_id.jsonreload inSIGUSR1.Checklist
master, confirm this code is production-ready and can be included in future releases as soon as it gets merged