stratisproject / StratisBitcoinFullNode

Bitcoin full node in C#
https://stratisplatform.com
MIT License
787 stars 312 forks source link

Stratis.StratisD initializes wrong network from .conf file #1355

Closed mikedennis closed 6 years ago

mikedennis commented 6 years ago

If you specify the network in the conf file instead of with command line it will always initialize with Stratis mainnet. Also we should support stratis regtest network as well.

This is an issue with integrating with NBitcoin AltCoin test framework.

dangershony commented 6 years ago

Support regtest from console or config? yeah why not.

I guess the problem is we look at args in stead of ConfigReader

mikedennis commented 6 years ago

Yes might be a bit tricky. NodeSettings would need to know which daemon it's running under to select the right network. Could we use ProtocolVersion == ProtocolVersion.ALT_PROTOCOL_VERSION to determine if should look at Stratis networks instead of Bitcoin ones?

quantumagi commented 6 years ago

The problem is that we are passing the network to the NodeSettings constructor (within StratisD). Once a network is passed in this way it takes precedence over the command line and configuration file.

Simply not passing the network to the constructor, and perhaps doing what @mikedennis is proposing, should leave us with the desired outcome.

See https://github.com/stratisproject/StratisBitcoinFullNode/pull/1384.

mikedennis commented 6 years ago

Yes that works for me thanks!