예제 #1
0
        public SqlDataStorage(SQLiteStorageContext storageContext)
        {
            this._storageContext = storageContext;

            connSemaphore.Do(() =>
            {
                if (Interlocked.Increment(ref connCount) == 1)
                {
                    conn = OpenConnection();
                    CreateDatabase();
                }
            });
        }
예제 #2
0
        public SqlDataStorage(SQLiteStorageContext storageContext)
        {
            this._storageContext = storageContext;

            connSemaphore.Do(() =>
            {
                if (Interlocked.Increment(ref connCount) == 1)
                {
                    conn = OpenConnection();
                    CreateDatabase();
                }
            });
        }
예제 #3
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;
            }
        }
예제 #4
0
 public BlockHeaderStorage(SQLiteStorageContext storageContext)
     : base(storageContext)
 {
 }
예제 #5
0
 public BlockHeaderStorage(SQLiteStorageContext storageContext)
     : base(storageContext)
 {
 }
예제 #6
0
 public ChainedBlockStorage(SQLiteStorageContext storageContext)
     : base(storageContext)
 {
 }
예제 #7
0
 public KnownAddressStorage(SQLiteStorageContext storageContext)
     : base(storageContext)
 {
 }
예제 #8
0
 public BlockchainStorage(SQLiteStorageContext storageContext)
 {
     this.dbFolderPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), @"BitSharp");
     this._storageContext = storageContext;
 }
예제 #9
0
 public BlockTransactionsStorage(SQLiteStorageContext storageContext)
     : base(storageContext)
 {
 }
예제 #10
0
 public BlockTransactionsStorage(SQLiteStorageContext storageContext)
     : base(storageContext)
 {
 }
예제 #11
0
 public ChainedBlockStorage(SQLiteStorageContext storageContext)
     : base(storageContext)
 {
 }
예제 #12
0
 public BlockchainStorage(SQLiteStorageContext storageContext)
 {
     this.dbFolderPath    = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), @"BitSharp");
     this._storageContext = storageContext;
 }