Skip to content
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
wants to merge 17 commits into from

Conversation

CoeJoder
Copy link

@CoeJoder CoeJoder commented Nov 5, 2019

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 into UDPServer as an Optional 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. If UpnpService 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.

Diego López León and others added 5 commits October 4, 2019 17:24
@gitcoinbot gitcoinbot mentioned this pull request Nov 5, 2019
@CoeJoder
Copy link
Author

CoeJoder commented Nov 8, 2019

I'm going to resubmit this PR with a cleaner commit history.

@CoeJoder CoeJoder closed this Nov 8, 2019
@CoeJoder CoeJoder deleted the upnp_support branch November 8, 2019 16:00
@CoeJoder
Copy link
Author

CoeJoder commented Nov 8, 2019

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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants