SimpleCoin icon indicating copy to clipboard operation
SimpleCoin copied to clipboard

Add new peer nodes dynamically

Open cosme12 opened this issue 7 years ago • 3 comments

Apart from having a few hard coded nodes, there should be a simple system that add new trusted peer nodes.

cosme12 avatar Jan 14 '18 18:01 cosme12

Something simple:

peers = []
nodes = initial_nodes
while len(peers) < number_of_peers_needed: # keep going till you find your peers
     new_nodes = [] # recreate list of nodes to check
     For node in nodes: # for each of those nodes
        if random.random() < .1: # randomly pick those to add as a peer
            peers.append(node) 
        else: # if you don't pick that node, check all of their peers
            new_nodes.append( node.peers() )
     nodes = new_nodes

I can submit a pull request for this

kennethgoodman avatar Jan 22 '18 04:01 kennethgoodman

*dynamically

Abdur-rahmaanJ avatar Feb 25 '18 19:02 Abdur-rahmaanJ

I also think this should be added, like it works with bitcoin.

ghost avatar Aug 08 '19 22:08 ghost