-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Are 2 ports necessary? #14
Comments
Websockets are needed. Although you can query the network via http but how will you broadcast to the network when you add a block. Constantly querying the network will be a very bad solution. |
There is a web socket functionality in express. This will allow you to
share the same project between http and ws.
I am not saying to not use web sockets...
Thanks
Le sam. 18 nov. 2017 à 23:08, Abhishek Deora <[email protected]> a
écrit :
… Websockets are needed. Although you can query the network via http but how
will you broadcast to the network when you add a block. Constantly querying
the network will be a very bad solution.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#14 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AALqXSGKFGuKp4K4QcG7eHmZZ1K1-AkWks5s31VzgaJpZM4PZu1N>
.
|
There is clear separation of concerns between the different ports. The P2P port is for only peer to peer communication with other nodes. This port should be public to internet as other nodes should be able to connect to your node. The other port (HTTP_PORT) is used only for controlling the node. It should not be public to the internet and only the user of the node should be able to access it. This same kind of "architetcture" is used in all of the "well-known" blockchain implementations I know of (Bitcoin, Ethereum, Litecoin etc.) |
@adeora7 you have |
You can pass the http server app to the ws server and have it all work under 1 port. Is it purposely made to use 2 ports and why?
On second thought, why are websockets used at all? You can query the network via http, this will make the program even simpler and with less code which as I see is the main concern in this repo?
The text was updated successfully, but these errors were encountered: