Comments (5)
To add new kind of connection (ipv6 or i2p) we need to modify these:
- Incoming PEX request: https://github.com/HelloZeroNet/ZeroNet/blob/master/src/File/FileRequest.py#L267
- Sending PEX request: https://github.com/HelloZeroNet/ZeroNet/blob/master/src/Peer/Peer.py#L239
- Packing peers: https://github.com/HelloZeroNet/ZeroNet/blob/master/src/util/helper.py#L77
+ Modify AnnounceZero and Bootstrapper plugin to store and send new kind of peer addresses.
So it's not extendable easily...
from documentation.
I made a pull request (#64) and it is merged. The PEX packet is much more flexible than I expect. Let me propose the PEX encoding for IPv6 addresses and Next-generation onion services.
IPv6 address in PEX: A packed IPv6 address is an element in the peers
list. It is (16+2) bytes long. The last two bytes are the port number.
Next-generation (v3) onion address in PEX: A next-generation onion address is an element in the peers_onion
list. It is (35+2) bytes long. The address is b32-decoded, so that it can be represented in 35 bytes instead of 56 bytes. The last 2 bytes are the port number.
You can vote below. If this gets enough votes, we can make this spec official.
Recipe for parsing and packing IPv6 addresses (Python 3)
>>> import ipaddress
>>> ipaddress.IPv6Address
<class 'ipaddress.IPv6Address'>
>>> ipv6 = ipaddress.IPv6Address("::1")
>>> ipv6.packed
b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01'
>>> len(ipv6.packed)
16
>>> ipaddress.IPv6Address(ipv6.packed)
IPv6Address('::1')
>>> ipv4 = ipaddress.IPv4Address('8.8.8.8')
>>> ipv4.packed
b'\x08\x08\x08\x08'
>>> len(ipv4.packed)
4
from documentation.
Sounds great for me. Still have to decide if we should pack next-gen onion addresses to "peers_onion" node and ipv6 ones to "peers" or separate ones.
Probably it's easier to use the current ones, but we need to take care about backward compatibility issues. (checking client's version before sending new-style addresses to them)
from documentation.
Does ZeroNet put onion peers in PEX requests? There should be a peers_onion
field in the request.
https://zeronet.readthedocs.io/en/latest/help_zeronet/network_protocol/#pex-site-peers-need
from documentation.
Yes, thanks, added!
from documentation.
Related Issues (20)
- Is Documentation accessible to everyone ? HOT 1
- Description of PoW based ID providers needed HOT 1
- Missing logo on english documentation HOT 5
- Support Chinese Search HOT 1
- Code example for signing content.json HOT 1
- Namecoin example should be updated HOT 1
- Documentation of Multiuser plugin
- Document the different types of ZeroFrame responses (in WebSocket)
- Make JavaScript the default for examples HOT 1
- Document feeds section of content.json
- How does Zeronet work with Tor? HOT 2
- Namecoin buy tip not work anymore
- Broken link in FAQ HOT 1
- Instructions to use with Tor Browser in the FAQ are out of date HOT 1
- [INF] Working on Italian version HOT 3
- Update the faq ZH version
- MORE SCREENSHOTS on Intro Page Leads to 404 HOT 1
- tor section is outdated HOT 2
- Zeronet with Tor on Linux - more universal and work instructions
- build documentation fails HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from documentation.