Exemplo n.º 1
0
        /// <summary>
        /// Generates alpha server settings
        /// </summary>
        /// <returns>Settings object</returns>
        public static AlphaSettings GetAlphaSettings()
        {
            var settings = new AlphaSettings();

            SetCommonSettings(settings, TestEnvironment.AlphaKeyPair.SecretSeed);
            settings.ConnectionString = "mongodb://localhost:27001/alphaDBTest?replicaSet=centaurus";
            settings.Build();
            return(settings);
        }
Exemplo n.º 2
0
        private AlphaSettings GetAlphaSettings()
        {
            var kp            = KeyPair.Random();
            var alphaSettings = new AlphaSettings
            {
                AlphaPort         = 5000,
                HorizonUrl        = HorizonUrl,
                NetworkPassphrase = NetworkPassphrase,
                Secret            = kp.SecretSeed,
                SyncBatchSize     = 500
            };

            alphaSettings.Build();
            return(alphaSettings);
        }
        public void Setup()
        {
            var dbName     = "testDB";
            var replicaSet = "centaurusTest";
            var dbPort     = 27001;

            MongoDBServerHelper.RunMongoDBServers(new int[] { dbPort }, replicaSet);

            var extensionsPath = ExtensionConfigGenerator.Generate(dbPort, dbName, replicaSet, banPeriod, boostFactor);

            var settings = new AlphaSettings();

            settings.ExtensionsConfigFilePath = Path.GetFullPath(extensionsPath);
            settings.ConnectionString         = $"mongodb://localhost:{dbPort}/{dbName}?replicaSet={replicaSet}";
            settings.HorizonUrl        = "https://horizon-testnet.stellar.org";
            settings.NetworkPassphrase = "Test SDF Network ; September 2015";
            settings.CWD    = "AppData";
            settings.Secret = TestEnvironment.AlphaKeyPair.SecretSeed;

            settings.Build();

            GlobalInitHelper.Setup(GlobalInitHelper.GetPredefinedClients(), GlobalInitHelper.GetPredefinedAuditors(), settings, new MongoStorage());
        }