LiskArchive / lisk-elements

⚙️ Library for sending Lisk transactions from the client or server
https://lisk.io/
GNU General Public License v3.0
250 stars 64 forks source link

Add a function to connectAndFetch peers to be used in discovery process #1152

Closed ishantiw closed 5 years ago

ishantiw commented 5 years ago

Expected behavior

Discovery should just take IP address and wPort and should be able to connect and fetch peer list independently of Peer object. This will remove the need to create Peer objects for the seed peers just to fetch peer list from them. Also, it will be independent of the peer pool in terms of choosing peers with Peer objects already and could be handled independently.

Actual behavior

Discovery function accepts basic peer info P2PPeerInfo (with only ip and port) and uses connectAndFetch function to connect and fetch a peer list instead of creating Peer object for it. This will also simplify to filter out the black, white and fixed list in the future.