bcoin-org / bcoin

Javascript bitcoin library for node.js and browsers
https://bcoin.io
Other
3.02k stars 809 forks source link

Expected only peer-to-peer public port enabled by default #568

Open braydonf opened 6 years ago

braydonf commented 6 years ago

Versions

bcoin v1.0.2

Expected

For there to only be one public peer-to-peer port opened by default. Ports that are not intended to be public are disabled by default, and thus awareness of them is explicit, and difficult to ignore or overlook. The private node and wallet ports require configuration for the api-key anyways.

Actual

There are three ports opened by default:

  1. peer-to-peer network
  2. http node server
  3. wallet server
pinheadmz commented 5 years ago

bcoin ports are discussed on https://bcoin.io/api-docs and https://github.com/bcoin-org/bcoin/blob/master/docs/Configuration.md, even Bitcoin Core uses port 8332 for RPC commands -- how do you think we should address this better? Better docs? Or should we actually launch the node with all the API ports closed unless the user specifically configures them?

braydonf commented 5 years ago

Yeah, I think only network p2p port should be enabled by default, cover the common use case of running network node.

The http/rpc node and wallet ports can be enabled as defined by a configuration file, which can be enabled or disabled based on what the default of the particular config. It's more clear, especially as these are administrative, and can trigger behavior such as rescans and sending funds.