Coder Social home page Coder Social logo

Comments (13)

macsnoeren avatar macsnoeren commented on July 18, 2024 1

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.

jordyvanraalte avatar jordyvanraalte commented on July 18, 2024 1

Okay count me in! Will take a look later today.

from python-p2p-network.

macsnoeren avatar macsnoeren commented on July 18, 2024

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.

jordyvanraalte avatar jordyvanraalte commented on July 18, 2024

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.

macsnoeren avatar macsnoeren commented on July 18, 2024

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.

jordyvanraalte avatar jordyvanraalte commented on July 18, 2024

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.

macsnoeren avatar macsnoeren commented on July 18, 2024

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.

macsnoeren avatar macsnoeren commented on July 18, 2024

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.

jordyvanraalte avatar jordyvanraalte commented on July 18, 2024

I have added a pull request that adds the length based protocol. #32

from python-p2p-network.

macsnoeren avatar macsnoeren commented on July 18, 2024

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.

jordyvanraalte avatar jordyvanraalte commented on July 18, 2024

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.

macsnoeren avatar macsnoeren commented on July 18, 2024

Hi Jordy,when should we do a teams meeting on blockchain? Br. Maurice

from python-p2p-network.

macsnoeren avatar macsnoeren commented on July 18, 2024

Ik sluit deze ;).

from python-p2p-network.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.