Giter Club home page Giter Club logo

Comments (7)

Sanix-Darker avatar Sanix-Darker commented on May 26, 2024 2

Exactly @olojzyg, an alternative strategy, is to except registring the current node_address in the list of peers, that's how i resolved that problem in my case to avoid the loop that @GaganSuneja mentioned up there.

So for each updates on the current list of peers, verify if the current host is in and remove it.

from python_blockchain_app.

satwikkansal avatar satwikkansal commented on May 26, 2024

Hey, thanks for the issue.

I'm not able to see why it'd run into an infinite loop? because the chain is being called again for the peers, not for the node itself.

from python_blockchain_app.

satwikkansal avatar satwikkansal commented on May 26, 2024

I hope it's resolved. Closing it due to inactivity, feel free to open that up just in case you feel necessary :)

from python_blockchain_app.

olojzyg avatar olojzyg commented on May 26, 2024

Hi satwikkansal,
If we register a new node, using your guide:
curl -X POST
http://127.0.0.1:8001/register_with
-H 'Content-Type: application/json'
-d '{"node_address": "http://127.0.0.1:8000"}'
8001 will update itself in this function register_with_existing_node()... So the peers set in node 8001 include itself...
Because node 8000 return 8001 as its peers...

from python_blockchain_app.

olojzyg avatar olojzyg commented on May 26, 2024

@Sanix-Darker @satwikkansal
Another loop in two nodes system, node 8000 and node 8001:

  1. node 8001 consensus() call its peer node 8000 /chain
  2. node 8000 /chain call consensus()
  3. node 8000 consensus() call its peer node 8001 /chain
  4. loop......

from python_blockchain_app.

Sanix-Darker avatar Sanix-Darker commented on May 26, 2024

@olojzyg it's after a mining, that we can have a consenus() and if the chain in two side are the same there is no need to continue the process.

from python_blockchain_app.

catman85 avatar catman85 commented on May 26, 2024

@Sanix-Darker Could you please explain how you resolved the issue with details? I don't get it.

from python_blockchain_app.

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.