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 receive data and handle response mechanism - Closes #896 and #981 #1022

Closed jondubois closed 5 years ago

jondubois commented 5 years ago

What was the problem?

How did I fix it?

Implemented a request/message event bubbling mechanism. Socket requests/messages bubble up the class hierarchy Socket -> Peer -> PeerPool -> P2P. There exists certain request/message types which are meant to be handled internally by the P2P module. If a class within this hierarchy sees a reserved request which is relevant to it; it will respond to the request with the appropriate data and this request will not propagate to parent instances.

How to test it?

Integration tests coming soon.

Review checklist

jondubois commented 5 years ago

Rebased to resolve conflicts.