-
Notifications
You must be signed in to change notification settings - Fork 29
feat(p2p): add ability to update peer_id.json with SIGUSR1 #981
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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
cccfe88
to
adc0191
Compare
df90865
to
83e2aca
Compare
@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. |
ea94b70
to
e91f983
Compare
e91f983
to
b9abf07
Compare
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
hostname
commandGet and manually set the full node's hostname. Entrypoints will automatically reflect this change, and connections will be reset.
Sysctl
refresh_auto_hostname
commandAutomatically set the hostname to an auto discovered one. Entrypoints will automatically reflect this change, and connections will be reset.
Sysctl
reload_entrypoints_and_connections
commandReload the
peer_id.json
file, replacing the entrypoints list with the new one. Then, connections will be reset.SIGUSR1
commandThis is just a shortcut to the sysctl
reload_entrypoints_and_connections
command.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.json
file path to thePeerId
class, with thereload_entrypoints_from_source_file()
method.hostname
, refreshing the auto hostname, and resetting all connections.peer_id.json
reload inSIGUSR1
.Checklist
master
, confirm this code is production-ready and can be included in future releases as soon as it gets merged