Code Monkey home page Code Monkey logo

Comments (3)

LiuFangLu avatar LiuFangLu commented on May 22, 2024

change if not self.valid_proof(last_block['proof'], block['proof'], last_block['previous_hash']) to if not self.valid_proof(last_block['proof'], block['proof'], block['previous_hash']), try again

from blockchain.

LiuFangLu avatar LiuFangLu commented on May 22, 2024

i have only one computer,so I create two ports 5000 and 5100 simulate two computer, copy the python file to two, change they port to 5000 and 5100,now we have two address(mine is http://127.0.0.1:5000/ and http://127.0.0.1:5100/) use /nodes/register api to register one address to anther address, now when you add new block, use /nodes/resolve api to synchronization the blockchain ,now you can see they use the same blockchain.

from blockchain.

alex-manutd avatar alex-manutd commented on May 22, 2024

I'm a bit wishy washy here still. If I set up two nodes, both running blockchain.py on the same LAN, and perform /transaction/new, /mine and /chain in both directions from both nodes both using Postman, when I register the nodes with each other then resolve, will the shorter chain and its contained blocks and transactions be discarded?

from blockchain.

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.