Repository: OpenMined/PySyft

Issue:
Does the framework support IPv6 networks?
Is this framework suitable for IPv6 network environment? 


Discussion:
Maybe @IonesioJunior @cereallarceny can provide some insight here?
This issue has been marked stale because it has been open 30 days with no activity. Leave a comment or remove the `stale` label to unmark it. Otherwise, this will be closed in 7 days.
I have checked this in 0.3.0 and it seems while the Flask server runs in IPV6 the sy.duet() joining function fails to connect.
We will investigate further.
This issue has been marked stale because it has been open 30 days with no activity. Leave a comment or remove the `stale` label to unmark it. Otherwise, this will be closed in 7 days.
I would like to work on this issue. I have only recently started exploring PySyft so I may need some hint or help to get started.
Could you assign this to me?
@rajatrc1705 Your help would be greatly appreciated. I would do the following:
- Run the local network signaling server with:
```
$ syft-network
```
- Start jupyter notebooks and load up any example like MNIST or even a basic connection
- Connect via your local network server using the instructions here: https://github.com/OpenMined/PySyft/tree/master/examples/duet/#host-a-network
```
duet = sy.launch_duet(network_url="http://127.0.0.1:5000")
```

Then once its working, modify the script and the code to get it working over IPV6.

Please note however, people often offer to help with issues but never get around to submitting a PR, as such if there is no Draft PR showing some initial attempt after a week, then if someone else wants to take this issue I will have to reassign it. I hope you can understand. If you have any questions feel free to ping me on Slack.
Thank you. Yes, I will make sure to keep you informed about my progress on this issue. 

Resolving patch:
diff --git a/src/syft/grid/example_nodes/network.py b/src/syft/grid/example_nodes/network.py
--- a/src/syft/grid/example_nodes/network.py
+++ b/src/syft/grid/example_nodes/network.py
@@ -9,6 +9,7 @@
 """
 # stdlib
 import os
+import sys
 
 # third party
 import flask
@@ -77,15 +78,25 @@ def process_network_msgs() -> flask.Response:
 
 def run() -> None:
     global network
-    print("====================================")
-    print("========== NODE ROOT KEY ===========")
-    print("====================================")
+
+    IP_MODE = os.getenv("IP_MODE", "IPV4")  # default to ipv4
+    if len(sys.argv) > 1:
+        IP_MODE = sys.argv[1]
+
+    IP_MODE = "IPV6" if IP_MODE == "IPV6" else "IPV4"
     # this signing_key is to aid in local development and is not used in the real
     # PyGrid implementation
+    HOST = "0.0.0.0" if IP_MODE == "IPV4" else "::"  # nosec
     PORT = os.getenv("PORT", 5000)
-    print(f"Starting Node on PORT: {PORT}")
+
+    print("====================================")
+    print("========== NODE ROOT KEY ===========")
+    print("====================================")
     print(network.signing_key.encode(encoder=HexEncoder).decode("utf-8"), "\n")
-    app.run(host="0.0.0.0", port=int(PORT))  # nosec
+
+    print(f"Using {IP_MODE} and listening on port {PORT}")
+
+    app.run(host=HOST, port=int(PORT))
 
 
 run()


Test patch: