public MongoDbLedgerTests(ITestOutputHelper output)
        {
            Output = output;
            var logger = new Logger()
            {
                Output = output
            };

            //new Microsoft.Extensions.Logging.Console.ConsoleLoggerProvider((x, y) => y>=Microsoft.Extensions.Logging.LogLevel.Error, true).CreateLogger("Test");
            store = new MongoDbLedger(
                new MongoDbStorageEngineConfiguration
            {
                ConnectionString      = "mongodb://localhost",
                Database              = "tedchaintest",
                ReadLoopDelay         = TimeSpan.FromMilliseconds(50),
                ReadRetryCount        = 10,
                StaleTransactionDelay = TimeSpan.FromMinutes(10),
                RunRollbackThread     = true
            }, logger);
            store.RecordCollection.DeleteMany(x => true);
            store.TransactionCollection.DeleteMany(x => true);
            store.PendingTransactionCollection.DeleteMany(x => true);

            this.Engine  = store;
            this.Queries = store;
            this.Indexes = store;
        }
Ejemplo n.º 2
0
        public MongoDbLedgerTests()
        {
            var store = new MongoDbLedger(
                new MongoDbStorageEngineConfiguration
            {
                ConnectionString      = "mongodb://localhost",
                Database              = "openchaintest",
                ReadLoopDelay         = TimeSpan.FromMilliseconds(50),
                ReadRetryCount        = 10,
                StaleTransactionDelay = TimeSpan.FromMinutes(10),
                RunRollbackThread     = false
            }, null);

            store.RecordCollection.DeleteMany(x => true);
            store.TransactionCollection.DeleteMany(x => true);
            store.PendingTransactionCollection.DeleteMany(x => true);

            this.Engine  = store;
            this.Queries = store;
            this.Indexes = store;
        }
Ejemplo n.º 3
0
        public MongoDbLedgerTests()
        {
            var logger = new Microsoft.Extensions.Logging.Console.ConsoleLoggerProvider((x, y) => true, true).CreateLogger("Test");
            var store = new MongoDbLedger(
                            new MongoDbStorageEngineConfiguration
                            {
                                ConnectionString = "mongodb://localhost",
                                Database = "openchaintest2",
                                ReadLoopDelay = TimeSpan.FromMilliseconds(50),
                                ReadRetryCount = 10,
                                StaleTransactionDelay = TimeSpan.FromMinutes(10),
                                RunRollbackThread = false
                            }, logger);
            store.RecordCollection.DeleteMany(x=>true);
            store.TransactionCollection.DeleteMany(x => true);
            store.PendingTransactionCollection.DeleteMany(x => true);

            this.Engine = store;
            this.Queries = store;
            this.Indexes = store;
        }