static void Main(string[] args) { if (args.Length < 1 || !uint.TryParse(args[0], out var numNodes)) { numNodes = 4; } Console.WriteLine("Building Application..."); var compiler = new ApplicationCompiler(); compiler.AddService <BankTestsService>(); var compiled = compiler.Compile(numNodes); Console.WriteLine("Building Host..."); var deploymentTimestamp = DateTime.UtcNow; var emulator = new EmulatorHost.Emulator($"bank/emulator/{deploymentTimestamp:o}", deploymentTimestamp); Console.WriteLine("Starting Host..."); emulator.Run(compiled); Console.WriteLine("Done (hit enter to terminate)..."); Console.ReadLine(); emulator.Shutdown(); }
static void Main(string[] args) { Console.WriteLine("Building Application..."); var compiler = new ApplicationCompiler(); uint numberProcesses = 5; uint workersPerProcess = 2; compiler .AddService <MinerService>() .AddBuildStep(serviceBuilder => serviceBuilder.OnFirstStart( new SearchJob() { Target = 100007394059441.GetHashCode(), Start = 100000000000000, Count = 10000000000, NumberWorkers = numberProcesses * workersPerProcess })) ; var application = compiler.Compile(numberProcesses); Console.WriteLine("Building Host..."); var deploymentTimestamp = DateTime.UtcNow; var emulator = new EmulatorHost.Emulator($"miner/emulator/{deploymentTimestamp:o}", deploymentTimestamp); Console.WriteLine("Starting Host..."); emulator.Run(application); Console.WriteLine("Done (hit enter to terminate)..."); Console.ReadLine(); emulator.Shutdown(); }
static void Main(string[] args) { if (args.Length < 1 || !uint.TryParse(args[0], out var numNodes)) { numNodes = 4; } var configuration = new EmulatorHost.Configuration() { MultiThreaded = true, ApplicationLogLevel = LogLevel.Trace, RuntimeLogLevel = LogLevel.Trace, FileLogLevel = LogLevel.Trace, LocalLogDirectory = "C:\\logs\\", }; var loggingConfig = new ReactiveMachine.LoggingConfiguration() { //SendLogLevel = LogLevel.Trace, //LockLogLevel = LogLevel.Trace }; Console.WriteLine("Building Application..."); var compiler = new ApplicationCompiler(); compiler.AddService <BankTestsService>(); compiler.AddBuildStep(sb => sb .SetConfiguration(configuration) .SetConfiguration(loggingConfig)); var compiled = compiler.Compile(numNodes); Console.WriteLine("Building Host..."); var deploymentTimestamp = DateTime.UtcNow; var emulator = new EmulatorHost.Emulator($"bank/emulator/{deploymentTimestamp:o}", deploymentTimestamp); Console.WriteLine("Starting Host..."); emulator.Run(compiled); Console.WriteLine("Done (hit enter to terminate)..."); Console.ReadLine(); emulator.Shutdown(); }
static void Main(string[] args) { Console.WriteLine("Building Application..."); var compiler = new ApplicationCompiler(); compiler.AddService <PingPongService>(); var application = compiler.Compile(2); Console.WriteLine("Starting Host..."); var deploymentTimestamp = DateTime.UtcNow; var emulator = new EmulatorHost.Emulator($"pingpong/emulator/{deploymentTimestamp:o}", deploymentTimestamp); emulator.Run(application); Console.WriteLine("Done (hit enter to terminate)..."); Console.ReadLine(); emulator.Shutdown(); }
static void Main(string[] args) { var compiler = new ApplicationCompiler(); Console.WriteLine("Setting configuration objects..."); compiler.SetConfiguration(new HelloWorldTestConfiguration() { NumberRepetitions = 100 }); compiler.SetConfiguration(new ReactiveMachine.TelemetryBlobWriter.Configuration() { CollectHostEvents = true, CollectApplicationEvents = true, CollectThroughput = false, }); Console.WriteLine("Building Application..."); compiler.AddService <HelloWorldTestService>(); Console.WriteLine("Compiling Application..."); var compiledApplication = compiler.Compile(numberProcesses: 1); Console.WriteLine("Building Host..."); var deploymentTimestamp = DateTime.UtcNow; var deploymentId = $"helloworld/emulator/{deploymentTimestamp:o}"; var emulator = new EmulatorHost.Emulator(deploymentId, deploymentTimestamp); Console.WriteLine("Starting Host..."); emulator.Run(compiledApplication); Console.WriteLine("Done (hit enter to terminate)..."); Console.ReadLine(); emulator.Shutdown(); }