private NetworkOperator(CustomNetworkType networkType = CustomNetworkType.Regtest, string rpcUrl = "http://localhost:8339", string rpcUserName = "******", string rpcPassword = "******") { this.Init(networkType, rpcUrl, rpcUserName, rpcPassword); }
private void Init(CustomNetworkType networkType, string rpcUrl, string rpcUserName, string rpcPassword) { if (networkType == CustomNetworkType.Mainnet) { this.Network = Network.Main; } if (networkType == CustomNetworkType.Testnet) { this.Network = Network.TestNet; } if (networkType == CustomNetworkType.Regtest) { this.Network = Network.RegTest; } this.Credential = new NetworkCredential(rpcUserName, rpcPassword); this.RpcUri = new Uri(rpcUrl); }
public void ChangeNetwork(CustomNetworkType networkType, string rpcUrl, string rpcUserName, string rpcPassword) { this.Init(networkType, rpcUrl, rpcUserName, rpcPassword); BTCOperator.Instance.ChangeNetwork(Credential, RpcUri, Network); USDTOperator.Instance.ChangeNetwork(Credential, RpcUri, Network); }