Esempio n. 1
0
 public EwbfMiner(IMinerLog log, String path, String name, EwbfConfiguration configuration)
     : base(log)
 {
     this.path          = path;
     this.name          = name;
     this.configuration = configuration;
 }
        public IActionResult Enable(Guid rigId, String id)
        {
            var resource = GPUs.SingleOrDefault(x => x.Id == id);

            if (resource == null)
            {
                return(this.NotFound());
            }

            resource.IsEnabled = true;

            var miner = Miners.GetOrAdd(id, x =>
            {
                var log = new FileMinerLog($"C:\\Applications\\Motherlode\\logs\\Miners\\{id}.log");

                var config = new EwbfConfiguration
                {
                    CudaDevices = new List <Device>
                    {
                        new Device
                        {
                            Id        = 0,
                            Intensity = 64
                        }
                    },
                    TempuratureLimit         = 80,
                    TempuratureScale         = TempuratureScale.Celcius,
                    CalculatePowerEfficiency = true,
                    LogLevel = 1,
                    LogFile  = "miner.log",
                    Servers  = new List <StratumServer>
                    {
                        new StratumServer
                        {
                            Address  = "us1-zcash.flypool.org",
                            Port     = 3333,
                            Username = "******",
                            Password = "******"
                        },
                        new StratumServer
                        {
                            Address  = "equihash.usa.nicehash.com",
                            Port     = 3357,
                            Username = "******",
                            Password = "******"
                        }
                    }
                };

                return(new EwbfMiner(log, @"C:\Users\chaws\Desktop\Mining\ZEC\EWBF\0.3.4b 2", id.ToString(), config));
            });

            if (miner.IsRunning)
            {
                return(this.BadRequest());
            }

            miner.Start();

            return(Ok());
        }