blockchain icon indicating copy to clipboard operation
blockchain copied to clipboard

Can't get to nodes to communicate on the same chain

Open JimiPedros opened this issue 6 years ago • 3 comments

Hi there, when I try setup 2 nodes I cannot get them to operate on the same chain.

Does anyone have a solution to this?

JimiPedros avatar Apr 06 '18 09:04 JimiPedros

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

LiuFangLu avatar Apr 17 '18 09:04 LiuFangLu

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.

LiuFangLu avatar Apr 19 '18 02:04 LiuFangLu

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?

alex-manutd avatar Nov 17 '18 15:11 alex-manutd