public BitcoinDaemon(RPCEndpointSettings settings) { Logger.Log("Bitcoin", "Initializing daemon..."); EndpointSettings = settings; EndpointCredentials = new CredentialCache(); EndpointCredentials.Add(new Uri(settings.EndpointAddress), "Basic", new NetworkCredential(settings.RPCUsername, settings.RPCPassword)); // execute a sample RPC call to ensure that the daemon works correctly MakeRequest <double>("getdifficulty"); Logger.Log("Bitcoin", "Daemon initialized"); }
/// <summary> /// Creates an instance of a Monero wallet daemon and opens the default merchant wallet. If the merchant wallet does not exist, it is by default created. /// </summary> /// <param name="settings">Daemon endpoint settings.</param> public MoneroDaemon(RPCEndpointSettings settings) { Logger.Log("Monero", "Initializing daemon..."); LastRefreshTick = -1; // disable refreshing EndpointSettings = settings; EndpointCredentials = new CredentialCache(); EndpointCredentials.Add(new Uri(settings.EndpointAddress), "Digest", new NetworkCredential(settings.RPCUsername, settings.RPCPassword)); OpenMerchantWallet(); LastRefreshTick = 0; // enable refreshing + refresh on the next API call Logger.Log("Monero", "Daemon initialized"); }