Skip to content

Commit 2d4c862

Browse files
author
Hüseyin Uslu
committed
Merge pull request #536 from CoiniumServ/develop
mining.subscribe fix.
2 parents 7ed3d94 + 48574ca commit 2d4c862

File tree

19 files changed

+198
-53
lines changed

19 files changed

+198
-53
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
[submodule "deps/csredis"]
22
path = deps/csredis
33
url = https://github.com/CoiniumServ/csredis.git
4+
[submodule "deps/json-rpc"]
5+
path = deps/json-rpc
6+
url = https://github.com/CoiniumServ/JSON-RPC.NET.git

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,16 @@ Even better multi-pool & auto-exchange module is being developed which once comp
77

88
CoiniumServ was created to be used for [Coinium.org](http://www.coinium.org) mining pool network at first hand. You can check [some of pools](https://github.com/CoiniumServ/CoiniumServ/wiki/Pools) of the pools running CoiniumServ.
99

10+
### Screenshots
11+
12+
##### Console
13+
1014
![CoiniumServ running over mono & ubuntu](http://i.imgur.com/HvaPVrZ.png)
1115

16+
##### Embedded web frontend
17+
18+
![Embedded web frontend](http://i.imgur.com/oOF8lQ0.png)
19+
1220
### Status
1321

1422
Latest release: [v0.2.0 alpha](https://github.com/CoiniumServ/CoiniumServ/releases/tag/v0.2.0-beta)

build/CoiniumServ.sln

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio 2013
4-
VisualStudioVersion = 12.0.30501.0
4+
VisualStudioVersion = 12.0.30723.0
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{02E410C9-83C5-4D63-8902-5AD041EBEB6C}"
77
ProjectSection(SolutionItems) = preProject
@@ -24,6 +24,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CSRedis", "..\deps\csredis\
2424
EndProject
2525
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "libCoiniumServ", "..\src\libCoiniumServ\libCoiniumServ.csproj", "{F908636C-BC75-4B93-A774-E4878F3D39AF}"
2626
EndProject
27+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AustinHarris.JsonRpc", "..\deps\json-rpc\Json-Rpc\AustinHarris.JsonRpc.csproj", "{24FC1A2A-0BC3-43A7-9BFE-B628C2C4A307}"
28+
EndProject
2729
Global
2830
GlobalSection(SolutionConfigurationPlatforms) = preSolution
2931
Debug|Any CPU = Debug|Any CPU
@@ -107,6 +109,24 @@ Global
107109
{F908636C-BC75-4B93-A774-E4878F3D39AF}.Testing|Mixed Platforms.ActiveCfg = Release|Any CPU
108110
{F908636C-BC75-4B93-A774-E4878F3D39AF}.Testing|Mixed Platforms.Build.0 = Release|Any CPU
109111
{F908636C-BC75-4B93-A774-E4878F3D39AF}.Testing|x86.ActiveCfg = Release|Any CPU
112+
{24FC1A2A-0BC3-43A7-9BFE-B628C2C4A307}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
113+
{24FC1A2A-0BC3-43A7-9BFE-B628C2C4A307}.Debug|Any CPU.Build.0 = Debug|Any CPU
114+
{24FC1A2A-0BC3-43A7-9BFE-B628C2C4A307}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
115+
{24FC1A2A-0BC3-43A7-9BFE-B628C2C4A307}.Debug|Mixed Platforms.Build.0 = Debug|x86
116+
{24FC1A2A-0BC3-43A7-9BFE-B628C2C4A307}.Debug|x86.ActiveCfg = Debug|x86
117+
{24FC1A2A-0BC3-43A7-9BFE-B628C2C4A307}.Debug|x86.Build.0 = Debug|x86
118+
{24FC1A2A-0BC3-43A7-9BFE-B628C2C4A307}.Release|Any CPU.ActiveCfg = Release|Any CPU
119+
{24FC1A2A-0BC3-43A7-9BFE-B628C2C4A307}.Release|Any CPU.Build.0 = Release|Any CPU
120+
{24FC1A2A-0BC3-43A7-9BFE-B628C2C4A307}.Release|Mixed Platforms.ActiveCfg = Release|x86
121+
{24FC1A2A-0BC3-43A7-9BFE-B628C2C4A307}.Release|Mixed Platforms.Build.0 = Release|x86
122+
{24FC1A2A-0BC3-43A7-9BFE-B628C2C4A307}.Release|x86.ActiveCfg = Release|x86
123+
{24FC1A2A-0BC3-43A7-9BFE-B628C2C4A307}.Release|x86.Build.0 = Release|x86
124+
{24FC1A2A-0BC3-43A7-9BFE-B628C2C4A307}.Testing|Any CPU.ActiveCfg = Release|Any CPU
125+
{24FC1A2A-0BC3-43A7-9BFE-B628C2C4A307}.Testing|Any CPU.Build.0 = Release|Any CPU
126+
{24FC1A2A-0BC3-43A7-9BFE-B628C2C4A307}.Testing|Mixed Platforms.ActiveCfg = Release|x86
127+
{24FC1A2A-0BC3-43A7-9BFE-B628C2C4A307}.Testing|Mixed Platforms.Build.0 = Release|x86
128+
{24FC1A2A-0BC3-43A7-9BFE-B628C2C4A307}.Testing|x86.ActiveCfg = Release|x86
129+
{24FC1A2A-0BC3-43A7-9BFE-B628C2C4A307}.Testing|x86.Build.0 = Release|x86
110130
EndGlobalSection
111131
GlobalSection(SolutionProperties) = preSolution
112132
HideSolutionNode = FALSE

deps/json-rpc

Submodule json-rpc added at 6669fac

src/CoiniumServ/CoiniumServ.csproj

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,6 @@
4646
<ApplicationIcon>Coinium.ico</ApplicationIcon>
4747
</PropertyGroup>
4848
<ItemGroup>
49-
<Reference Include="AustinHarris.JsonRpc, Version=1.0.4.0, Culture=neutral, processorArchitecture=MSIL">
50-
<SpecificVersion>False</SpecificVersion>
51-
<HintPath>..\..\build\packages\AustinHarris.JsonRpc.1.0.4.18\lib\net40\AustinHarris.JsonRpc.dll</HintPath>
52-
</Reference>
5349
<Reference Include="BouncyCastle.Crypto, Version=1.7.4137.9688, Culture=neutral, PublicKeyToken=a4292a325f69b123, processorArchitecture=MSIL">
5450
<SpecificVersion>False</SpecificVersion>
5551
<HintPath>..\..\build\packages\BouncyCastle.1.7.0\lib\Net40-Client\BouncyCastle.Crypto.dll</HintPath>
@@ -120,11 +116,11 @@
120116
</Reference>
121117
<Reference Include="Serilog, Version=1.4.0.0, Culture=neutral, PublicKeyToken=24c2f752a8e58a10, processorArchitecture=MSIL">
122118
<SpecificVersion>False</SpecificVersion>
123-
<HintPath>..\..\build\packages\Serilog.1.4.9\lib\net45\Serilog.dll</HintPath>
119+
<HintPath>..\..\build\packages\Serilog.1.4.10\lib\net45\Serilog.dll</HintPath>
124120
</Reference>
125121
<Reference Include="Serilog.FullNetFx, Version=1.4.0.0, Culture=neutral, PublicKeyToken=24c2f752a8e58a10, processorArchitecture=MSIL">
126122
<SpecificVersion>False</SpecificVersion>
127-
<HintPath>..\..\build\packages\Serilog.1.4.9\lib\net45\Serilog.FullNetFx.dll</HintPath>
123+
<HintPath>..\..\build\packages\Serilog.1.4.10\lib\net45\Serilog.FullNetFx.dll</HintPath>
128124
</Reference>
129125
<Reference Include="System" />
130126
<Reference Include="System.Core" />
@@ -440,18 +436,18 @@
440436
<Compile Include="Server\Mining\Getwork\GetworkMiner.cs" />
441437
<Compile Include="Pools\PoolConfig.cs" />
442438
<Compile Include="Pools\PoolManager.cs" />
443-
<Compile Include="Server\Mining\Getwork\Service\HttpServiceContext.cs" />
439+
<Compile Include="Server\Mining\Getwork\GetworkContext.cs" />
444440
<Compile Include="Server\Mining\Getwork\GetworkServer.cs" />
445441
<Compile Include="Server\Mining\Getwork\GetworkServerConfig.cs" />
446-
<Compile Include="Server\Mining\Getwork\Service\GetworkService.cs" />
442+
<Compile Include="Server\Mining\Getwork\GetworkService.cs" />
447443
<Compile Include="Mining\IMiner.cs" />
448-
<Compile Include="Server\Mining\Stratum\Service\SocketServiceContext.cs" />
444+
<Compile Include="Server\Mining\Stratum\StratumContext.cs" />
449445
<Compile Include="Server\Commands\Server.cs" />
450446
<Compile Include="Server\Commands\Stats.cs" />
451447
<Compile Include="Server\Commands\Uptime.cs" />
452448
<Compile Include="Server\Commands\Version.cs" />
453449
<Compile Include="Server\Mining\Stratum\StratumMiner.cs" />
454-
<Compile Include="Server\Mining\Stratum\Service\StratumService.cs" />
450+
<Compile Include="Server\Mining\Stratum\StratumService.cs" />
455451
<Compile Include="Daemon\Responses\Getwork.cs" />
456452
<Compile Include="Container\Context\IApplicationContext.cs" />
457453
<Compile Include="Server\Mining\Getwork\HttpServer.cs" />
@@ -957,6 +953,10 @@
957953
<Project>{d35e185e-a7e1-41e1-846c-21944f56074f}</Project>
958954
<Name>CSRedis</Name>
959955
</ProjectReference>
956+
<ProjectReference Include="..\..\deps\json-rpc\Json-Rpc\AustinHarris.JsonRpc.csproj">
957+
<Project>{24fc1a2a-0bc3-43a7-9bfe-b628c2c4a307}</Project>
958+
<Name>AustinHarris.JsonRpc</Name>
959+
</ProjectReference>
960960
<ProjectReference Include="..\libCoiniumServ\libCoiniumServ.csproj">
961961
<Project>{f908636c-bc75-4b93-a774-e4878f3d39af}</Project>
962962
<Name>libCoiniumServ</Name>

src/CoiniumServ/Container/Registries/ServerRegistry.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,8 @@
2424
using CoiniumServ.Container.Context;
2525
using CoiniumServ.Server.Mining;
2626
using CoiniumServ.Server.Mining.Getwork;
27-
using CoiniumServ.Server.Mining.Getwork.Service;
2827
using CoiniumServ.Server.Mining.Service;
2928
using CoiniumServ.Server.Mining.Stratum;
30-
using CoiniumServ.Server.Mining.Stratum.Service;
3129
using CoiniumServ.Server.Web;
3230

3331
namespace CoiniumServ.Container.Registries

src/CoiniumServ/Server/Mining/Getwork/Service/HttpServiceContext.cs renamed to src/CoiniumServ/Server/Mining/Getwork/GetworkContext.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,16 @@
2222
#endregion
2323

2424
using System.Net;
25-
using CoiniumServ.Mining;
2625

27-
namespace CoiniumServ.Server.Mining.Getwork.Service
26+
namespace CoiniumServ.Server.Mining.Getwork
2827
{
29-
public class HttpServiceContext
28+
public class GetworkContext
3029
{
31-
public IMiner Miner { get; private set; }
30+
public IGetworkMiner Miner { get; private set; }
3231

3332
public HttpListenerResponse Response { get; private set; }
3433

35-
public HttpServiceContext(IMiner miner, HttpListenerContext context)
34+
public GetworkContext(IGetworkMiner miner, HttpListenerContext context)
3635
{
3736
Miner = miner;
3837
Response = context.Response;

src/CoiniumServ/Server/Mining/Getwork/GetworkMiner.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
using CoiniumServ.Logging;
3131
using CoiniumServ.Mining;
3232
using CoiniumServ.Pools;
33-
using CoiniumServ.Server.Mining.Getwork.Service;
3433
using CoiniumServ.Utils.Extensions;
3534
using Newtonsoft.Json;
3635
using Serilog;
@@ -97,7 +96,7 @@ public GetworkMiner(int id, IPool pool, IMinerManager minerManager)
9796
var asyncData = ((JsonRpcStateAsync) callback);
9897
var result = asyncData.Result;
9998
var response = Encoding.UTF8.GetBytes(result);
100-
var context = (HttpServiceContext) asyncData.AsyncState;
99+
var context = (GetworkContext) asyncData.AsyncState;
101100

102101
context.Response.ContentType = "application/json";
103102
context.Response.ContentEncoding = Encoding.UTF8;
@@ -125,7 +124,7 @@ public void Parse(HttpListenerContext httpContext)
125124
using (var reader = new StreamReader(httpRequest.InputStream, Encoding.UTF8))
126125
{
127126
var line = reader.ReadToEnd();
128-
var rpcContext = new HttpServiceContext(this, httpContext);
127+
var rpcContext = new GetworkContext(this, httpContext);
129128

130129
_packetLogger.Verbose("rx: {0}", line.PrettifyJson());
131130

src/CoiniumServ/Server/Mining/Getwork/Service/GetworkService.cs renamed to src/CoiniumServ/Server/Mining/Getwork/GetworkService.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
using CoiniumServ.Shares;
2929
using Serilog;
3030

31-
namespace CoiniumServ.Server.Mining.Getwork.Service
31+
namespace CoiniumServ.Server.Mining.Getwork
3232
{
3333
/// <summary>
3434
/// Getwork protocol implementation.
@@ -56,9 +56,6 @@ public GetworkService(IPoolConfig poolConfig, IShareManager shareManager, IDaemo
5656
[JsonRpcMethod("getwork")]
5757
public Daemon.Responses.Getwork Getwork(string data = null)
5858
{
59-
var context = (HttpServiceContext) JsonRpcContext.Current().Value;
60-
var miner = (IGetworkMiner) (context.Miner);
61-
6259
// TODO: fixme! instead use jobmanager and sharemanager.
6360

6461
if (data == null) // if miner supplied no data

src/CoiniumServ/Server/Mining/Stratum/Service/SocketServiceContext.cs renamed to src/CoiniumServ/Server/Mining/Stratum/StratumContext.cs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,13 @@
2121
//
2222
#endregion
2323

24-
using CoiniumServ.Mining;
25-
26-
namespace CoiniumServ.Server.Mining.Stratum.Service
24+
namespace CoiniumServ.Server.Mining.Stratum
2725
{
28-
public class SocketServiceContext
26+
public class StratumContext
2927
{
30-
public IMiner Miner { get; private set; }
28+
public IStratumMiner Miner { get; private set; }
3129

32-
public SocketServiceContext(IMiner miner)
30+
public StratumContext(IStratumMiner miner)
3331
{
3432
Miner = miner;
3533
}

0 commit comments

Comments
 (0)