Pages:
Author

Topic: New stratum/getwork proxy with Web-based GUI and pools management - page 25. (Read 120906 times)

jr. member
Activity: 32
Merit: 10
hey good news if you're thinking in crypto proxy Wink because you're proxy is great one  Grin
hero member
Activity: 969
Merit: 1000
full member
Activity: 217
Merit: 100
Could you send me a protocol dump when mining an a CryptoNight pool ? (Log file of your miner with JSON RPC requests/response or a PCAP capture). This will greatly help me to check my assumptions.
full member
Activity: 168
Merit: 100
Well yes, I realize everything you just said, but it's pretty trivial changes overall.

If CN use this communications flow, else use that communications flow
If CN use this call, else use that call/function/method

That's what's done in the code I showed you and it really wasn't bad at all in ccminer. Pretty trivial changes.

However, I would think the only "major" difference between the two situations is:
ccminer-> pool->ccminer
vs
ccminer->proxy->pool->proxy->ccminer

So there is an extra level of communication also with the client and just not the pool, but of course that's the nature of a proxy and it would use the same "flow".

But hey, I appreciate the consideration you gave it.  I'll keep pestering you from time to time.

Maybe if you get "thirsty" enough.  Smiley

Carlo
full member
Activity: 217
Merit: 100
Unfortunately, that is what I already saw. (The code is the same has the one I saw in cpuminer-multi).

The rpc2_* functions does not just use JSON-RPC 2.0 instead of 1.0, they also uses different method names with different parameters from the "real" stratum protocol.

For example, exchanges between the proxy and a "real" stratum pool (sha-256, scrypt, x11, x13...) are:

Proxy                             Pool
mining.subscribe ------->
                      <-------- mining.subscribe response
mining.authorize ------->
                      <-------- mining.authorize response
                      <-------- set_difficulty notification
                      <-------- mining.notify notification
mining.submit    -------->
                      <-------- mining.submit response
mining.submit    -------->
                      <-------- mining.submit response
                      <-------- mining.notify notification
mining.submit    -------->
                      <-------- mining.submit response
mining.submit    -------->
                      <-------- mining.submit response
                      <-------- set_difficulty notification
                      <-------- mining.notify notification


With a cryptonight pool, it should be like that (If you could provide me a protocol dump of a real mining session to confirm):

Proxy                             Pool
login                 ------->
                      <-------- login response
getjob              ------->
                      <-------- getjob response
submit              -------->
                      <-------- submit response
submit              -------->
                     <-------- submit response
getjob              ------->
                      <-------- getjob response
submit              -------->
                      <-------- submit response

You can see that methods are not the same (and parameters are not the same at all). Even the flow control is not the same at all, thus I cannot integrate this properly in the proxy.
full member
Activity: 168
Merit: 100
Hum... It makes me dream...so much beer...Tongue

More seriously, 3 months ago, I had tried to make CryptoNight work. The JSON RPC 2.0 is not the problem (it was working properly). The real problem is that the pool I have tried was not using the same JSON RPC method names and even the flow control was not the same (no need to subsribe, no difficulty notifications...). I read the cpuminer-multi (https://github.com/LucasJones/cpuminer-multi) and confirmed that different method names are used.

If you can provide me a PCAP capture (using Wireshark or tcpdump) of the communication between your miner and a pool, I may check once again. But sincerely, I think the CryptoNight protocol is too different to be integrated properly to the proxy. If it is not too complicated, MAYBE I will quickly fork the proxy with CryptoNight only compatibility.

If you want to take a quick look I'd suggest maybe this instead:
https://github.com/tsiv/ccminer-cryptonight

cpu-miner.c being probably the key file.

This is tsiv's miner built off ccminer which is a fork of cpuminer.  This is the code I've used in my nvMiner release.
You should be able to easily see what is different as this miner will work with both normal and CN stratum servers.
It's C code but close enough to Java you can read it and understand what is different.

rpc2_login
rpc2_login_decode
json_rpc2_call
json_rpc2_call_recur
rpc2_job_decode
get_upstream_work
submit_upstream_work

Being the functions you might want to take a look at. You should be able to see what is different or needed from a normal stratum to the CN mangled/changed stratum.

My guess is that you could do something very similar to the above approach and have one proxy that supports normal and CN stratum. From one programmer to another, I don't think it will end up being nearly as hard as you think it will be. But of course that's easy for me to say. lol

And the half keg is a legit offer. Of course any releases after CN could suffer for a while. Smiley

Carlo
full member
Activity: 217
Merit: 100
Hum... It makes me dream...so much beer...Tongue

More seriously, 3 months ago, I had tried to make CryptoNight work. The JSON RPC 2.0 is not the problem (it was working properly). The real problem is that the pool I have tried was not using the same JSON RPC method names and even the flow control was not the same (no need to subsribe, no difficulty notifications...). I read the cpuminer-multi (https://github.com/LucasJones/cpuminer-multi) and confirmed that different method names are used.

If you can provide me a PCAP capture (using Wireshark or tcpdump) of the communication between your miner and a pool, I may check once again. But sincerely, I think the CryptoNight protocol is too different to be integrated properly to the proxy. If it is not too complicated, MAYBE I will quickly fork the proxy with CryptoNight only compatibility.
full member
Activity: 168
Merit: 100
If you want to offer me a beer to help me improve the proxy, you are welcome. Grin Here is my donation address:    19wv8FQKv3NkwTdzBCQn1AGsb9ghqBPWXi

Get CryptoNight working and I'll buy you a can of beer.  This size:


I'll even throw in some of these to help with the hang-over:

 Grin

Carlo

PS I know you really don't want to support CN coins but I don't think it will really be that much trouble.  I've integrated CN into ccminer/nvminer and the changes needed were pretty trivial.
If memory serves me correctly it was just supporting JSON2 and an authentication issue.  Other then that I don't really remember any other changes needed. At least for integration into something like cpuminer/ccminer.

PS Shipping not included, so you'll have to pickup locally with BTC sent to your address. LOL

Can't blame a guy for trying.
full member
Activity: 217
Merit: 100
New stable version released (0.5.0): https://github.com/Stratehm/stratum-proxy/releases/tag/0.5.0

Changes since 0.4.0:
-Fix bug #8: Pool reconnection failure.
-Add HTTP Basic Authentication
-Add SSL support
-Add https redirection on http requests when ssl enabled
-Moved the donation address in a footer
-Fix a NullPointerException in the PriorityFailover strategy
-Fix the isActiveSince value
-Improve performance of stratum connections.
-Add some API methods for pool switching strategy management
-Add a --disable-log-append option to reset the log file on each proxy restart.
-Issue only one authorization request on pool if several workers try to authorize at the same time with option --append-worker-names
-Add --disable-api, --disable-stratum and --disable-getwork options
-Improve connections management performance.
-Add --pool-switching-strategy option to choose the pool switching strategy. Available are priorityFailover and weightedRoundRobin.
-Add the --weighted-round-robin-round-duration option
-Fix a bug when rebinding a worker connection to another pool using change extranonce and with option appendWorkerNames.
-Fix an exception when pool switching of a worker using the extranonce change notification.
-Add isReady, ready since and weight pool info in GUI
-Fix log directory not created if does not exist.
-Change --pool-no-notify-timeout default value from 120 seconds to 240 seconds.
-Add to Top/Bottom buttons
-Add change logs level on the logs page
-Add a logging page with live logging display
-Migrate database from Neodatis to db4o
-Show missing interval data on hashrate graph
-Add the Add pool feature to WebClient
-Add GUI features: disable/enable, remove pool and set the highest priority on a pool
-Fix pool displayed several times when pool menu selection several times.
-Added the donation address in the navbar

If you want to offer me a beer to help me improve the proxy, you are welcome. Grin Here is my donation address:    19wv8FQKv3NkwTdzBCQn1AGsb9ghqBPWXi
full member
Activity: 217
Merit: 100
No, no modification is saved on a proxy restart. But you can add the pool in the configuration file.
full member
Activity: 148
Merit: 100
Great ! If I add a pool through the web interface, does it remember it if I restart the proxy ?
full member
Activity: 217
Merit: 100
Not yet but it is in the todo list.
full member
Activity: 148
Merit: 100
Could you check that you have the file stratum-proxy-webapp.jar in the lib folder of your installation directory ? If not, maybe a bad update and extract it from the zip file. Else, could you tell me on which OS ?

Finally, the web server worked with version 0.5.0. Regarding the web server, is there any way to edit a pool ?
full member
Activity: 217
Merit: 100
I have published a snapshot of the 0.5.0 version: https://github.com/Stratehm/stratum-proxy/releases/tag/0.5.0-SNAPSHOT-22072014

As usual, it is mainly a test version (even if it should work properly). Thank you for your feedback.
full member
Activity: 217
Merit: 100
Surely this week. I think thursday or friday.
newbie
Activity: 5
Merit: 0
ETA for your next release? I see lots of new stuff added Smiley
full member
Activity: 217
Merit: 100
Could you check that you have the file stratum-proxy-webapp.jar in the lib folder of your installation directory ? If not, maybe a bad update and extract it from the zip file. Else, could you tell me on which OS ?
full member
Activity: 148
Merit: 100
Hi,

The web client is not working on my side :

Internal Server Error
Jar file was not found

     1: org.glassfish.grizzly.http.server.CLStaticHttpHandler.getJarFile(CLStaticHttpHandler.java:339)
     2: org.glassfish.grizzly.http.server.CLStaticHttpHandler.handle(CLStaticHttpHandler.java:278)
     3: strat.mining.stratum.proxy.Launcher$2.handle(Launcher.java:221)
     4: org.glassfish.grizzly.http.server.StaticHttpHandlerBase.service(StaticHttpHandlerBase.java:188)
     5: org.glassfish.grizzly.http.server.HttpHandler$1.run(HttpHandler.java:217)
     6: org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:565)
     7: org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:545)
     8: java.lang.Thread.run(Unknown Source)

Please see the log for more detail.
Grizzly 2.3.8

But the proxy runs well. How can I fix it ?
full member
Activity: 217
Merit: 100
This proxy cannot be used with cryptonight based coins. The pool minig protocol is not stratum but stratum-like.there is no plan to add compatibilty of the proxy with this protocol. But the project could be forked for cryptonight.
jr. member
Activity: 32
Merit: 10


Have you try it with cryptonight ?

Change my config  trying to monero pools like http://monero.crypto-pool.fr , but the proxy can't connect. Same with Monero pool to be, same problem

2014-07-19 22:55:39,068 DEBUG    [Pool-Monero Pool To Be-Thread]:strat.mining.stratum.proxy.utils.Timer$Task - Task SubscribeTimeoutTask-Monero Pool To Be removed.
2014-07-19 22:55:39,068 ERROR    [Pool-Monero Pool To Be-Thread]:strat.mining.stratum.proxy.pool.PoolConnection - Pool-Monero Pool To Be. JSON-RPC parsing error with line: {"id":1,"jsonrpc":"2.0","error":{"code":-1,"message":"invalid method"}}.
java.lang.NullPointerException
        at strat.mining.stratum.proxy.pool.Pool.processSubscribeResponse(Pool.java:376)
        at strat.mining.stratum.proxy.pool.PoolConnection.onSubscribeResponse(PoolConnection.java:125)
        at strat.mining.stratum.proxy.network.StratumConnection.onResponseReceived(StratumConnection.java:289)
        at strat.mining.stratum.proxy.network.StratumConnection.onLineRead(StratumConnection.java:224)
        at strat.mining.stratum.proxy.network.StratumConnection.access$200(StratumConnection.java:55)
        at strat.mining.stratum.proxy.network.StratumConnection$1.run(StratumConnection.java:152)

{
  "logDirectory" : "",
  "logLevel" : "DEBUG",
  "stratumListenPort" : 3334,
  "stratumListenAddress" : "0.0.0.0",
  "getworkListenPort" : 8334,
  "getworkListenAddress" : "0.0.0.0",
  "apiListenPort" : 8889,
  "apiListenAddress" : "0.0.0.0",
  "poolConnectionRetryDelay" : 5,
  "poolReconnectStabilityPeriod" : 5,
  "poolNoNotifyTimeout" : 120,
  "rejectReconnectOnDifferentHost" : false,
  "poolHashrateSamplingPeriod" : 600,
  "userHashrateSamplingPeriod" : 600,
  "connectionHashrateSamplingPeriod" : 600,
  "isScrypt" : false,
  "databaseDirectory": "",
  "hashrateDatabaseSamplingPeriod": 60,
  "hashrateDatabaseHistoryDepth": 7,
  "noMidstate": false,
  "apiLogLevel": "INFO",
  "validateSha26GetworkShares": true,
  "pools" : [ {
    "name" : "Monero Pool To Be",
    "host" : "xmr.crypto-pool.fr:3333",
    "user" : "moneroaddress",
    "password" : "x",
    "enableExtranonceSubscribe" : false,
    "appendWorkerNames" : false,
    "workerNameSeparator" : "_",
    "useWorkerPassword" : false,
    "isEnabled": true
  } ]
}

Pages:
Jump to: