Exemplo n.º 1
0
 private NetworkOperator(CustomNetworkType networkType = CustomNetworkType.Regtest,
                         string rpcUrl      = "http://localhost:8339",
                         string rpcUserName = "******",
                         string rpcPassword = "******")
 {
     this.Init(networkType, rpcUrl, rpcUserName, rpcPassword);
 }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
 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);
 }