public BlockCoreNodeIntegration(Settings settings, IContextFactory contextFactory, FatalErrorNotifier fatalNotifier)
        {
            var apiUrl         = settings.ConfigReader.GetOrDefault <string>("apiUrl", "http://127.0.0.1:48334/");
            var walletName     = settings.ConfigReader.GetOrDefault <string>("walletName", "walletName");
            var walletPassword = settings.ConfigReader.GetOrDefault <string>("walletPassword", "walletPassword");
            var useSegwit      = settings.ConfigReader.GetOrDefault <bool>("useSegwit", true);

            this.contextFactory   = contextFactory;
            this.settings         = settings;
            this.cancellation     = new CancellationTokenSource();
            this.logger           = LogManager.GetCurrentClassLogger();
            this.fatalNotifier    = fatalNotifier;
            this.blockCoreNodeAPI = new BlockCoreNodeAPI(apiUrl, walletName, walletPassword, AccountName, this.settings.NetworkFee, useSegwit);
        }
        public BlockCoreNodeIntegration(IOptionsMonitor <TipBotSettings> options, IContextFactory contextFactory, FatalErrorNotifier fatalNotifier)
        {
            this.settings = options.CurrentValue;

            //var apiUrl = settings.ApiUrl; // settings.ConfigReader.GetOrDefault<string>("apiUrl", "http://127.0.0.1:48334/");
            //var walletName = settings.WalletName; // .ConfigReader.GetOrDefault<string>("walletName", "walletName");
            //var walletPassword = settings.WalletPassword; // .ConfigReader.GetOrDefault<string>("walletPassword", "walletPassword");
            //var useSegwit = settings.UseSegwit; // .ConfigReader.GetOrDefault<bool>("useSegwit", true);

            this.contextFactory   = contextFactory;
            this.cancellation     = new CancellationTokenSource();
            this.logger           = LogManager.GetCurrentClassLogger();
            this.fatalNotifier    = fatalNotifier;
            this.blockCoreNodeAPI = new BlockCoreNodeAPI(this.settings, AccountName);
        }
Beispiel #3
0
        public RPCNodeIntegration(Settings settings, IContextFactory contextFactory, FatalErrorNotifier fatalNotifier)
        {
            var daemonUrl   = settings.ConfigReader.GetOrDefault <string>("daemonUrl", "http://127.0.0.1:23521/");
            var rpcUsername = settings.ConfigReader.GetOrDefault <string>("rpcUsername", "user");
            var rpcPassword = settings.ConfigReader.GetOrDefault <string>("rpcPassword", "pass");
            var rpcRequestTimeoutInSeconds = settings.ConfigReader.GetOrDefault <short>("rpcTimeout", 20);

            this.walletPassword = settings.ConfigReader.GetOrDefault <string>("walletPassword", "walletpass");

            this.coinService    = new BitcoinService(daemonUrl, rpcUsername, rpcPassword, this.walletPassword, rpcRequestTimeoutInSeconds);
            this.contextFactory = contextFactory;
            this.settings       = settings;
            this.cancellation   = new CancellationTokenSource();
            this.logger         = LogManager.GetCurrentClassLogger();
            this.fatalNotifier  = fatalNotifier;
        }