Skip to content

Commit

Permalink
Merge pull request #420 from CoiniumServ/develop
Browse files Browse the repository at this point in the history
v0.1.5 release
  • Loading branch information
Hüseyin Uslu committed Sep 5, 2014
2 parents 2ae178c + 147b6e9 commit b836f29
Show file tree
Hide file tree
Showing 40 changed files with 767 additions and 421 deletions.
25 changes: 25 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,28 @@
##### [v0.1.5 alpha](https://github.com/CoiniumServ/CoiniumServ/releases/tag/v0.1.5-alpha) - 05.09.2014

**Payments**
* Fixed a bug in hybrid-storage layer where blocks were not correctly set as confirmed once they were actually so.

**Web**
* Fixed a bug in embedded web-server where some users were not able to use the interface.
* Updated web-site tempaltes which reflects newest API changes.

**Storage**
* Fixed a bug in migration-manager where if it couldn't connect to MySQL would cause program to crash & terminate.

**API**
* Improved pool API.

**Pools**
* Pools can now determine if connection to coin network is healthy.
* Fixed hashrate calculation bug.

**Jobs**
* JobTracker can now clean expired jobs.

**Configuration**
* Moved config.json "website:stats" section to upper level and renamed as "statistics". You have to apply the change to your existing config.json file!

##### [v0.1.4 alpha](https://github.com/CoiniumServ/CoiniumServ/releases/tag/v0.1.4-alpha) - 03.09.2014

**Storage**
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ You can send tips and furher support the project or get tips for contributing by

### Status

[v0.1.4 alpha](https://github.com/CoiniumServ/CoiniumServ/releases/tag/v0.1.4-alpha) released
[v0.1.5 alpha](https://github.com/CoiniumServ/CoiniumServ/releases/tag/v0.1.5-alpha) released

### Features

Expand Down Expand Up @@ -122,7 +122,7 @@ CoiniumServ supports storage layer interfaces that you can extend to implement y
* __MPOS Layer__: a compatibility layer based on mysql that supports MPOS whenever you want payments to be handled by MPOS.

###### Development Model
* Strictly [follows](https://github.com/CoiniumServ/CoiniumServ/tree/develop/src/Tests) the [Test Driven Development](http://en.wikipedia.org/wiki/Test-driven_development) model. We have implemented extensive [tests](https://github.com/CoiniumServ/CoiniumServ/tree/develop/src/Tests) for all important functionality and never merge in code that breaks tests and stuff. Yet again, when a new functionality is introduced we also expect proper tests to be implemented within the PR. In simple words, most probably you won't notice any functionality-breaking changes within the repository.
* We have implemented extensive [tests](https://github.com/CoiniumServ/CoiniumServ/tree/develop/src/Tests) for all important functionality and never merge in code that breaks tests and stuff. Yet again, when a new functionality is introduced we also expect proper tests to be implemented within the PR. In simple words, most probably you won't notice any functionality-breaking changes within the repository.
* A strict ruleset for the [Development Model](https://github.com/CoiniumServ/CoiniumServ/wiki/Development-Model). You can follow our bleeding-edge [Develop](https://github.com/CoiniumServ/CoiniumServ) branch or stay with-in the stable [Master](https://github.com/CoiniumServ/CoiniumServ/tree/master) branch.


Expand Down
23 changes: 12 additions & 11 deletions src/CoiniumServ/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,12 @@
<section name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
</sectionGroup>
</configSections>

<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
<appSettings>
<add key="webPages:Enabled" value="false" />
</appSettings>
<system.web.webPages.razor>
<pages pageBaseType="Nancy.ViewEngines.Razor.NancyRazorViewBase">
<namespaces>
<add namespace="Nancy.ViewEngines.Razor" />
</namespaces>
</pages>
</system.web.webPages.razor>


<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
Expand All @@ -26,4 +19,12 @@
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
<appSettings>
<add key="webPages:Enabled" value="false" />
</appSettings><system.web.webPages.razor>
<pages pageBaseType="Nancy.ViewEngines.Razor.NancyRazorViewBase">
<namespaces>
<add namespace="Nancy.ViewEngines.Razor" />
</namespaces>
</pages>
</system.web.webPages.razor></configuration>
5 changes: 3 additions & 2 deletions src/CoiniumServ/CoiniumServ.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -211,9 +211,9 @@
<Compile Include="Pools\BlocksCache.cs" />
<Compile Include="Pools\IBlocksCache.cs" />
<Compile Include="Server\Web\Models\ApiModel.cs" />
<Compile Include="Statistics\INetworkStats.cs" />
<Compile Include="Pools\INetworkInfo.cs" />
<Compile Include="Pools\IPoolConfig.cs" />
<Compile Include="Pools\NetworkStats.cs" />
<Compile Include="Pools\NetworkInfo.cs" />
<Compile Include="Container\Registries\StorageRegistry.cs" />
<Compile Include="Server\Web\IBackendConfig.cs" />
<Compile Include="Server\Web\Models\CurrentRoundModel.cs" />
Expand Down Expand Up @@ -848,6 +848,7 @@
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="packages.config" />
<None Include="web.config" />
<None Include="web\default\api.cshtml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
Expand Down
5 changes: 4 additions & 1 deletion src/CoiniumServ/Configuration/ConfigManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,18 @@
using CoiniumServ.Logging;
using CoiniumServ.Pools;
using CoiniumServ.Server.Web;
using CoiniumServ.Statistics;
using CoiniumServ.Utils.Helpers.IO;
using Serilog;

namespace CoiniumServ.Configuration
{
public class ConfigManager:IConfigManager
{
public IStackConfig StackConfig { get; private set; }
public IStatisticsConfig StatisticsConfig { get; private set; }
public IWebServerConfig WebServerConfig { get; private set; }
public ILogConfig LogConfig { get; private set; }
public IStackConfig StackConfig { get; private set; }
public List<IPoolConfig> PoolConfigs { get; private set; }

private const string GlobalConfigFilename = "config/config.json"; // global config filename.
Expand Down Expand Up @@ -76,6 +78,7 @@ private void ReadGlobalConfig()
}

StackConfig = new StackConfig(data.stack);
StatisticsConfig = new StatisticsConfig(data.statistics);
WebServerConfig = new WebServerConfig(data.website);
LogConfig = new LogConfig(data.logging);
}
Expand Down
7 changes: 5 additions & 2 deletions src/CoiniumServ/Configuration/IConfigManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,20 @@
using CoiniumServ.Logging;
using CoiniumServ.Pools;
using CoiniumServ.Server.Web;
using CoiniumServ.Statistics;

namespace CoiniumServ.Configuration
{
public interface IConfigManager
{
IStackConfig StackConfig { get; }

IStatisticsConfig StatisticsConfig { get; }

IWebServerConfig WebServerConfig { get; }

ILogConfig LogConfig { get; }

IStackConfig StackConfig { get; }

List<IPoolConfig> PoolConfigs { get; }

void Initialize();
Expand Down
7 changes: 2 additions & 5 deletions src/CoiniumServ/Container/Registries/ClassRegistry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,15 @@ public ClassRegistry(IApplicationContext applicationContext)

public void RegisterInstances()
{
// pool
// per-pool objects
_applicationContext.Container.Register<IPool, Pool>().AsMultiInstance();
_applicationContext.Container.Register<IDaemonClient, DaemonClient>().AsMultiInstance();
_applicationContext.Container.Register<IJobTracker, JobTracker>().AsMultiInstance();
_applicationContext.Container.Register<IPaymentProcessor, PaymentProcessor>().AsMultiInstance();
_applicationContext.Container.Register<IBlockProcessor, BlockProcessor>().AsMultiInstance();
_applicationContext.Container.Register<INetworkStats, NetworkStats>().AsMultiInstance();
_applicationContext.Container.Register<INetworkInfo, NetworkInfo>().AsMultiInstance();
_applicationContext.Container.Register<IBlocksCache, BlocksCache>().AsMultiInstance();

// statistics
_applicationContext.Container.Register<IStatisticsManager, StatisticsManager>().AsSingleton();

// config
_applicationContext.Container.Register<IPoolConfig, PoolConfig>().AsMultiInstance();
_applicationContext.Container.Register<ICoinConfig, CoinConfig>().AsMultiInstance();
Expand Down
15 changes: 10 additions & 5 deletions src/CoiniumServ/Container/Registries/ManagerRegistry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
using CoiniumServ.Miners;
using CoiniumServ.Pools;
using CoiniumServ.Shares;
using CoiniumServ.Statistics;
using CoiniumServ.Vardiff;

namespace CoiniumServ.Container.Registries
Expand All @@ -44,16 +45,20 @@ public ManagerRegistry(IApplicationContext applicationContext)

public void RegisterInstances()
{
// global singleton managers.
_applicationContext.Container.Register<IPoolManager, PoolManager>().AsSingleton();
_applicationContext.Container.Register<IConfigManager, ConfigManager>().AsSingleton();
_applicationContext.Container.Register<IStatisticsManager, StatisticsManager>().AsSingleton();
_applicationContext.Container.Register<ILogManager, LogManager>().AsSingleton();
_applicationContext.Container.Register<IMetricsManager, MetricsManager>().AsSingleton();

// per-pool managers
_applicationContext.Container.Register<IShareManager, ShareManager>().AsMultiInstance();
_applicationContext.Container.Register<IMinerManager, MinerManager>().AsMultiInstance();
_applicationContext.Container.Register<IJobManager, JobManager>().AsMultiInstance();
_applicationContext.Container.Register<IMinerManager, MinerManager>().AsMultiInstance();
_applicationContext.Container.Register<IPoolManager, PoolManager>().AsSingleton();
_applicationContext.Container.Register<IVardiffManager, VardiffManager>().AsMultiInstance();
_applicationContext.Container.Register<IBanManager, BanManager>().AsMultiInstance();
_applicationContext.Container.Register<IConfigManager, ConfigManager>().AsSingleton();
_applicationContext.Container.Register<ILogManager, LogManager>().AsSingleton();
_applicationContext.Container.Register<IMetricsManager, MetricsManager>().AsSingleton();
_applicationContext.Container.Register<IBanManager, BanManager>().AsMultiInstance();
}
}
}
2 changes: 0 additions & 2 deletions src/CoiniumServ/Container/Registries/StorageRegistry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,9 @@
//
#endregion
using CoiniumServ.Container.Context;
using CoiniumServ.Persistance;
using CoiniumServ.Persistance.Layers;
using CoiniumServ.Persistance.Layers.Empty;
using CoiniumServ.Persistance.Layers.Hybrid;
using CoiniumServ.Persistance.Layers.Hybrid.Migrations;
using CoiniumServ.Persistance.Layers.Mpos;
using CoiniumServ.Persistance.Providers;
using CoiniumServ.Persistance.Providers.MySql;
Expand Down
49 changes: 23 additions & 26 deletions src/CoiniumServ/Factories/IObjectFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,21 +51,17 @@ namespace CoiniumServ.Factories
/// </summary>
public interface IObjectFactory
{
#region hash algorithms
#region global objects
IPoolManager GetPoolManager();

/// <summary>
/// Returns instance of the given hash algorithm
/// </summary>
/// <param name="algorithm"></param>
/// <returns></returns>
IHashAlgorithm GetHashAlgorithm(string algorithm);
IStatisticsManager GetStatisticsManager();

ILogManager GetLogManager();

#endregion

#region pool objects

IPoolManager GetPoolManager();

IPool GetPool(IPoolConfig poolConfig);

/// <summary>
Expand All @@ -76,10 +72,9 @@ public interface IObjectFactory

IMinerManager GetMinerManager(IPoolConfig poolConfig, IStorageLayer storageLayer);

IJobManager GetJobManager(IPoolConfig poolConfig, IDaemonClient daemonClient, IJobTracker jobTracker, IShareManager shareManager,
IMinerManager minerManager, IHashAlgorithm hashAlgorithm);
IJobManager GetJobManager(IPoolConfig poolConfig, IDaemonClient daemonClient, IJobTracker jobTracker, IShareManager shareManager, IMinerManager minerManager, IHashAlgorithm hashAlgorithm);

IJobTracker GetJobTracker();
IJobTracker GetJobTracker(IPoolConfig poolConfig);

IShareManager GetShareManager(IPoolConfig poolConfig, IDaemonClient daemonClient, IJobTracker jobTracker, IStorageLayer storageLayer, IBlockProcessor blockProcessor);

Expand All @@ -91,26 +86,26 @@ IJobManager GetJobManager(IPoolConfig poolConfig, IDaemonClient daemonClient, IJ

IVardiffManager GetVardiffManager(IPoolConfig poolConfig, IShareManager shareManager);

INetworkStats GetNetworkStats(IDaemonClient daemonClient);

IAlgorithmManager GetAlgorithmManager(IPoolManager poolManager);
INetworkInfo GetNetworkInfo(IDaemonClient daemonClient, IHashAlgorithm hashAlgorithm, IPoolConfig poolConfig);

IBlocksCache GetBlocksCache(IStorageLayer storageLayer);

IStatisticsManager GetStatisticsManager();

#endregion
IMiningServer GetMiningServer(string type, IPoolConfig poolConfig, IPool pool, IMinerManager minerManager, IJobManager jobManager,IBanManager banManager);

#region server & service objects
IRpcService GetMiningService(string type, IPoolConfig poolConfig, IShareManager shareManager, IDaemonClient daemonClient);

IMiningServer GetMiningServer(string type, IPoolConfig poolConfig, IPool pool, IMinerManager minerManager, IJobManager jobManager,
IBanManager banManager);
#endregion

IRpcService GetMiningService(string type, IPoolConfig poolConfig, IShareManager shareManager, IDaemonClient daemonClient);
#region hash algorithms

IWebServer GetWebServer();
/// <summary>
/// Returns instance of the given hash algorithm
/// </summary>
/// <param name="algorithm"></param>
/// <returns></returns>
IHashAlgorithm GetHashAlgorithm(string algorithm);

INancyBootstrapper GetWebBootstrapper();
IAlgorithmManager GetAlgorithmManager(IPoolManager poolManager);

#endregion

Expand All @@ -124,9 +119,11 @@ IMiningServer GetMiningServer(string type, IPoolConfig poolConfig, IPool pool, I

#endregion

#region other objects
#region web-server objects

ILogManager GetLogManager();
IWebServer GetWebServer();

INancyBootstrapper GetWebBootstrapper();

IMetricsManager GetMetricsManager();

Expand Down
Loading

0 comments on commit b836f29

Please sign in to comment.