-
Notifications
You must be signed in to change notification settings - Fork 76
chore: Circuit relay #3112
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
Merged
Merged
chore: Circuit relay #3112
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
46721c1
circuit relay first commit
Ivansete-status 034b9dc
undo apt install libpcre
Ivansete-status 7fe1057
nat.nim: protect against possible exceptions when calling getExternalIP
Ivansete-status 2fc9637
progress in circuit-relay addition
Ivansete-status f415a98
Minor change to adapt the isRelayClient param description
Ivansete-status 7c30a04
circuit relay progress
Ivansete-status dfe23b4
waku_node: should start waku relay protocol
Ivansete-status b0b48bd
waku factory change to mount circuit hop proto by default
Ivansete-status 8d2fcd3
fix compilation issue in tests
Ivansete-status 3e2a1d5
fix compilation issue
Ivansete-status 7112afc
update tests to use getPrimaryIPAddr
Ivansete-status 748b083
test_app compilation fix
Ivansete-status da6bdc1
builer: rm unnecessary line
Ivansete-status 7e8511c
Update tests/wakunode_rest/test_rest_admin.nim
Ivansete-status 16bdcb0
Update waku/discovery/waku_discv5.nim
Ivansete-status 28f317b
avoid default relay in setupNode proc
Ivansete-status 50905f0
remove leftover unneeded code
Ivansete-status 49771f6
fix nph format issue
Ivansete-status 7af2425
missing import in test_node_factory
Ivansete-status 3f784cc
waku_node: better import of autonat_service
Ivansete-status d69b626
waku: avoid compilation issue
Ivansete-status 16cf26b
waku.nim: protect against possible crash if discv5 is not enabled
Ivansete-status eae4e8b
apply Zoltan suggestion to simplify tests
Ivansete-status File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import | ||
chronos, | ||
chronicles, | ||
bearssl/rand, | ||
libp2p/protocols/connectivity/autonat/client, | ||
libp2p/protocols/connectivity/autonat/service, | ||
libp2p/protocols/connectivity/autonat/core | ||
|
||
const AutonatCheckInterval = Opt.some(chronos.seconds(30)) | ||
|
||
proc getAutonatService*(rng: ref HmacDrbgContext): AutonatService = | ||
## AutonatService request other peers to dial us back | ||
## flagging us as Reachable or NotReachable. | ||
## minConfidence is used as threshold to determine the state. | ||
## If maxQueueSize > numPeersToAsk past samples are considered | ||
## in the calculation. | ||
let autonatService = AutonatService.new( | ||
autonatClient = AutonatClient.new(), | ||
rng = rng, | ||
scheduleInterval = AutonatCheckInterval, | ||
askNewConnectedPeers = false, | ||
numPeersToAsk = 3, | ||
maxQueueSize = 3, | ||
minConfidence = 0.7, | ||
) | ||
|
||
proc statusAndConfidenceHandler( | ||
networkReachability: NetworkReachability, confidence: Opt[float] | ||
): Future[void] {.async.} = | ||
if confidence.isSome(): | ||
info "Peer reachability status", | ||
networkReachability = networkReachability, confidence = confidence.get() | ||
|
||
autonatService.statusAndConfidenceHandler(statusAndConfidenceHandler) | ||
|
||
return autonatService |
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.