-
Notifications
You must be signed in to change notification settings - Fork 267
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
Add UPnP support for peer discovery. Resolves #1036 #1073
Closed
Closed
Conversation
This file contains 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
This is to match MultiTrieStore constructor semantic
…disk Increase current epoch value read from disk
End 1.1.0 development cycle
Improving remasc blocks retrieval; removing unused BlockStore method
Merge 1.1.0 into master
…ropy change random source in tests
I'm going to resubmit this PR with a cleaner commit history. |
There is a new PR here: #1088 |
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.
Feature description:
UPnP is toggleable by the config property
peer.discovery.upnp_enabled
and is enabled by default.If automatic port mapping fails, a log message notifies the user to enable UPnP on their router, or disable UPnP in the node conf and forward router ports manually.
Any automatic port mapping created via UPnP on the router is deleted upon node shutdown.
Implementation notes:
The
UpnpService
is injected intoUDPServer
as anOptional
which is present if the service was enabled in the conf. This is the only service using UPnP right now.There are three TCP services running:
Web3WebSocketServer
,Web3HttpServer
,PeerServerImpl
. All three of these services are configurable with different network interfaces/local addresses, each of which could be connected to unique WAN gateways. IfUpnpService
was injected into these server objects, it could handle the port mapping easily. But that is out of scope for this ticket.Code coverage is 95.6% because two unit tests were deleted which required PowerMockito, which is not supported by SonarQube. Neither unit test was important (extraneous Exception handling unrelated to functionality of the code).
TODO:
There is a new dependency on the weUPnP library, see rsksmart/reproducible-builds#19. The
build.gradle
dependency is currently using the SHA hash of the public repo, but should be switched to that of the reproducible build when it is ready.