Comments (13)
Hi Jordy, nice that you are interested in this framework. Feel free to use the framework which is tested. Feel also free to implement another way for communication based on length of the package. Off course you could implement some kind of protocol. However, originally this framework has been designed to communicate something like JSON. Later Samuel has added the possiblity to send dict, str and bin over the line. So, if you would like to improve it further that would be very nice.
Furthermore, I am planning a new large update of the framework using plugins. Adding functionality and using functionality implemented by other will become much easier then.
from python-p2p-network.
Okay count me in! Will take a look later today.
from python-p2p-network.
I was looking into your package. Why did you not use the framework instead of copy the code? Eventually the framework is intended to be used simply to create peer-to-peer network applications. I also started a blockchain (https://github.com/macsnoeren/python-blockchain) using this framework. You can have a look in their what I mean. If you are going to use the framework from pip, then you could also join this opensource project :). Do you miss something in the framework? I am interested because the aim is to provide an easy to use framework when someone would like to start with peer-to-peer network applications. -- Happy Kingsday!
from python-p2p-network.
Hey Maurice,
I wanted to study how to make a Peer-To-Peer network myself based on your code, so I decided to type it over. I adjusted the code a bit for myself so that it is easier to understand. Besides that, I implemented a length protocol since I think it's better to indicate the length of a message than using a delimiter as I mentioned in my first comment and also mentioned in the official Python documentation for the socket class:
https://docs.python.org/3/howto/sockets.html
"But if you plan to reuse your socket for further transfers, you need to realize that there is no EOT on a socket. I repeat: if a socket send or recv returns after handling 0 bytes, the connection has been broken. If the connection has not been broken, you may wait on a recv forever, because the socket will not tell you that there’s nothing more to read (for now). Now if you think about that a bit, you’ll come to realize a fundamental truth of sockets: messages must either be fixed in length (yuck), be delimited (shrug), or indicate how long they are (much better), or end by shutting down the connection. The choice is entirely yours, (but some ways are righter than others)."
I am aiming to implement a blockchain myself for self-study and to provide an educational basis for my colleagues and fellow students based on Bitcoin however I'm willing to help on the open-source project.
Happy Kingsday! (sadly, we don't celebrate Kingsday here in Sweden)
from python-p2p-network.
I do know that the implementation of the socket can be much better ;). It is nice to study this technology and the approach is fine off course. I was hoping on your participating to implement an improved socket communication version.
It is interesting, because the p2pnetwork aim is education as well. Students have used this framework to understand peer-to-peer and blockchain technology. It is part of the module Blockchain 1 and 2.
You need to turn Sweden orange ;). Success and maybe I will see some pull-request in the future ;).
from python-p2p-network.
I will do a pull request after I have tested it a bit more :). If you need any help on the course, I'm willing to help as long the repositories are open source. You can reach me by email on my profile if you need to provide me with more information.
Besides, is it possible that you can provide me with the slides of the Blockchain course? Here in Sweden I can't take a Blockchain course.
from python-p2p-network.
Although I have limited time, I am aiming to create a Ethereum like blockchain in python based on this framework, https://github.com/macsnoeren/python-blockchain. That means that it is possible to also create smartcontracts and NFTs for example. This opensource project would be to educate on how smartcontracts and NFTs are implemented. Showing that the technology is very promosing. If you would like to join forces than I can help you to understand blockchain technology and we can implement an blockchain together. Just give it a thought :).
from python-p2p-network.
I have added this is enhancement. It would be nice if a communication protocol is implemented to create more robust communication. The send and receive functions shall still be able to send dict, str and bin. What goes in comes out at the other end. Length based, so it is easier to see when pipes are broken or any other error has occurred, Within this branch it is designed and implemented.
from python-p2p-network.
I have added a pull request that adds the length based protocol. #32
from python-p2p-network.
Thanks! I have reviewed the pull request and found some possible issues. Could you have a look? If required, we could have a chat. We can also plan a meeting, so I could give you an introduction to the blockchain technology.
from python-p2p-network.
I looked into it and commented on it, will work on it in the beginning of June. I'm available for a meeting, mail me on [email protected]
from python-p2p-network.
Hi Jordy,when should we do a teams meeting on blockchain? Br. Maurice
from python-p2p-network.
Ik sluit deze ;).
from python-p2p-network.
Related Issues (20)
- I have question about the "nodeconnection.py" HOT 1
- I have link question between "node.py" and "nodeconnection.py" HOT 2
- Pip3 version is out of date and unstable HOT 2
- how HOT 1
- how to HOT 1
- how to use send_to_node api? HOT 2
- Import "p2pnetwork.node" could not be resolved HOT 1
- Connect to a node already connected to HOT 3
- Bug in connect_with_node function in node.py HOT 2
- implementing compression to transfer large files over socket. HOT 11
- Change to Tox testing suite HOT 3
- New feature: Plugins HOT 4
- Issue: unit test test_node_max_connections failed HOT 2
- Info about node discovery HOT 3
- Possible vulnerability on the node unique ID HOT 2
- OS Error when stopping nodes HOT 1
- Non UTF-8 messages will throw exception
- Crash if node id malformed HOT 1
- Unit tests do work on Windows ... not on Linux 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 python-p2p-network.