Exemple #1
0
 public SqlDataStorage(FirebirdStorageContext storageContext)
 {
     var dbFolderPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "BitSharp");
     this.dbPath = Path.Combine(dbFolderPath, "BitSharp.fdb");
     this.connString = @"ServerType=1; DataSource=localhost; Database={0}; Pooling=true; MaxPoolSize=100; User=SYSDBA; Password=NA;".Format2(this.dbPath);
     this._storageContext = storageContext;
 }
Exemple #2
0
        public MainWindow()
        {
            try
            {
                //TODO
                //MainnetRules.BypassValidation = true;
                //MainnetRules.BypassExecuteScript = true;
                ScriptEngine.BypassVerifySignature = true;

#if SQLITE
                var storageContext = new SQLiteStorageContext();
                var knownAddressStorage = new BitSharp.Storage.SQLite.KnownAddressStorage(storageContext);
                this.storageContext = storageContext;
#elif FIREBIRD
                var storageContext = new FirebirdStorageContext();
                var knownAddressStorage = new BitSharp.Storage.Firebird.KnownAddressStorage(storageContext);
                this.storageContext = storageContext;
#elif SQL_SERVER
                var storageContext = new SqlServerStorageContext();
                var knownAddressStorage = new BitSharp.Storage.SqlServer.KnownAddressStorage(storageContext);
                this.storageContext = storageContext;
#endif

                this.cacheContext = new CacheContext(this.storageContext);
                this.rules = new MainnetRules(this.cacheContext);
                this.blockchainDaemon = new BlockchainDaemon(this.rules, this.cacheContext);
                this.localClient = new LocalClient(LocalClientType.MainNet, this.blockchainDaemon, knownAddressStorage);

                // setup view model
                this.viewModel = new MainWindowViewModel(this.blockchainDaemon);

                InitializeComponent();

                // start the blockchain daemon
                this.blockchainDaemon.Start();

                this.viewModel.ViewBlockchainLast();

                // start p2p client
                this.localClient.Start();

                this.DataContext = this.viewModel;
            }
            catch (Exception e)
            {
                Debug.WriteLine(e);
                throw;
            }
        }
 public BlockHeaderStorage(FirebirdStorageContext storageContext)
     : base(storageContext)
 {
 }
 public BlockTransactionsStorage(FirebirdStorageContext storageContext)
     : base(storageContext)
 {
 }
 public TransactionStorage(FirebirdStorageContext storageContext)
     : base(storageContext)
 {
 }
 public ChainedBlockStorage(FirebirdStorageContext storageContext)
     : base(storageContext)
 {
 }
 public BlockchainStorage(FirebirdStorageContext storageContext)
 {
     this.dbFolderPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), @"BitSharp");
     this._storageContext = storageContext;
 }
 public TransactionStorage(FirebirdStorageContext storageContext)
     : base(storageContext)
 {
 }